tags:

views:

631

answers:

1

I've got an application that is trying to call a method on an EJB running on JBoss 4.2.3 GA.

The application is a legacy app; it works when it accesses the original server which ran on JBoss 4.0.1. Its RMI code is in jbossall-client.jar from JBoss 4.0.1. It is trying to call a method which will give it new code to allow it to update itself. So I've got to get it working as is; the only changes I can make are on the server side. At worst, I might have to set up a 4.0.1 JBoss server which can process these requests from older versions.

In the meantime though, I'd like to understand why it is failing and if there is anything I can do to fix it.

Right now it fails in new InitialContext().

This is the stack trace:

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
A: 

The exception came from using a feature which is undocumented outside of the source code (at least as far as I've been able to find). This is where an InvokerURL is specified as a system property that is resolved on the client side (the feature is useful if the JBoss server is inside a NAT).

When the client doesn't have the property defined in its system properties, it throws the NPE instead of reporting the problem with the InvokerURL that it received.

abunetta