Announcement Announcement Module
Collapse
No announcement yet.
RmiServiceExporter On WebLogic Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RmiServiceExporter On WebLogic

    Hello

    I am trying to expose a Spring bean as a service via RMI using RmiServiceExporter. The bean is part of a Spring MVC app that will be deployed as a war on a Weblogic 9.x server. I am getting a connection refused exception (stack trace below).

    Here's the exporter config:
    Code:
    <!-- RMI For Remote Access (Mule) -->
    	<bean id="rmiEmployeeService" singleton="true" class="org.springframework.remoting.rmi.RmiServiceExporter">
    		<property name="serviceName" value="EmployeeService"/>
    		<property name="service" ref="employeeManager"/>
    		<property name="serviceInterface" value="com.long.package.name.EmployeeManagerInterface"/>
    		<property name="registryHost" value="localhost"/>
    		<property name="registryPort" value="50770"/>
    	</bean>
    I'm guessing I need to do something in the Weblogic server to get this to work but I'm not sure what. Any help would be appreciated.

    Thanks
    Tom

    Code:
    2007-05-18 15:30:49,611 ERROR [org.springframework.web.servlet.DispatcherServlet] - <Context initialization failed>
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rmiEmployeeService' defined in ServletContext resource [/WEB-INF/crm-servlet.xml]: Invocation of init method failed; nested exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
            java.net.ConnectException: Connection refused
    Caused by:
    java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
            java.net.ConnectException: Connection refused
            at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
            at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
            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.list(Unknown Source)
            at org.springframework.remoting.rmi.RmiServiceExporter.testRegistry(RmiServiceExporter.java:362)
            at org.springframework.remoting.rmi.RmiServiceExporter.getRegistry(RmiServiceExporter.java:285)
            at org.springframework.remoting.rmi.RmiServiceExporter.prepare(RmiServiceExporter.java:233)
            at org.springframework.remoting.rmi.RmiServiceExporter.afterPropertiesSet(RmiServiceExporter.java:197)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1118)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1085)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:429)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)
            at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
            at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:308)
            at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:252)
            at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:221)
            at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:115)
            at javax.servlet.GenericServlet.init(GenericServlet.java:256)
            at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:274)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
            at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
            at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
            at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
            at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:504)
            at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1716)
            at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1693)
            at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1613)
            at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2764)
            at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:889)
            at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:333)
            at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
            at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
            at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
            at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
            at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
            at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
            at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
            at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
            at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
            at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
            at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
            at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
            at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
            at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
            at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:566)
            at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:136)
            at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:104)
            at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:320)
            at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:815)
            at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1222)
            at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:433)
            at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:161)
            at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
            at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
            at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
            at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

  • #2
    Well I made some progress. I swithed to the JndiRmiServiceExporter and I can see the beans JNDI name in the server's JNDI tree. So I guess I'm in RMI but, by using JndiRmiServiceExporter, I let weblogic put me there instead of trying to do it myself.

    Comment


    • #3
      Okay

      I'm still stuck here. What I am trying to do is access a POJO from a MUle instance. I want Mule to be able to do a JNDI lookup and call a method on the POJO. I'm getting:
      Code:
      2007-05-21 18:54:57,717 ERROR [org.mule.impl.DefaultComponentExceptionStrategy] - Caught exception in Exception Strategy for: CreateEmployeeService60772: org.mule.umo.ComponentException: Failed to invoke org.springframework.remoting.rmi.RmiInvocationWrapper_921_WLStub. Component that caused exception is: CreateEmployeeService60772. Message payload is of type: com.chariotsolutions.soalab.crm.business.Employee
      org.mule.umo.ComponentException: Failed to invoke org.springframework.remoting.rmi.RmiInvocationWrapper_921_WLStub. Component that caused exception is: CreateEmployeeService60772. Message payload is of type: com.chariotsolutions.soalab.crm.business.Employee
      	at org.mule.impl.DefaultLifecycleAdapter.intercept(DefaultLifecycleAdapter.java:223)
      	at org.mule.impl.InterceptorsInvoker.execute(InterceptorsInvoker.java:47)
      etc.....
      I realize a most of what is in the error referes to Mule. I've posted there too but I thought I'd try here casue I'm desperate.

      Do I need to run weblogic.rmic on my beans to make this work? I have debug turned on but is are there any other troubleshooting tips?

      Thanks
      Tom

      Comment


      • #4
        Did you make it work could you pls let me know the trick

        Comment

        Working...
        X