views:

216

answers:

2

I am migrating a JSF 1.1 application to JEE 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 able 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 JEE 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.

A: 

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.

Justin
Thanks - interesting pointer, but it seems the developers do not have this in place already. I wonder how they do actual work?
Thorbjørn Ravn Andersen
A: 

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.

Pascal Thivent
Thanks, that page helps a lot. I found the build page first, and then got so focused on first getting the build done (according to the page with build instructions) and then run "mvn eclipse:eclipse" on that build, that I didn't think outside the box. Initial testing shows that both Netbeans and IDEA can work directly with extracting the appropriate subversion location, but that I find IDEA more intuitive to navigate for an Eclipse-person.
Thorbjørn Ravn Andersen