cancel
Showing results for 
Search instead for 
Did you mean: 

Error creating bean with name 'avmRemoteService'

bleyton
Champ in-the-making
Champ in-the-making
In searching the forum, it seems like this problem has come up many times before, but none of the solutions works for me.  I had Alfresco working properly, then when I made changes to my content model, something broke and I started getting this error.  After trying all of the troubleshooting steps, I gave up.  I wiped out my opt/alfresco folder and started from scratch.  It still gave me this error, until I went back and put

127.0.0.1 alfresco

into the hosts file (alfresco is the server name).  Once I got it working, I installed the beCPG designer addon.  I started building a new model, wasn't able to get it to publish the module, so I tried a re-boot.  After rebooting, the "Error creating bean with name 'avmRemoteService'" error came back again, and I can't figure out how to fix it.

It seems to me that Alfresco is very sensitive to configuration issues, and if you have a problem, the server won't start up properly.  That makes it really difficult to debug.

Anyhow, here is my alfresco.log file.  Any assistance would be greatly appreciated.

09:27:11,184 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] Starting 'sysAdmin' subsystem, ID: [sysAdmin, default]
09:27:11,532 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] Startup of 'sysAdmin' subsystem, ID: [sysAdmin, default] complete
09:27:50,217 WARN  [org.alfresco.util.AbstractTriggerBean] Job ehCacheTracerJob is not active/enabled
09:27:52,314 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] Stopping 'sysAdmin' subsystem, ID: [sysAdmin, default]
09:27:52,319 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] Stopped 'sysAdmin' subsystem, ID: [sysAdmin, default]
09:27:52,437 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'avmRemoteService' defined in class path resource [alfresco/remote-services-context.xml]: Invocation of init method failed; nested exception is java.rmi.server.ExportException: Port already in use: 50501; nested exception is:
   java.net.BindException: Address already in use
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
   at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
   at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
   at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
   at org.apache.catalina.core.StandardService.start(StandardService.java:525)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.rmi.server.ExportException: Port already in use: 50501; nested exception is:
   java.net.BindException: Address already in use
   at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:328)
   at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:236)
   at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411)
   at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147)
   at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:207)
   at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:310)
   at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:273)
   at org.springframework.remoting.rmi.RmiServiceExporter.prepare(RmiServiceExporter.java:281)
   at org.springframework.remoting.rmi.RmiServiceExporter.afterPropertiesSet(RmiServiceExporter.java:229)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
   … 37 more
Caused by: java.net.BindException: Address already in use
   at java.net.PlainSocketImpl.socketBind(Native Method)
   at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:353)
   at java.net.ServerSocket.bind(ServerSocket.java:336)
   at java.net.ServerSocket.<init>(ServerSocket.java:202)
   at org.alfresco.util.remote.server.socket.HostConfigurableSocketFactory.createServerSocket(HostConfigurableSocketFactory.java:111)
   at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:667)
   at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:317)
   … 47 more
09:28:35,192 INFO  [org.springframework.extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
09:28:35,509 INFO  [org.springframework.extensions.webscripts.ScriptProcessorRegistry] Registered script processor javascript for extension js
09:28:35,519 INFO  [org.springframework.extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
09:28:35,535 INFO  [org.springframework.extensions.webscripts.ScriptProcessorRegistry] Registered script processor javascript for extension js
09:28:42,581 INFO  [org.springframework.extensions.webscripts.DeclarativeRegistry] Registered 319 Web Scripts (+0 failed), 329 URLs
09:28:42,581 INFO  [org.springframework.extensions.webscripts.DeclarativeRegistry] Registered 8 Package Description Documents (+0 failed)
09:28:42,582 INFO  [org.springframework.extensions.webscripts.DeclarativeRegistry] Registered 0 Schema Description Documents (+0 failed)
09:28:44,092 INFO  [org.springframework.extensions.webscripts.AbstractRuntimeContainer] Initialised Spring Surf Container Web Script Container (in 8538.089ms)
09:28:44,124 INFO  [org.springframework.extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
09:28:44,148 INFO  [org.springframework.extensions.webscripts.ScriptProcessorRegistry] Registered script processor javascript for extension js
09:29:47,186 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] Starting 'sysAdmin' subsystem, ID: [sysAdmin, default]
09:29:47,355 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] Startup of 'sysAdmin' subsystem, ID: [sysAdmin, default] complete
09:30:11,275 WARN  [org.alfresco.util.AbstractTriggerBean] Job ehCacheTracerJob is not active/enabled
09:30:13,228 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] Stopping 'sysAdmin' subsystem, ID: [sysAdmin, default]
09:30:13,234 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] Stopped 'sysAdmin' subsystem, ID: [sysAdmin, default]
09:30:13,261 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'avmRemoteService' defined in class path resource [alfresco/remote-services-context.xml]: Invocation of init method failed; nested exception is java.rmi.server.ExportException: Port already in use: 50501; nested exception is:
   java.net.BindException: Address already in use
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
   at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
   at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
   at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
   at org.apache.catalina.core.StandardService.start(StandardService.java:525)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.rmi.server.ExportException: Port already in use: 50501; nested exception is:
   java.net.BindException: Address already in use
   at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:328)
   at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:236)
   at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411)
   at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147)
   at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:207)
   at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:310)
   at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:273)
   at org.springframework.remoting.rmi.RmiServiceExporter.prepare(RmiServiceExporter.java:281)
   at org.springframework.remoting.rmi.RmiServiceExporter.afterPropertiesSet(RmiServiceExporter.java:229)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
   … 37 more
Caused by: java.net.BindException: Address already in use
   at java.net.PlainSocketImpl.socketBind(Native Method)
   at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:353)
   at java.net.ServerSocket.bind(ServerSocket.java:336)
   at java.net.ServerSocket.<init>(ServerSocket.java:202)
   at org.alfresco.util.remote.server.socket.HostConfigurableSocketFactory.createServerSocket(HostConfigurableSocketFactory.java:111)
   at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:667)
   at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:317)
   … 47 more
09:30:42,925 INFO  [org.springframework.extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
09:30:44,558 INFO  [org.springframework.extensions.webscripts.ScriptProcessorRegistry] Registered script processor javascript for extension js
09:30:44,563 INFO  [org.springframework.extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
09:30:44,576 INFO  [org.springframework.extensions.webscripts.ScriptProcessorRegistry] Registered script processor javascript for extension js
09:30:48,866 INFO  [org.springframework.extensions.webscripts.DeclarativeRegistry] Registered 319 Web Scripts (+0 failed), 329 URLs
09:30:48,867 INFO  [org.springframework.extensions.webscripts.DeclarativeRegistry] Registered 8 Package Description Documents (+0 failed)
09:30:48,867 INFO  [org.springframework.extensions.webscripts.DeclarativeRegistry] Registered 0 Schema Description Documents (+0 failed)
09:30:50,326 INFO  [org.springframework.extensions.webscripts.AbstractRuntimeContainer] Initialised Spring Surf Container Web Script Container (in 5731.109ms)
09:30:50,359 INFO  [org.springframework.extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
09:30:50,387 INFO  [org.springframework.extensions.webscripts.ScriptProcessorRegistry] Registered script processor javascript for extension js
5 REPLIES 5

mitpatoliya
Star Collaborator
Star Collaborator
Its just JVM bind exception.
I think you are immediately starting the server after shutting down.
Try with some time interval in between.
Also once you shut down the alfresco check jvm is also down then only restart the alfresco.

bleyton
Champ in-the-making
Champ in-the-making
I don't think that's the problem.  The same thing happens after a complete reboot.  I've tried changing the port #'s that are used, and that didn't work either, even when I set the port to 0 to have the server randomly select a port #.

I am just using "alfresco.sh start" to start everything up (and "alfresco.sh stop" to shut down).  Should I be doing something different?

What is strange is that I had Alfresco working, but then a change to a custom model, and subsequent re-start caused this problem to come back.  Why would changing a custom model affect this?

By the way, an lsof -i :50501 shows that there is nothing else running on that port. 

I am at a complete loss as to how to troubleshoot this.

mrogers
Star Contributor
Star Contributor
What have you been doing to the "hosts" file?

bleyton
Champ in-the-making
Champ in-the-making
What have you been doing to the "hosts" file?

It started out with 2 entries:

127.0.0.1       localhost
127.0.0.1       alfresco

(alfresco is the hostname of this server)

When the problems started, I changed the alfresco IP address to the actual (internal) IP address of 192.168.1.81.  I can't remember whether it ever worked with that configuration, but I have had this same problem at least 3 times.  At some point I later changed it back to the loopback IP address, and got alfresco working again.  I'm pretty sure that  changing this back to 127.0.0.1 was what I did to get it working.  Based on what I have read in the several threads on this topic, it should have worked with the "real" IP address, but it did not in my case.

After getting alfresco back up again, I installed beCPG Designer, tried to set up a custom model, had trouble getting it to save, and after a re-boot, wound up with this error again.

ranjitsinh_reva
Champ in-the-making
Champ in-the-making
This error occurs due to port conflicting in your system with other software's.
For me due to conflicting of cyberoam port which we are using.
I have started alfresco tomcat server before connecting to cyberoam and it's working fine for me.

For example, Sometime we are not able to start MYSQL server due to port conflict of Skype so for that we have to explicitly stop Skype service at start up and then we need to start MYSQL server.