我有一个应用程序试图调用在 JBoss 4.2.3 GA 上运行的 EJB 上的方法。
该应用程序是旧版应用程序;它在访问在 JBoss 4.0.1 上运行的原始服务器时工作。它的 RMI 代码在 JBoss 4.0.1 的 jbossall-client.jar 中。它正在尝试调用一个方法,该方法将为其提供新代码以允许其自我更新。所以我必须让它按原样工作;我能做的唯一改变是在服务器端。在最坏的情况下,我可能不得不设置一个 4.0.1 JBoss 服务器来处理来自旧版本的这些请求。
但与此同时,我想了解它为什么会失败,以及我是否可以采取任何措施来解决它。
现在它在 new InitialContext() 中失败了。
这是堆栈跟踪:
javax.naming.NamingException: Failed to retrieve Naming interface [Root exception is java.lang.NullPointerException]
at org.jboss.naming.HttpNamingContextFactory.getInitialContext(HttpNamingContextFactory.java:69)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at Main.main
Caused by: java.lang.NullPointerException
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1820)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.jboss.proxy.ClientContainer.readExternal(ClientContainer.java:148)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.jboss.invocation.MarshalledValue.get(MarshalledValue.java:78)
at org.jboss.naming.HttpNamingContextFactory.getNamingServer(HttpNamingContextFactory.java:123)
at org.jboss.naming.HttpNamingContextFactory.getInitialContext(HttpNamingContextFactory.java:65)
... 17 more