Rmi SocketTimeoutException
Hi,
We�re using a RMI connection. In rare occasions, when the api calls that the rmi server performs take too much time, we get an UnmarshalException which wraps a SocketTimeOutException. It happens 60 seconds after the client sent request to the server, even though we set the socketTimeOut (through SocketFactory) to 3 minutes.
Another side effect is that the whole Application (rmi client side) stuck.
We think that it might have something to do with the rmi garbage collection, which by default happens every 60 seconds, so we set these parameters as well:
-Dsun.rmi.dgc.server.gcInterval=600000 -Dsun.rmi.dgc.client.gcInterval=600000
And just on the safe side set this parameter:
-Dsun.rmi.activation.groupTimeout=600000
But nothing seems to work. We still get the UnmarshalException, after 60 seconds.
If you have a suggestion, or encountered the same problem, please advise.
Thanks,
Libby
My rmi server performs API calls to a dll. For example, one of these API calls is connect to some remote server. Connect can take up to 5 minutes. So, obviously I don't want to get timeout exception after just 1 minute. Is there a way to avoid getting the exception, and letting the server still work?
This is the SocketFactory I'm using:
public class TimedRMIClientSocketFactory implements RMIClientSocketFactory,
Serializable {
private static final long serialVersionUID = 7765561455399852985L;
private Integer mTimeOut;
public Integer getTimeOut() {
return mTimeOut;
public void setTimeOut(Integer aTimeOut) {
mTimeOut = aTimeOut;
public Socket createSocket(String host, int port) throws IOException {
Socket s = new Socket(host, port);
s.setSoTimeout(mTimeOut); //RMI-TODO change
return s;
}And this is the thread that registers the server
public void run() {
Registry registry = null;
String name = "PAWCJNIServer";
try {
ObjectInputStream ois = new ObjectInputStream(System.in);
MarshalledObject mo = (MarshalledObject) ois.readObject();
IJNICommRMIClient ps = (IJNICommRMIClient) mo.get();
pawcJNIServer = new JNICommRMIServer();
TimedRMIClientSocketFactory mySocketFactory = new TimedRMIClientSocketFactory();
mySocketFactory.setTimeOut(mTimeOut);
UnicastRemoteObject.exportObject(pawcJNIServer, 0, mySocketFactory, RMISocketFactory.getDefaultSocketFactory());
ps.registerServer(pawcJNIServer);
lastQueryDate = new Date();
while (true) {
try {
Thread.sleep(mSleepTime); // check every minute
catch (InterruptedException e) {
myLogger.log(Level.INFO, "RMIThread interrupted");
myLogger.log(Level.FINER, "in rmi thread - woke up checking if should shutdown");
if (System.currentTimeMillis() - lastQueryDate.getTime() > mTimeOutBeforeShutDownMyself) {
myLogger.log(Level.INFO, "in rmi thread - should shutdown");
break;
else {
myLogger.log(Level.FINER, "in rmi thread - should not shutdown");
clean(registry, name);
myLogger.log(Level.INFO, "in rmi thread - finished clean, shut down now....");
catch (Exception e) {
myLogger.log(Level.INFO, "RMI thread got exception", e);
myLogger.log(Level.INFO, "in rmi thread - cleaning registry");
clean(registry, name);
myLogger.log(Level.INFO, "in rmi thread - finished clean, shut down now....");
}Thanks,
Libby
Similar Messages
-
I have a rmi call.
Client: JDK1.5.0_06 Windows 2003
Server: JDK1.5.0_06 Windows XP
I got following exceptions in client side sometimes, but not always:
java.rmi.MarshalException: error marshalling arguments; nested exception is:
java.net.SocketException: Connection reset by peer: socket write error
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
So I set -Dsun.rmi.server.exceptionTrace=true property to server side and got following exceptions:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.SocketTimeoutException: Read timed out
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
60)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:701)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java
:2217)
at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream
.java:2616)
at java.io.ObjectInputStream$BlockDataInputStream.readFully(ObjectInputS
tream.java:2646)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1609)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1293)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1628)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1293)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:19
12)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
713)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream
Is this problem caused by network or do you have any work around for it?try to increase the socket read duration by adding -Dcom.sun.CORBA.transport.ORBTCPReadTimeouts= to the variable list of your JVM.
If it does not work, you can take a look at the sun bug 6553303 or search for the related bugs from the bug database. I saw a similar bug before. -
SocketTimeoutException prblem - please advise
Hi all,
I'm performing an RMI call to the server in order to perform a task which is time consuming.
After exactly 3 minutes, the client crashes with the following exception:
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.net.SocketTimeoutException: Read timed out
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:203)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at com.audioCodes.ems.server.framework.DispatcherImpl_Stub.sendRequest(DispatcherImpl_Stub.java:126)
at com.audioCodes.ems.server.framework.emsCli.EmsCli.performManualBackup(EmsCli.java:321)
at com.audioCodes.ems.server.framework.emsCli.EmsCli.main(EmsCli.java:267)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:284)
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:319)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:720)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:677)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at java.io.DataInputStream.readByte(DataInputStream.java:241)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
... 4 more
I tried to set both sun.rmi.transport.connectionTimeout and sun.rmi.transport.handshakeTimeout to much longer timeout but it didn't work.
What could be the problem? Which timeout does it refer to?Java concurrency and threading models are so good and easy to use. I am just wondering why you don't use them to implement your own timeout.
In my design, I use the SwingWorker to fire a call with any timeout I want. I poll its status and if it expires, I completely abandon the call and start over. The call would eventually expire and the resources get garbage collected. And hopefully, the sockets/connections are cleaned up properly (that would be a different subject.). If the call is completed properly within the timeout I set, the SwingWorker will update the GUI or whatever objects. -
Hello,
I am working with melilta and amilcare both written in java.
My problem is when I try to run the melitaserver it shows the error message:
"Melita startup script
Using AMILCARE_HOME: "."
"D:\j2sdk\bin\java" -Xmx200M -Djava.library.path=./runtime -cp "./lib/melita.jar
;./lib/jRegistryKey.jar;D:\j2sdk/lib/tools.jar;./lib/jena.jar;./lib/icu4j.jar;./
lib/gate.jar;./lib/guk.jar;./lib/amilcare.jar" melitaserver.MelitaServer
Rmiregistry located at D:\Program Files\Java\jre1.5.0_05\bin\rmiregistry.exe and
launched !
Information found in path: file:/D:/Documents%20and%20Settings/Dena/Desktop/meli
ta/melita2.0/lib/melita.jar
Amilcare being initialised ...
Amilcare Server exception: error during JRMP connection establishment; nested ex
ception is:
java.net.SocketTimeoutException: Read timed out
java.rmi.ConnectIOException: error during JRMP connection establishment; nested
exception is:
java.net.SocketTimeoutException: Read timed out
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:274
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at melitaserver.MelitaServer.main(MelitaServer.java:149)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
at java.io.DataInputStream.readByte(DataInputStream.java:331)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:215
... 5 more
Can anyone help me?
Best regardsHello!
Have you figured out the cause of problem for that exception? I also encountered that, the difference only is I use IBM Websphere.
What did you do to solve it? Hope you can reply.
Thanks! -
SocketTimeoutException when trying to contact a web service
Hi,
I'm using WebLogic 9.2.2 with Java 1.5. I'm trying to contact a web service, which runs on http, port 80. Although I can SSH in to the weblogic server and run "wget http://myservice/WSDL", when I try and contact it through my code, I'm getting
ERROR 2009-05-13 09:35:54,521 - [com.myco.regui.struts.accounts.AccountsForm::contactWPS] - Failed to contact provisioning service.
java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://schemas.xmlsoap.org/soap/envelope/}Server] FaultString [Failed to receive message java.net.SocketTimeoutException: Read timed outRead timed out] FaultActor [null] Detail [<detail>java.net.SocketTimeoutException: Read timed out
</detail>]; nested exception is:
javax.xml.rpc.soap.SOAPFaultException: Failed to receive message java.net.SocketTimeoutException: Read timed outRead timed out
at com.myco.regui.provisioning.client.ProvisioningAccountServicePortType_Stub.get(ProvisioningAccountServicePortType_Stub.java:37)
at com.myco.regui.struts.accounts.AccountsForm.contactWPS(AccountsForm.java:216)
at com.myco.regui.struts.accounts.AccountsForm.validateAccountid(AccountsForm.java:167)
at com.myco.regui.struts.accounts.AccountsForm.validatePCAccountId(AccountsForm.java:135)
at com.myco.regui.struts.accounts.AccountsForm._validatePCFields(AccountsForm.java:116)
at com.myco.regui.struts.accounts.AccountsForm.validate(AccountsForm.java:90)
at org.apache.struts.chain.commands.servlet.ValidateActionForm.validate(ValidateActionForm.java:58)
at org.apache.struts.chain.commands.AbstractValidateActionForm.execute(AbstractValidateActionForm.java:120)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3231)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2002)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1908)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1362)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: javax.xml.rpc.soap.SOAPFaultException: Failed to receive message java.net.SocketTimeoutException: Read timed outRead timed out
at weblogic.wsee.codec.soap11.SoapCodec.decodeFault(SoapCodec.java:273)
at weblogic.wsee.ws.dispatch.client.CodecHandler.decodeFault(CodecHandler.java:106)
at weblogic.wsee.ws.dispatch.client.CodecHandler.decode(CodecHandler.java:91)
at weblogic.wsee.ws.dispatch.client.CodecHandler.handleFault(CodecHandler.java:79)
at weblogic.wsee.handler.HandlerIterator.handleFault(HandlerIterator.java:254)
at weblogic.wsee.handler.HandlerIterator.handleResponse(HandlerIterator.java:224)
at weblogic.wsee.ws.dispatch.client.ClientDispatcher.handleResponse(ClientDispatcher.java:161)
at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:116)
at weblogic.wsee.ws.WsStub.invoke(WsStub.java:89)
at weblogic.wsee.jaxrpc.StubImpl._invoke(StubImpl.java:335)
at com.myco.regui.provisioning.client.ProvisioningAccountServicePortType_Stub.get(ProvisioningAccountServicePortType_Stub.java:32)
... 28 more
Does anyone know what the next steps I need to take to troubleshoot this problem? Thanks, - DaveHi ,
I need some information for to aviod the following error.
1. when this error will occur.We are using weblogic 8.1 SP5 and sun solaris sparc 10.
2. Application is running on cluster.
May 27, 2009 10:40:17 AM FJT> <Error> <Cluster> <BEA-000126> <All session objects should be serializable to replicate. Check the objects in your session. Failed to replicate non-serializable object.>
error in parsejava.net.SocketTimeoutException: Read timed out
<May 27, 2009 10:50:07 AM FJT> <Error> <WebLogicServer> <BEA-000337> <ExecuteThread: '19' for queue: 'weblogic.kernel.Default' has been busy for "1,380" seconds working on the request "Http Request: /main/pblistener", which is more than the configured time (StuckThreadMaxTime) of "600" seconds.>
<May 27, 2009 11:00:07 AM FJT> <Error> <WebLogicServer> <BEA-000337> <ExecuteThread: '18' for queue: 'weblogic.kernel.Default' has been busy for "1,139" seconds working on the request "Http Request: /main/pblistener", which is more than the configured time (StuckThreadMaxTime) of "600" seconds.>
<May 27, 2009 11:10:07 AM FJT> <Error> <WebLogicServer> <BEA-000337> <ExecuteThread: '18' for queue: 'weblogic.kernel.Default' has been busy for "1,739" seconds working on the request "Http Request: /main/pblistener", which is more than the configured time (StuckThreadMaxTime) of "600" seconds.> -
I'm working on getting RMI based cache coordination functioning in my application using Eclipselink 1. I am using the 'INVALIDATE_CHANGED_OBJECTS' annotation and trying to get changed objects to propigate across 2 servers. I am using a function I got from the eclipselink list:
public void customize(Session session) throws Exception {
AbstractSession sessionImpl = (AbstractSession) session;
RemoteCommandManager cm = new RemoteCommandManager(sessionImpl);
cm.setShouldPropagateAsynchronously(true);
cm.getDiscoveryManager().setAnnouncementDelay(10);
cm.getTransportManager().setNamingServiceType(
TransportManager.REGISTRY_NAMING_SERVICE);
cm.setUrl("rmi://localhost:8881");
cm.setServerPlatform(sessionImpl.getServerPlatform());
sessionImpl.setCommandManager(cm);
sessionImpl.setShouldPropagateChanges(true);
cm.initialize();
try {
Thread.sleep(2000);
} catch (Exception ignore) {
and getting my factories as such:
emf = Persistence.createEntityManagerFactory(s);
new RMICacheCoordinationConfig().customize(JpaHelper.getServerSession(emf));
em = emf.createEntityManager();
After I make a few calls, I get several stack traces related to RMI I am fairly new to Toplink/Eclipselink and have not done much in the way of RMI.
Here are the exceptions:
[EPS Warning]: 2007.11.30 11:02:16.972--ServerSession(31985466)--Thread(Thread[Thread-8,5,main])--Local Exception Stack:
Exception [EclipseLink-22102] (Eclipse Persistence Services - 1.0M1 (Build 20071105)): org.eclipse.persistence.exceptions.RemoteCommandManagerException
Exception Description: Could not post connection in local naming service under name rmi://localhost:8881/13598682 Internal Exception: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at org.eclipse.persistence.exceptions.RemoteCommandManagerException.errorBindingConnection(RemoteCommandManagerException.java:84)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnectionInRegistry(RMITransportManager.java:157)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnection(RMITransportManager.java:110)
at org.eclipse.persistence.sessions.coordination.DiscoveryManager.run(DiscoveryManager.java:194)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:273)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnectionInRegistry(RMITransportManager.java:154)
... 3 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at java.io.DataInputStream.readByte(DataInputStream.java:241)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:215)
... 8 more
Exception in thread "Thread-8" Local Exception Stack:
Exception [EclipseLink-22102] (Eclipse Persistence Services - 1.0M1 (Build 20071105)): org.eclipse.persistence.exceptions.RemoteCommandManagerException
Exception Description: Could not post connection in local naming service under name rmi://localhost:8881/13598682 Internal Exception: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at org.eclipse.persistence.exceptions.RemoteCommandManagerException.errorBindingConnection(RemoteCommandManagerException.java:84)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnectionInRegistry(RMITransportManager.java:157)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnection(RMITransportManager.java:110)
at org.eclipse.persistence.sessions.coordination.DiscoveryManager.run(DiscoveryManager.java:194)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:273)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnectionInRegistry(RMITransportManager.java:154)
... 3 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at java.io.DataInputStream.readByte(DataInputStream.java:241)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:215)
... 8 more
[EPS Warning]: 2007.11.30 11:03:17.594--ServerSession(31985466)--Thread(Thread[Finalizer,8,system])--Local Exception Stack:
Exception [EclipseLink-22107] (Eclipse Persistence Services - 1.0M1 (Build 20071105)): org.eclipse.persistence.exceptions.RemoteCommandManagerException
Exception Description: Could not remove local connection in local naming service under name rmi://localhost:8881/13598682 Internal Exception: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at org.eclipse.persistence.exceptions.RemoteCommandManagerException.errorUnbindingLocalConnection(RemoteCommandManagerException.java:137)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.removeLocalConnection(RMITransportManager.java:234)
at org.eclipse.persistence.sessions.coordination.TransportManager.discardConnections(TransportManager.java:432)
at org.eclipse.persistence.sessions.coordination.RemoteCommandManager.shutdown(RemoteCommandManager.java:179)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.logout(DatabaseSessionImpl.java:718)
at org.eclipse.persistence.sessions.server.ServerSession.logout(ServerSession.java:625)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.removeSessionFromGlobalSessionManager(EntityManagerSetupImpl.java:138)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.undeploy(EntityManagerSetupImpl.java:1286)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:83)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.finalize(EntityManagerFactoryImpl.java:137)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:273)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
at sun.rmi.registry.RegistryImpl_Stub.unbind(Unknown Source)
at java.rmi.Naming.unbind(Naming.java:135)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.removeLocalConnection(RMITransportManager.java:226)
... 12 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at java.io.DataInputStream.readByte(DataInputStream.java:241)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:215)
... 17 moreI'm working on getting RMI based cache coordination functioning in my application using Eclipselink 1. I am using the 'INVALIDATE_CHANGED_OBJECTS' annotation and trying to get changed objects to propigate across 2 servers. I am using a function I got from the eclipselink list:
public void customize(Session session) throws Exception {
AbstractSession sessionImpl = (AbstractSession) session;
RemoteCommandManager cm = new RemoteCommandManager(sessionImpl);
cm.setShouldPropagateAsynchronously(true);
cm.getDiscoveryManager().setAnnouncementDelay(10);
cm.getTransportManager().setNamingServiceType(
TransportManager.REGISTRY_NAMING_SERVICE);
cm.setUrl("rmi://localhost:8881");
cm.setServerPlatform(sessionImpl.getServerPlatform());
sessionImpl.setCommandManager(cm);
sessionImpl.setShouldPropagateChanges(true);
cm.initialize();
try {
Thread.sleep(2000);
} catch (Exception ignore) {
and getting my factories as such:
emf = Persistence.createEntityManagerFactory(s);
new RMICacheCoordinationConfig().customize(JpaHelper.getServerSession(emf));
em = emf.createEntityManager();
After I make a few calls, I get several stack traces related to RMI I am fairly new to Toplink/Eclipselink and have not done much in the way of RMI.
Here are the exceptions:
[EPS Warning]: 2007.11.30 11:02:16.972--ServerSession(31985466)--Thread(Thread[Thread-8,5,main])--Local Exception Stack:
Exception [EclipseLink-22102] (Eclipse Persistence Services - 1.0M1 (Build 20071105)): org.eclipse.persistence.exceptions.RemoteCommandManagerException
Exception Description: Could not post connection in local naming service under name rmi://localhost:8881/13598682 Internal Exception: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at org.eclipse.persistence.exceptions.RemoteCommandManagerException.errorBindingConnection(RemoteCommandManagerException.java:84)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnectionInRegistry(RMITransportManager.java:157)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnection(RMITransportManager.java:110)
at org.eclipse.persistence.sessions.coordination.DiscoveryManager.run(DiscoveryManager.java:194)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:273)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnectionInRegistry(RMITransportManager.java:154)
... 3 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at java.io.DataInputStream.readByte(DataInputStream.java:241)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:215)
... 8 more
Exception in thread "Thread-8" Local Exception Stack:
Exception [EclipseLink-22102] (Eclipse Persistence Services - 1.0M1 (Build 20071105)): org.eclipse.persistence.exceptions.RemoteCommandManagerException
Exception Description: Could not post connection in local naming service under name rmi://localhost:8881/13598682 Internal Exception: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at org.eclipse.persistence.exceptions.RemoteCommandManagerException.errorBindingConnection(RemoteCommandManagerException.java:84)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnectionInRegistry(RMITransportManager.java:157)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnection(RMITransportManager.java:110)
at org.eclipse.persistence.sessions.coordination.DiscoveryManager.run(DiscoveryManager.java:194)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:273)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnectionInRegistry(RMITransportManager.java:154)
... 3 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at java.io.DataInputStream.readByte(DataInputStream.java:241)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:215)
... 8 more
[EPS Warning]: 2007.11.30 11:03:17.594--ServerSession(31985466)--Thread(Thread[Finalizer,8,system])--Local Exception Stack:
Exception [EclipseLink-22107] (Eclipse Persistence Services - 1.0M1 (Build 20071105)): org.eclipse.persistence.exceptions.RemoteCommandManagerException
Exception Description: Could not remove local connection in local naming service under name rmi://localhost:8881/13598682 Internal Exception: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at org.eclipse.persistence.exceptions.RemoteCommandManagerException.errorUnbindingLocalConnection(RemoteCommandManagerException.java:137)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.removeLocalConnection(RMITransportManager.java:234)
at org.eclipse.persistence.sessions.coordination.TransportManager.discardConnections(TransportManager.java:432)
at org.eclipse.persistence.sessions.coordination.RemoteCommandManager.shutdown(RemoteCommandManager.java:179)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.logout(DatabaseSessionImpl.java:718)
at org.eclipse.persistence.sessions.server.ServerSession.logout(ServerSession.java:625)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.removeSessionFromGlobalSessionManager(EntityManagerSetupImpl.java:138)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.undeploy(EntityManagerSetupImpl.java:1286)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:83)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.finalize(EntityManagerFactoryImpl.java:137)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:273)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
at sun.rmi.registry.RegistryImpl_Stub.unbind(Unknown Source)
at java.rmi.Naming.unbind(Naming.java:135)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.removeLocalConnection(RMITransportManager.java:226)
... 12 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at java.io.DataInputStream.readByte(DataInputStream.java:241)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:215)
... 17 more -
Java.rmi.RemoteException: Unexpected fault was returned by the server
Hi,
when we try to have some concurrent request, we've got the following error :
java.rmi.RemoteException: Unexpected fault was returned by the server (faultcode: Server.userException, faultstring: java.net.SocketTimeoutException: Read timed out). at com.plumtree.remote.prc.collaboration.project.ProjectWrapper.store()V(ProjectWrapper.java:263) at com.airbus.collaboration.pcs.api.AirbusProject.store()V(AirbusProject.java:102)
We don' have this problem for a unique request.
Can you help us ?
Thanks,
Stephane RODIEREEDK is not thread safe. We do not expect people to use it in a mult-threaded way. Also, the read timed out error that you are getting can happen for a lot of reasons outside of edk's control. Are you seeing the same read timed out error consistently in the same call?
-
JBoss + java.rmi.MarshalException: Socket timed out
Hello.
I'm not author of the software, I've just been transfered to try solve this problem:
I've got an client application, an server app, JBoss, and Oracle DB.
Now, when i try to create a big report in xls, which usually takes over 30minutes i get the exception:
pl.wasko.serloc.DelegateException: Utracono po��czenie z serwerem.
Spr�buj ponowi� operacj�
at pl.wasko.mra.template.delegate.DocumentDelegate.unknownException(DocumentDelegate.java:74)
at pl.wasko.mra.template.delegate.DocumentDelegate.exportToXls(DocumentDelegate.java:590)
at pl.wasko.mra.client.task.ExportTemplateToFileTask.<init>(ExportTemplateToFileTask.java:71)
at pl.wasko.mra.client.document.DocumentAdministration$11.construct(DocumentAdministration.java:447)
at pl.wasko.mra.client.task.SwingWorker$2.run(SwingWorker.java:146)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.rmi.MarshalException: Socket timed out. Waited 1800000 milliseconds for response while calling on InvokerLocator [socket://193.178.240.21:3873/]; nested exception is:
java.net.SocketTimeoutException: Read timed out
at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:302)
at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
at org.jboss.remoting.Client.invoke(Client.java:525)
at org.jboss.remoting.Client.invoke(Client.java:488)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:55)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:65)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
at $Proxy1.exportTemplateToXlsByteArray(Unknown Source)
at pl.wasko.mra.template.delegate.DocumentDelegate.exportToXls(DocumentDelegate.java:581)
... 4 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2200)
at java.io.ObjectInputStream$BlockDataInputStream.peek(ObjectInputStream.java:2490)
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2500)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1267)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
... 18 moreProblem is that I'm not the author of this program, program is old, and the author learned on it, so it's code is illegible (I mean dificult to debug, and even read).
I've only discovered that it uses Jasper to generate raport (I think so... I don't know), trace ended here:
JasperConversion conv = new JasperConversion();
JasperPrint jasperPrint = conv.createJasperPrint(template,params,searchCompileReport,userId, reportPagination);
String test = System.getProperty("pl.wasko.mra.template.test");
if(test != null && test.equals("1"))
String tempDir = System.getProperty("jasper.reports.compile.temp");
if(tempDir != null)
conv.exportToPdfFile(jasperPrint,tempDir+"/test.xls");
}I really don't ahve any ideas, I've tried to edit xml files on jboss - no result, properties files - the same, I was looking for something in the code to change timeout, but without results.
Please, if anyone had similar problem, or have an idea, how to fix this, I will be very gratefullif you are using jboss 4+ and ejb3, ib believe you want to edit the "ejb3.deployer/META-INF/jboss-service.xml" file. you want to change the "InvokerLocator" attribure on the "jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3" mbean. it should currently look like "socket://${jboss.bind.address}:3873". you want to add a "timeout" attribute like "socket://${jboss.bind.address}:3873/?timeout=yourTimeoutHere", where "yourTimeoutHere" is your desired timeout in milliseconds.
-
Unable to contact the RMI registry
Can anyone please help with this error?
exception: flex.messaging.MessageException: Unable to contact
the RMI registry on 'localhost' to look for the oldFusion Data
Management Service: java.rmi.onnectionIOException: error during
JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read time out.
This is a previously working flex app, but a fresh install of
ColdFusion 7 and I've enabled FDS in CF Admin.Can anyone please help with this error?
exception: flex.messaging.MessageException: Unable to contact
the RMI registry on 'localhost' to look for the oldFusion Data
Management Service: java.rmi.onnectionIOException: error during
JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read time out.
This is a previously working flex app, but a fresh install of
ColdFusion 7 and I've enabled FDS in CF Admin. -
hi,
i'm making a rmi call to a server on a ipv6 enabled machine.
when i use the host name, it works fine.
but when i use the ip address, it throws me a timeout exception
the url value is
*java.naming.provider.url=jnp://[fe80::216:72ff:fe3c:21gf]:19014*
javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1058)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1127)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:478)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at mytest.RMIClient.runBPDocWait(RMIClient.java:117)
at mytest.RMIClient.main(RMIClient.java:57)
Caused by: java.net.SocketTimeoutException: Receive timed out
at java.net.PlainDatagramSocketImpl.receive0(Native Method)
at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
at java.net.DatagramSocket.receive(DatagramSocket.java:712)
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1038)
... 6 more
but this works fine if i give
java.naming.provider.url=jnp://hostname:19014
is there any properties i need to set to make it work.is anyone facing such scenario with jboss?
-
RequestTimeoutException error while invoking a BPEL process using RMI
Hi,
I am getting RequestTimeoutException error while invoking a BPEL process using this code:
Locator locator = LocatorFactory.createLocator(jndiProps);
String compositeDN = "default/"+processName+"!1.0";
Composite composite = locator.lookupComposite(compositeDN);
String serviceName = "client";
Service deliveryService = composite.getService(serviceName);
NormalizedMessage nm = new NormalizedMessageImpl();
nm.getPayload().put("payload", requestXml);
NormalizedMessage res = deliveryService.request("process", nm);
responseMap = res.getPayload();
The error stack trace is
weblogic.rmi.extensions.RequestTimeoutException: RJVM response from 'weblogic.rjvm.RJVMImpl@604f2d14 - id: '-361032376059206
2776S:10.67.232.164:[8001,-1,-1,-1,-1,-1,-1]:emaar_domain:soa_server1' connect time: 'Mon Jan 18 11:34:41 GST 2010'' for 'executeServiceMethod
(Loracle.soa.management.CompositeDN;Ljava.lang.String;Ljava.lang.String;[Ljava.lang.Object;) 'timed out after: 60000ms.
oracle.fabric.common.FabricInvocationException: weblogic.rmi.extensions.RequestTimeoutException: RJVM response from 'weblogic.rjvm.RJVMImpl@60
4f2d14 - id: '-3610323760592062776S:10.67.232.164:[8001,-1,-1,-1,-1,-1,-1]:emaar_domain:soa_server1' connect time: 'Mon Jan 18 11:34:41 GST 20
10'' for 'executeServiceMethod(Loracle.soa.management.CompositeDN;Ljava.lang.String;Ljava.lang.String;[Ljava.lang.Object;) 'timed out after: 6
0000ms.
at oracle.soa.management.internal.facade.ServiceImpl.request(ServiceImpl.java:135)
at com.gss.common.bo.BpelUtil.invokeBPELProcess(BpelUtil.java:81)
To add to it the BPEL process is executing successfuly and RMI call timeout is happening.
Can I know how to increase the related timeout value?Have got the same problem. Scenario at my end is little different though.
I am trying to invoke a BPEL process from an ESB Service.
I am trying to look into it..
However, would be grateful, if someone can give some insight into this since many are running into this issue without being able to fix.
Ashish. -
Error: while generating SQL.java.rmi.ServerException:
Hi:
I tried the JGuru's "MusicStore" example. HOwever at Task 6 and 7 I am getting the following error:
Error: while generating SQL.java.rmi.ServerException:
RemoteException occured in server thread; nested exception is:
* java.rmi.RemoteException: Error connecting to database;
nested exception is:
* SQL Exception: Failed to start database 'MusicStoreDB', see
the next exception for details.
Please make sure the database name/user/password is valid
and the J2ee server and database are running.
However when i check my database it is running perfectly:
E:\>%j2ee_home%\bin\cloudscape -start
Sun Feb 16 12:48:11 PST 2003: [RmiJdbc] Starting Cloudscape RmiJdbc Server Version
Sun Feb 16 12:48:14 PST 2003: [RmiJdbc] COM.cloudscape.core.JDBCDriver registered i
Sun Feb 16 12:48:14 PST 2003: [RmiJdbc] Binding RmiJdbcServer...
Sun Feb 16 12:48:14 PST 2003: [RmiJdbc] No installation of RMI Security Manager...
Sun Feb 16 12:48:14 PST 2003: [RmiJdbc] RmiJdbcServer bound in rmi registry
Server:
J2EE server listen port: 1050
Naming service started:1050
Binding DataSource, name = jdbc/DB2, url = jdbc:cloudscape:rmi:CloudscapeDB;crea
te=true
Binding DataSource, name = jdbc/Cloudscape, url = jdbc:cloudscape:rmi:Cloudscape
DB;create=true
Binding DataSource, name = jdbc/InventoryDB, url = jdbc:cloudscape:rmi:Cloudscap
eDB;create=true
Binding DataSource, name = jdbc/DB1, url = jdbc:cloudscape:rmi:CloudscapeDB;crea
te=true
Binding DataSource, name = jdbc/MusicStore, url = jdbc:cloudscape:rmi:MusicStore
DB;create=false
Binding DataSource, name = jdbc/XACloudscape, url = jdbc/XACloudscape__xa
Binding DataSource, name = jdbc/XACloudscape__xa, dataSource = COM.cloudscape.co
re.RemoteXaDataSource@1d88db7
Starting JMS service...
Initialization complete - waiting for client requests
Binding: < JMS Destination : jms/Topic , javax.jms.Topic >
Binding: < JMS Destination : jms/Queue , javax.jms.Queue >
Binding: < JMS Cnx Factory : TopicConnectionFactory , Topic , No properties >
Binding: < JMS Cnx Factory : QueueConnectionFactory , Queue , No properties >
Binding: < JMS Cnx Factory : jms/QueueConnectionFactory , Queue , No properties
>
Binding: < JMS Cnx Factory : jms/TopicConnectionFactory , Topic , No properties
>
Starting web service at port: 8000
Starting secure web service at port: 7000
J2EE SDK/1.3.1
Starting web service at port: 9191
J2EE SDK/1.3.1
J2EE server startup complete.
Can anyone suggest me a way out..plzwhat type of persistent u r using also post ur query if bmp and check with another example with cmp.
-
Hi,
As you can guess, my Java program needs more and more memory as users connections grow.
We are of course trying to optimize the way its running but looks like we will anyway soon need to increase ressources of our JVM.
We first thought to increase memory heap but there is a limit, on any 32 bit system 4Go seems the theoretical maximum ram size. And we have to keep a 32 bit JVM, cant change this.
Here is our next idea: we would like to run our program on several JVMs.
Two options came then, and so here are my question: (maybe irrelevant for experts but I am a beginner regarding distributed architecture, so feel free to give me some reference to learn about it )
-First option: several 32 bit JVMs running together on one 64bits machine
Is it possible to run several 32 bit JVM (jre 1.5) on a windows (or linux) 64 bits machine? So that we could share the system (big) ram between each of them.
Is there, in this case, a limit for the memory heap per JVM?
What would be in this case the best way to communicate between jvms (I m thinking about RMI, but is it the only way to?)
-Second option: run several 32bits JVM on several 32 bits machine.
Questions are the same here:
is it possible? I guess so, and would it be worse or better from a performance/learning time point of view, compare to option 1?
Is RMI the best way here to make the several jvm communicate?
Hope this is clear, english is not my first language so feel free to ask me any precision
Thank you very much for any help or reference.
JipeMultiple JVMs dont have any inherent special behavior on the same maching. However, you must consider the shared resources of that machine such as ports and files that may be contended for.
The only advantage of multiple JVMs of single JVMs is an OS one. The JVMs are separate processes and as such if one crashes it will not bring the other down.
If you want to transfer user sessions from one JVM to another, no matter if on the same computer or not, you will need an architecture to support this. That is where application servers come in. Some of them will allow you to do this. So if you design your product to run in an application server, you have a lot of room to expand. That is really the benefit of designing for an application server.
The details of a shared session are likely very complicated. You will have to ask the application server folks about that. Maybe go over to the JBoss forums. -
What is the difference between RMI and JAX-RPC?
Dear All
First of all my understanding of RMI and JAX-RPC:
RMI is JAVA only version of RPC. It can't talk to any other language.
JAX-RPC is a part of JWSDP and if you implement your client and server with JAX-RPC, client written in any language can talk with JAX-RPC implementation.
What else makes them different and am I right with my understanding?
Finally, I would like to develop clients which will have a java class, say httpserver.java, which will act like a http server, listens to a http port. Now, Two such client will run in two different PC and I want to call a module from one client to another which should be accessible via my httpserver.java. For that which should be my choice RMI or JAX-RPC? Can I achive it with http get-post method, as I am expecting to read some value of variables from one client to the another.
Say class A has variable a, aa, aaa and clas B has variable b, bb, bbb. Now I want to read the value of b, bb, bbb from class A. How do I do that when class B is listening to a http port with my httpserver.java class.
Lastly, say B is listening to a http port and I want to send a file to B from A. How can I do that? Remember, B didn�t ask for that. How can A send a file to B when B is listening to a http port with my httpserver.java.
With regards
Mohammed Jubaer Arif
Mobile: +61-0411215302
Personal Web: http://www.geocities.com/jubairarifctg/
Org. Web.: http://www.geocities.com/halimschamber/simply put, RMI allows you to (semi) transparently treat remote objects as if they were local, and your distributed application can be written (more or less) like a "normal" java app. Sockets just give you a "raw" connection to work with, and you get to build up your application from that.
I hope that helped
Lee -
RMI : error on JRE 1.6 but not on JRE 1.5 ???
Hello,
I've got a problem with my application since i use JRE 1.6
My application run perfectly with JRE 1.5 !!!
My code is first :
LocateRegistry.createRegistry(port);
NamingManager.setInitialContextFactoryBuilder(new InitialServerContextFactory());
NamingManager.getInitialContext(environment);(with environment is an hastable containing HOST et PORT)
An next, i have a Java Class witch impl�ments Context :
public class InitialServerContext implements Context
public void bind(String name, Object obj) throws NamingException
getRMIContext().bind("rmi://" + mServer + ':' + mPort + '/' + name, obj);
static Context getRMIContext() throws NamingException
return NamingManager.getURLContext("rmi", null);
The error on JRE 1.6 is on the line :
getRMIContext().bind("rmi://" + mServer + ':' + mPort + '/' + name, obj);
_Exception is
:_java.lang.NullPointerException
at com.sun.jndi.rmi.registry.RegistryContext.<init>(Unknown Source)
at com.sun.jndi.url.rmi.rmiURLContext.getRootURLContext(Unknown Source)
at com.sun.jndi.toolkit.url.GenericURLContext.bind(Unknown Source)
at com.xxx.aes.naming.InitialServerContext.bind(InitialServerContext.java:231)
at com.xxx.aes.naming.InitialServerContextFactory.getInitialContext(InitialServerContextFactory.java:104)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at com.xxx.aes.server.NamingServer.start(NamingServer.java:65)
What is the difference between JRE 1.5 and 1.6 ?
Why my application in 1.6 is not correct ?
If necessary, i can give you my Java Class InitialServerContextFactory.java
Thanks a lot for your responses.Hello,
I tired this approach you mentioned, and interestingly if i just make ejb calls without any event handling, meaning if i call them separately they all just work fine and i see the results coming back from server. But when i relate them to any click events the whole IE freezes.
One more thing i noted is that, seems like the way JRE 1.6 render my applet is somewhat different than JRE 1.5.* familiy,because initially when my aplet is loaded, i see everything which should be displayed from the first screen, but any further operations i cannot perform, even opening a file chooser from tool bar. I admit my applet is real heavy and it contains a lot of data in it on the first screen, may be its the heap size causing the problem in 1.6 but fine with jre 1.5.
Day by day am coming to conlusion that jre 1.6 is my concern now ..:(
Thanks,
Maybe you are looking for
-
Hi, I have created a pdf from a word-file and inserted formfields for a work related file. I've used nitro pro to create the formfield. They works in nitro, reader, foxit etc. but not adobe reader. From page 3 and out, the font wont show when writing
-
How to find apostrophes in a VARCHAR2 column
I have a value "GOT UP LATE - DIDN'T HAVE TIME" stored in varchar2 field of my table through Oracle forms. I want to check whether the values stored in this column have apostrophes or not (e.g. as in DIDN'T). Could any body please let me know how to
-
Updating Data in Siebel From Portal
Hi, Can you please let me know how i can get the data from Siebel to Portal, Make modifications to the data and update back to Siebel. Probably client is stressing to use WebDynpro GUI. In case you have a code sample or any means of Weblog or any ki
-
Can the monitor be fixed on an iMac if it goes black (2006 17-inch, intel core duo)?
-
Deployment of Web service that is in a package?
Hello all, i want to deploy a java web service that is in a package (package ws;) by using the deploy.wsdd method. The package contains two more classes that the class i want to deploy as a web service, uses them. Any help, or any known tutorial on w