I have simple standalone JMS application which should connect to Glassfish v3, lookup JMS ConnectionFactory and Destination and do messaging. I've used the following guide to write client:
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#StandaloneRemoteEJB .To run client do the following steps:
1) Copy the libraries defined in lib/dir.txt from Glassfish v3 distribution to project lib directory.
2) Run: mvn clean assembly:assembly . Target application will be created in target/gfclient-1.0-dist/gfclient-1.0 directory.
3) Run application: ./target/gfclient-1.0-dist/gfclient-1.0/bin/run.sh .
Glassfish v3 server expected to be running locally with all default values and configured JMS ConnectionFactory as defined in picture in attachment.
After startup application raises the following error:
bulat_at_nigmatullin:~/IdeaProjects/glassjmstest/gfclient$ ./target/gfclient-1.0-dist/gfclient-1.0/bin/run.sh
java.lang.NullPointerException
at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:297)
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:271)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:430)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.bulatnig.Main.simple(Main.java:19)
at org.bulatnig.Main.lookup(Main.java:46)
at org.bulatnig.Main.main(Main.java:53)
javax.naming.NamingException: Lookup failed for '/jms/TestConnectionFactory' in SerialContext [Root exception is javax.naming.NamingException: Unable to acquire SerialContextProvider for SerialContext [Root exception is java.lang.NullPointerException]]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.bulatnig.Main.simple(Main.java:19)
at org.bulatnig.Main.lookup(Main.java:46)
at org.bulatnig.Main.main(Main.java:53)
Caused by: javax.naming.NamingException: Unable to acquire SerialContextProvider for SerialContext [Root exception is java.lang.NullPointerException]
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:276)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:430)
... 4 more
Caused by: java.lang.NullPointerException
at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:297)
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:271)
... 5 more
What does this exception mean? And how to fix it?
[Message sent by forum member 'bulatka']
http://forums.java.net/jive/thread.jspa?messageID=482091