cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED]RMI Excpetion not solved

sisao
Champ in-the-making
Champ in-the-making
Hi,
i've gone through a lot of posts about this issue…and i also tought i had solved it by replacing "localhost" with "127.0.0.1" in the alfresco-shared property file, but it worked for a while then it persists…i can start alfresco but if i turn it off i have to reboot in order to start it up again.

12:45:18,545 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.rmi.RmiServiceExporter' defined in class path resource [alfresco/emailserver/email-service-context.xml]: Invocation of init method failed; nested exception is java.rmi.server.ExportException: Port already in use: 50500; nested exception is:
   java.net.BindException: Address already in use
Caused by: java.rmi.server.ExportException: Port already in use: 50500; nested exception is:
   java.net.BindException: Address already in use
   at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:249)
   at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:184)
   at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
   at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
   at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:180)
   at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:92)
   at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:78)
   at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:186)
   at org.springframework.remoting.rmi.RmiServiceExporter.getRegistry(RmiServiceExporter.java:398)
   at org.springframework.remoting.rmi.RmiServiceExporter.getRegistry(RmiServiceExporter.java:370)
   at org.springframework.remoting.rmi.RmiServiceExporter.getRegistry(RmiServiceExporter.java:331)
   at org.springframework.remoting.rmi.RmiServiceExporter.prepare(RmiServiceExporter.java:263)
   at org.springframework.remoting.rmi.RmiServiceExporter.afterPropertiesSet(RmiServiceExporter.java:227)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:516)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
   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:585)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.net.BindException: Address already in use
   at java.net.PlainSocketImpl.socketBind(Native Method)
   at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
   at java.net.ServerSocket.bind(ServerSocket.java:319)
   at java.net.ServerSocket.<init>(ServerSocket.java:185)
   at java.net.ServerSocket.<init>(ServerSocket.java:97)
   at sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(RMIDirectSocketFactory.java:27)
   at sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(RMIMasterSocketFactory.java:333)
   at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:622)
   at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:237)
   … 48 more

Post startup "netstat -na | grep 50500" :

tcp4       0      0  *.50500                *.*                    LISTEN

Post shut down:

tcp4       0      0  10.0.1.193.50500       10.0.1.193.49306       ESTABLISHED
tcp4       0      0  10.0.1.193.49306       10.0.1.193.50500       ESTABLISHED
tcp4       0      0  10.0.1.193.50500       10.0.1.193.49305       ESTABLISHED
tcp4       0      0  10.0.1.193.49305       10.0.1.193.50500       ESTABLISHED
tcp4       0      0  *.50500                *.*               


Any help appreciated…i've already done all the steps suggested in this forum  Smiley Sad

EDIT:
Problem solved by manually adding an openoffice shutdown procedure as it does not properly shut down with the latest Alfresco 3 labs (MacOs).
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
You have a some sort of issue with shutdown.    Which is why Alfresco restarts after a reboot.

Which version of Alfresco are you using?
What errors are in your log file?

sisao
Champ in-the-making
Champ in-the-making
i am using the latest labs release and the snapshot i provided above is from the alfresco.log (startup session)…it's actually boring as everytime i have to restart the server for a change to be applied i have to reboot my machine.

catalina.log interesting rows:

9-feb-2009 15.29.37 org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
9-feb-2009 15.30.00 org.apache.catalina.core.StandardContext start
GRAVE: Error listenerStart

other log files are actually empty…i've specified both loopback and dhcp assigned ip into /etc/hosts, i've removed duplicated jars from /WEB-INF/lib and i've forced repository.properties to randomly assign a port number to the RMI services (using "0").

Dont really have a clue but i can see this is common with the RMI jar.

mrogers
Star Contributor
Star Contributor
The exception you posted is a symptom of an earlier problem not the problem itself, fiddling with the network settings will have no effect.

What platform are you on?
How are you shutting down alfresco?
Is there nothing in your alfresco log file related to shutdown?   Perhaps shutdown errors?

sisao
Champ in-the-making
Champ in-the-making
I'm using a OsX machine (latest Leopard and JVM 1.5.0).
I shut down alfresco by providing "alfresco.sh stop" …. i have not altered the alfresco.sh script.

This is the catalina output while shutting alfresco down:

9-feb-2009 16.56.34 org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8089
9-feb-2009 16.56.35 org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
9-feb-2009 16.56.35 org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated
9-feb-2009 16.56.36 org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated
9-feb-2009 16.56.37 org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated
9-feb-2009 16.56.41 org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8089
9-feb-2009 16.56.47 org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already.  Could not load org.apache.log4j.spi.NOPLoggerRepository.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
   at org.apache.log4j.LogManager.getLoggerRepository(LogManager.java:175)
   at org.apache.log4j.LogManager.getLogger(LogManager.java:199)
   at org.apache.log4j.Logger.getLogger(Logger.java:105)
   at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:283)
   at org.apache.commons.logging.impl.Log4JLogger.error(Log4JLogger.java:239)
   at org.alfresco.repo.shutdown.ShutdownBackstop$ShutdownBackstopThread.run(ShutdownBackstop.java:131)

Dunno if that exception is somehow related to that problem…may this somehow related on the fact i have a proper tomcat installation on port 8080 (not active though).