欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

rmi spring resin启动出错

程序员文章站 2024-02-21 17:17:52
...
[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)



[color=red]spring不需要配置:[/color]

        <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
相关标签: java spring