当前位置: 代码迷 >> Web前端 >> rmi spring resin起步出错
  详细解决方案

rmi spring resin起步出错

热度:632   发布时间:2013-09-11 17:27:30.0
rmi spring resin启动出错
[00:30:36,734] [ContextLoader,215] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxxxServiceExporter' defined in ServletContext resource [/WEB-INF/applicationContext-rmiserver.xml]: Invocation of init method failed; nested exception is java.rmi.ConnectException: Connection refused to host:xxxx.xxx.xxx.xx; nested exception is:
        java.net.ConnectException: Connection refused
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1336)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
        at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81)
        at javax.servlet.GenericServlet.init(GenericServlet.java:70)
        at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:833)
        at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:735)
        at com.caucho.server.dispatch.ServletManager.init(ServletManager.java:159)
        at com.caucho.server.webapp.WebApp.start(WebApp.java:1874)
        at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:667)
        at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
        at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:549)
        at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:160)
        at com.caucho.server.webapp.WebAppContainer.start(WebAppContainer.java:659)
        at com.caucho.server.host.Host.start(Host.java:450)
        at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:667)
        at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
        at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:549)



spring不需要配置:

        <property name="registryHost"  value="xxx.xxx.xxx.xxx"/>


只需要在resin的resin.conf的jvm参数中添加如下

 <jvm-arg>-Djava.rmi.server.hostname=xxx.xxx.xxx.xxx</jvm-arg>



主要原因是因为服务器有多网卡多IP所引起的,所以我们要指定服务器启动rmi服务的IP


我的异常网推荐解决方案:org.springframework.beans.factory.BeanCreationException:,http://www.myexception.cn/j2ee/10759.html
  相关解决方案