Skip to main content

Glassfish standalone client application built with Maven

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
ftg314159
Offline
Joined: 2008-12-14

I am trying to make a standalone JMS application which is currently working with JBoss work with Glassfish. The GF Im using is a current 4.0 that came as part of the Oracle JEE 7.0 download.

I have tried getting an InitialContext with and without a jndi.properties file, but I get the same NullPointerException in each case. Here's the jndi.properties:

java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory
java.naming.factory.url.pkgs=com.sun.enterprise.naming
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl
java.naming.provider.url=java://192.168.3.102:8686

Using Google, I found others with a similar problem who claim to have fixed it by manually including appserv-rt.jar and gf_client.jar from the GF subdirectories. The problem is, I am building the project with Maven, and I don't want to shoehorn a bunch of JARs in manually.

Does anyone have a definitive list of Maven dependencies that will add the needed JARs to a standalone client application ? In searching the Maven repositories with the NetBeans tool, I find several hits for appserv-tr and gf-client, but I can't tell which are correct. When I add the ones I've tried to add, I either continue to get the NPE or else the project build fails saying that POMs for 7 or 8 GF JARs are missing.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ftg314159
Offline
Joined: 2008-12-14

I've found postings through Google which claim that you just have to add gf-client as a dependency, but when I add:


org.glassfish.main.appclient
gf-client
4.0-b72

I get

The POM for org.glassfish.main:javax.ejb:jar:4.0-b72 is missing, no dependency information available
The POM for org.glassfish.main:javax.annotation:jar:4.0-b72 is missing, no dependency information available
The POM for org.glassfish.main:javax.transaction:jar:4.0-b72 is missing, no dependency information available
The POM for org.glassfish.main:javax.enterprise.deploy:jar:4.0-b72 is missing, no dependency information available
The POM for org.glassfish.main:javax.resource:jar:4.0-b72 is missing, no dependency information available
The POM for org.glassfish.main:javax.security.auth.message:jar:4.0-b72 is missing, no dependency information available
The POM for org.glassfish.main:javax.security.jacc:jar:4.0-b72 is missing, no dependency information available
The POM for org.glassfish.main:javax.management.j2ee:jar:4.0-b72 is missing, no dependency information available
The POM for org.glassfish.main.appclient:gf-client-l10n:jar:4.0-b72 is missing, no dependency information available
The POM for org.glassfish:javax.javaee:jar:10.0-SNAPSHOT is missing, no dependency information available