I have existing rmi server running with jvm 1.5 and client running in jvm 1.6 communicating with no issues.
However, when i run (server under JVM 1.7/ client jvm1.7) OR (server under JVM 1.7/ client jvm 1.6)getting following error -
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.EOFException
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.EOFException
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at com.tmobile.kiosk.simulator.Kiosk.<init>(Unknown Source)
at com.tmobile.kiosk.simulator.Kiosk.main(Unknown Source)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(Unknown Source)
With (Server jvm 1.5/ client jvm 1.7) getting following error -
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: com.xxx.yyy.zzzserver.ZZZServerFactoryImpl_Stub (no security manager: RMI class loader disabled)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
Is this happening due to RMI changes across Java versions?
Can i run rmi Server in JVM 1.7 without any code changes so that existing clients (jvm 1.5 etc) can connect to it.
We are not rebuilding the jar file which was built probably using java 1.4 or 1.5.
Thanks in Advance
Problem was some old jar versions being part of classpath.
Related
How to run the rmiregistry and RMI server with the right parameters on the remote host?
Got this problem when running the RMI client:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.net.MalformedURLException: unknown protocol: c
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at com.labros.client.TestClient.main(TestClient.java:33)
Caused by: java.net.MalformedURLException: unknown protocol: c
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
I started the rmiregistry on the remote host with the following:
rmiregistry -J-Djava.rmi.server.codebase=file:///export/home/timsadm/Projects/rmi-server/classes -J-Djava.security.policy=/export/home/timsadm/Projects/rmi-server/classes/java.policy &
and the server with
java -Djava.rmi.server.codebase=file:///export/home/timsadm/Projects/rmi-server/classes -Djava.security.policy=/export/home/timsadm/Projects/rmi-server/classes/java.policy com.labros.server.Server
Server started
java -Djava.rmi.server.codebase=file:///export/home/timsadm/Projects/rmi-server/classes
and
java.net.MalformedURLException: unknown protocol: c
These are mutually contradictory. I suspect your codebase parameter really looks like this:
-Djava.rmi.server.codebase=c:/export/home/timsadm/Projects/rmi-server/classes
which isn't a valid URL.
But why are you using the codebase feature at all? A file: codebase URL only works within a single host, in which case you don't need the codebase feature at all, or if it specifies a shared filesystem from the point of view of the Registry and the client, which this one doesn't appear to do. Normally codebase URLs are http: or ftp:, and they refer to a JAR file.
I had an application which is tightly coupled with jacorb and it is working great with Jboss. Now, i have to migrate this application to deploy the same in Websphere 8.5.5. General flow is , my application will reach another system (developed in C++) through corba usign jacorb. since IBM is having its own ORB implementations, My application is getting deployed in websphere. If my application is modified to make use of IBM orb jars, then 80% of applciation have to change. Kindly suggest me the way to include jacord proeprties and jar to resolve the errors.
My trails : All trails are independent to each other.
1) Kept my orb.properties, jacorb.jar and removed IBM orb.properties in WAS->JAVA->JRE->lib
2) Included my files in JVM classpath through Admin console.(Server failed to start after this change).
3) Modified the IBM orb.properties with jacorb properties but getting classcast exceptions.
Errors:
[3/4/15 0:52:23:175 PST] 00000001 ContainerHelp E WSVR0501E: Error creating component null [class com.ibm.ws.runtime.component.ORBImpl]java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:877)
at org.jacorb.config.JacORBConfiguration.setAttribute(Unknown Source)
at org.jacorb.config.JacORBConfiguration.setAttributes(Unknown Source)
at org.jacorb.config.JacORBConfiguration.init(Unknown Source)
at org.jacorb.config.JacORBConfiguration.<init>(Unknown Source)
at org.jacorb.config.JacORBConfiguration.getConfiguration(Unknown Source)
at org.jacorb.orb.ORB.set_parameters(Unknown Source)
at org.omg.CORBA.ORB.init(ORB.java:371)
at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:92)
[3/4/15 0:52:23:347 PST] 00000001 ContainerHelp E WSVR0501E: Error creating component com.ibm.ws.naming.bootstrap.NameServerImpl#e69374e2[_serverProcessType=UnManagedProcess, _listener=null,
Caused by: javax.naming.NamingException: Failed to initialize the ORB [Root exception is java.lang.reflect.InvocationTargetException]
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:400)
at com.ibm.ws.naming.urlbase.UrlContextImpl.<init>(UrlContextImpl.java:177)
at com.ibm.ws.naming.urlns.genericURLContext.<init>(genericURLContext.java:83)
at com.ibm.ws.naming.urlns.genericURLContextRoot.<init>(genericURLContextRoot.java:79)
at com.ibm.ws.naming.urlns.genericURLContextFactory.createURLContextRoot(genericURLContextFactory.java:110)
... 51 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:391)
... 55 more
Caused by: java.lang.ClassCastException: org.jacorb.orb.ORB incompatible with com.ibm.CORBA.iiop.ORB
at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:92)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:179)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:83)
at
Thanks for your support in advance.
I am working with a relativly unknown API. (ScrumWorks Pro) I am using it to export data into a SQL database. My issue is that I have moved my eclipse project from one computer to another and it stopped working. It continues to run fine on the old computer but I am getting the following error
Exception in thread "main" javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://XXXXXXX:8080/scrumworks-api/api2/scrumworks?wsdl. It failed with:
Got Server returned HTTP response code: 503 for URL: http://XXXXXXXXXX:8080/scrumworks-api/api2/scrumworks?wsdl while opening stream from http://dxzbid01.zhi.com:8080/scrumworks-api/api2/scrumworks?wsdl.
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(Unknown Source)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(Unknown Source)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)
at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(Unknown Source)
at javax.xml.ws.Service.<init>(Unknown Source)
at javax.xml.ws.Service.create(Unknown Source)
at com.danube.scrumworks.api2.ScrumWorksService.getConnection(ScrumWorksService.java:53)
at main.connectAPI(main.java:69)
at main.main(main.java:12)
Caused by: java.io.IOException: Got Server returned HTTP response code: 503 for URL: http://XXXXXXXXX:8080/scrumworks-api/api2/scrumworks?wsdl while opening stream from http://XXXXXXXXXXXXX.com:8080/scrumworks-api/api2/scrumworks?wsdl
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.createReader(Unknown Source)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(Unknown Source)
... 11 more
Caused by: java.io.IOException: Server returned HTTP response code: 503 for URL: http://XXXXXXXXXXX:8080/scrumworks-api/api2/scrumworks?wsdl
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
... 13 more
It looks like while it's running its failing to connect to the host. But it works completely fine with the exact same credentials on the other computer.
The magic words: Server returned HTTP response code: 503. The answer will be in your server logs.
From https://www.rfc-editor.org/rfc/rfc2616#section-10.5.4:
The server is currently unable to handle the request due to a
temporary overloading or maintenance of the server.
make sure that url
http://XXXXXXXXXX:8080/scrumworks-api/api2/scrumworks?wsdl
is accessible, if not able to access the 8080 port, check your firewall settings in that machine (allow that 8080 port to accessible)
The problem was that the newer computer had a newer version of Java installed which broke parts of the API.
I have the problem that my RMI Application Client isn't working when i hit the "run" Button in Eclipse. It throws the following exception:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.net.MalformedURLException: unknown protocol: rsrc
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
...
I looked on the internet and people seem to have that problem when generating JARs from eclipse. But my (ant-built) jars work fine, just inside Eclipse it's not doing as it should!
InterfaceRemota objetoRemoto = (InterfaceRemota)Naming.lookup("//localhost:1097/ObjetoRemoto");
I found a solution, before starting the rmiregistry server I have to clean the java classpath using "set CLASSPATH="
c: > set CLASSPATH=
c: > rmiregistry
when I run my server application on eclipse it doesn't work and the error is shown as following:
java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at MyServer.main(MyServer.java:17)
Exception in thread "main" java.lang.NullPointerException
at MyServer.main(MyServer.java:26)
I think you forgot to initialize the port and you are trying to connect to port=0 that is invalid. I thing that your application receives port via command line. When you are running it from eclipse you forgot to provide it. Do it using the run/debug configuration.
It is just a theory. I do not see your code.