Glassfish 3: How do I get and use a developers build so I can navigate a stack trace including Glassfish code?
I am migrating a JSF 1.1 application to Java EE 6 Web profile, and doing it in steps. I am in the process of moving from JSP with JSF 1.1 to Facelets under JSF 1.2 using the jsf-facelets.jar for JSF 1.2, and received an "interesting" stack trace when trying to lookup a key in a Map using a "{Bean.foo.map.key}" where the stacktrace complained about "key" not being a valid integer. (After code introspection I am workarounding it using a number as the key). That bug is not what this question is about.
In such a situation it is essential to be abl开发者_Go百科e to navigate the source of every line in the stack trace. In Eclipse I normally attach a source jar to every jar on the build path, but in this particular case the Glassfish server adapter creates a library automatically containing the jars. Also there is to my knowledge no debug build of Glassfish where sources are included in the bundle.
Glassfish is a non-trivial Maven project, and a bit picky too. I am not very familiar with maven, but have managed to checkout the code from Subversion and build it for the 3.0 tag according to http://wiki.glassfish.java.net/Wiki.jsp?page=V3FullBuildInstructions#section-V3FullBuildInstructions-CheckoutTheWorkspace - it appears to be the code corresponding to the official released 3.0 version.
After finishing the "mvn -U install" part, I have then tried to create Eclipse projects by first using "mvn -DdownloadSources=true eclipse:eclipse" and then import them in Eclipse Java EE 3.5.2 and specifying the M2_REPO variable but many of the projects still have compilation errors, and I cannot locate any instructions from Oracle about how to do this.
I'd appreciate some help in just getting a functional IDE workspace reflecting the 3.0 version of Glassfish. I have Eclipse 3.5.2, Netbeans 6.8 and 6.9 beta, and IntelliJ IDEA 9, and Linux/Windows/OS X do do it on.
Doesn't http://wiki.glassfish.java.net/Wiki.jsp?page=V3DevelopmentInstructions help?
By the way, if mvn install
ran fine, it should definitely be possible to import the project under Eclipse after mvn eclipse:eclipse
without compilation errors. I can't reproduce the problem right now but I really wonder why you get compilation errors (e.g. is it because of missing dependencies?).
Alternatively, you could try to open the project under NetBeans or IDEA, they both can understand a pom.xml
out of the box.
But as I said, it should also work with Eclipse if compiling on the command line succeeds.
There was a recent thread on the glassfish mailing list about debugging glassfish. Here is a link to the relevant thread if you follow that thread you should be on your way.
精彩评论