The server can be added in the Servers view and starting and stopping works nicely.
However, adding the server runtime to the classpath of a project like this does not work:
- Right click on project > Properties
- Select Java Build Path
- Select the Libraries tab
- Click Add Library...
- Choose Server Runtime
Actual: The resulting selection dialog is empty.
Expected: The dialog lists a GlassFish 3.1 runtime.
As a result, the classpath does not contain the Java EE and JPA APIs, resulting in compile errors. This used to work with earlier versions of the plugin (e.g. the one from http://download.java.net/glassfish/eclipse/indigo).
The problem exists at least in the following configurations:
- Eclipse 4.3 RC3 with GlassFish Tools 6.0.2.201306071627 and a GlassFish 3.1.2.2 server
- Eclipse 4.2.2 with GlassFish Tools 5.2.2.201305291930 and a GlassFish 3.1.2.2 server
An ugly workaround (until this is fixed) is to manually add the following (possibly more) jars via Add External Jars...:
glassfish/lib/javaee.jar
glassfish/modules/org.eclipse.persistence.core.jar
glassfish/modules/org.eclipse.persistence.jpa.jar
glassfish/modules/org.eclipse.persistence.asm.jar
glassfish/modules/org.eclipse.persistence.antlr.jar
The problem with the above is that it adds absolute paths to .classpath and therefore can not be committed to the repository.