When trying to connect to JBoss from an Eclipse plug-in, I either get
the following exception:
javax.naming.CommunicationException [Root exception is
java.rmi.UnmarshalException: Error unmarshaling return; nested
exception is: java.net.SocketException: Connection reset]
or:
javax.naming.CommunicationException [Root exception is
java.rmi.ServerException: RemoteException occurred in server thread;
nested
exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested
exception is:
java.net.MalformedURLException: no protocol: and]
The failure occurs at context.lookup(...); even context.lookup("bla")
fails.
Properties p = new Properties();
p.setProperty(InitialContext.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
p.setProperty(InitialContext.PROVIDER_URL,
"jnp://" + host + ":1099");
p.setProperty(InitialContext.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
Thread.currentThread()
.setContextClassLoader(getClass().getClassLoader());
Context context = new InitialContext(p);
Object ref = context.lookup(TestRemoteSessionHome.JNDI_NAME); // FAIL
TestRemoteSessionHome home = (TestRemoteSessionHome)
PortableRemoteObject.narrow(ref, EJBHome.class);
TestRemoteSession session = home.create();
...
Note that if I do not change the class loader, the InitialContext can't
be created. Switching the original class loader back immediately after
creating the InitialContext doesn't change anything.
Any ideas?
--
Eric Jain
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user