• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CommunicationException

 
Jason Nerothin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey y'all. Post numero uno...

I'm working on a JBoss/MySQL/EJB application that used to work pretty well in JBoss 4.0.0DR3, but has been nothing but trouble and headaches for me in 4.0.0. Due to a start up error, I've taken a step back to 4.0.0RC2. OS: XPSP1.

I've looked around the ranch a bit, but haven't been able to find exactly what I'm looking for on this one, so here goes:

I'm writing a simple client to load data into the database, but have pared the code all the way back to the offending lines (in function init()):

//// begin client code

private static final String HOST = "localhost";

private static Hashtable getContext(String host) {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, host + ":1099");
env.put("java.naming.factory.url.pkgs", "org.jboss.naming rg.jnp.interfaces");
return env;
}

public void init(){
//SequenceSession sequenceSession = ((SequenceSessionHome)
PortableRemoteObject.narrow( new InitialContext(env).lookup("SequenceSessionEJB"), SequenceSessionHome.class);
//.create();
}
//// end client code

//// begin jndi.properties
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming rg.jnp.interfaces
java.naming.provider.url=jnp://localhost:1099
//// end jndi.properties

When I run the client from IntelliJ, I get:

javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.InvalidClassException: org.jnp.interfaces.MarshalledValuePair; local class incompatible: stream classdesc serialVersionUID = -6485622724173581497, local class serialVersionUID = -3403843515711139134]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:646)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:506)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at MOADLoadCSV.init(MOADLoadCSV.java:203)
at MOADLoadCSV.main(MOADLoadCSV.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.InvalidClassException: org.jnp.interfaces.MarshalledValuePair; local class incompatible: stream classdesc serialVersionUID = -6485622724173581497, local class serialVersionUID = -3403843515711139134
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:164)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:527)
... 9 more
Caused by: java.io.InvalidClassException: org.jnp.interfaces.MarshalledValuePair; local class incompatible: stream classdesc serialVersionUID = -6485622724173581497, local class serialVersionUID = -3403843515711139134
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:463)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:297)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:146)
... 11 more

//// When I run it with -Djava.security.manager from the command line, I get

java.security.AccessControlException: access denied (java.net.SocketPermission 2
30.0.0.4 connect,accept,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkMulticast(Unknown Source)
at java.net.MulticastSocket.joinGroup(Unknown Source)
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:10
70)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1197)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:515)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:508)
at javax.naming.InitialContext.lookup(Unknown Source)
at MOADLoadCSV.init(MOADLoadCSV.java:203)
at MOADLoadCSV.main(MOADLoadCSV.java:67)

//// I can telnet to the port directly, and have had the code running before under a different server (and therefore possibly different server-side settings.

Sort of at the going-half crazy stage now, but figure it's worth the effort if I can get my mind wrapped around all of this naming stuff. Thanks in advance for any help you may be able to give.

 
Justin joseph
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
first one (when running without security manager) the issue is because of invalid class at the client side. u might want to check ur classpath. u can also use the serialver tool to locate the problem.

in the seconf case, u have to edit the policy file in the jre to give required permissions for opening a socket in prot 1099.
 
Michael Meier
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i've got the same problem like Jason (using JBoss 4.0.0 and Tomcat 4.1.24).

Whats very interesting: also the serialVersionUID�s in my exception are the same. This means that the "incompatible class" is not one of my own. It has to be one of the JDK or JBoss. But I'm using the same JDk 1.4.2 for JBoss and Tomcat. And my Tomcat is pointing to the jbossall-client.jar of my Jboss-Installation (they're not even copied).

Does anyone have a suggestion which class might cause this problem?

Thanks in advance.

My exception:
javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.InvalidClassException: org.jnp.interfaces.MarshalledValuePair; local class incompatible: stream classdesc serialVersionUID = -6485622724173581497, local class serialVersionUID = -3403843515711139134]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:647)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
at javax.naming.InitialContext.lookup(Unknown Source)
at de.deutscherring.vermittler.remote.VermittlerRemoteFabrik.init(VermittlerRemoteFabrik.java:92)
at de.deutscherring.vermittler.remote.VermittlerRemoteFabrik.<init>(VermittlerRemoteFabrik.java:76)
at de.deutscherring.eBusiness.makler.ControllerForgottenPwd.doReset(ControllerForgottenPwd.java:107)
at de.deutscherring.eBusiness.makler.ControllerForgottenPwd.doCommand(ControllerForgottenPwd.java:61)
at de.deutscherring.eBusiness.base.MainControllerBase.doCommand(MainControllerBase.java:70)
at de.deutscherring.eBusiness.makler.Controller.service(Controller.java:39)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:466)
at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:216)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Unknown Source)
Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.InvalidClassException: org.jnp.interfaces.MarshalledValuePair; local class incompatible: stream classdesc serialVersionUID = -6485622724173581497, local class serialVersionUID = -3403843515711139134
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
... 42 more
Caused by: java.io.InvalidClassException: org.jnp.interfaces.MarshalledValuePair; local class incompatible: stream classdesc serialVersionUID = -6485622724173581497, local class serialVersionUID = -3403843515711139134
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at sun.rmi.server.UnicastRef.unmarshalValue(Unknown Source)
... 45 more
 
Michael Meier
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

sometimes you just need to write down the problem:

org.jnp.interfaces.MarshalledValuePair is the class which caused the problem (first I've tought it's just part of the call-stack). And this class is from jbossall-client.jar. So I've found that there was an old jbossall-client.jar in one of the webs loaded by tomcat and tomcat took this one instead of the one I�ve configured. This problem didn't showed up when I�ve updated from 3.2.3 to 4.0.0 some weeks ago, so I believed everythings fine with the update.

This took me one day - java rulez!

@Jason: I hope this might help you as well.
 
Jason Nerothin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael:

Way to go - that was it exactly.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic