Announcement Announcement Module
No announcement yet.
Accessing remote SLSB Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Accessing remote SLSB


    In my current project, When I was try to access a SLSB deployed on a OC4J application server from another OC4J container, I get the RMIConnectionException: Server Shutdown. I have tried access the same SLSB using tradiational way, it works fine. The following are the details:


    <bean id="asdJndiTemplate"
    <property name="environment">
    <prop key="java.naming.factory.initial">com.evermind.ser ver.rmi.RMIInitialContextFactory</prop>
    <prop key="java.naming.provider.url">ormi://panther:23791/DPDQ</prop>
    <prop key="">admin</prop>
    <prop key="">password</prop>
    <prop key="dedicated.connection">true</prop>
    <bean id="asdRMISocInfoService"
    class="org.springframework.ejb.access.SimpleRemote StatelessSessionProxyFactoryBean">
    <property name="jndiName">
    <property name="jndiTemplate">
    <ref local="asdJndiTemplate" />
    <property name="homeInterface">
    <value> ommandHubHome</value>
    <property name="businessInterface">
    <value>net.quarksys.service.interfaces.CommandHand ler</value>

    Error log

    2005-06-04 11:28:22,083 [HttpRequestHandler-11178268] DEBUG org.springframework.jndi.JndiTemplate - - Looking up JNDI object with name [EjbCommandHub]
    2005-06-04 11:28:22,089 [HttpRequestHandler-11178268] DEBUG org.springframework.ejb.access.SimpleRemoteStatele ssSessionProxyFactoryBean - - Located object with JNDI name [EjbCommandHub]
    2005-06-04 11:28:22,090 [HttpRequestHandler-11178268] DEBUG org.springframework.core.CollectionFactory - - Creating java.util.IdentityHashMap
    2005-06-04 11:28:22,090 [HttpRequestHandler-11178268] DEBUG org.springframework.aop.framework.ProxyFactory - - Added new aspect interface: IF
    2005-06-04 11:28:22,090 [HttpRequestHandler-11178268] DEBUG org.springframework.aop.framework.JdkDynamicAopPro xy - - Creating JDK dynamic proxy
    2005-06-04 11:28:22,090 [HttpRequestHandler-11178268] DEBUG istableBeanFactory - - Invoking BeanPostProcessors after initialization of bean 'asdRMISocInfoService'
    2005-06-04 11:28:22,090 [HttpRequestHandler-11178268] DEBUG istableBeanFactory - - Calling code asked for FactoryBean instance for name 'asdRMISocInfoService'
    2005-06-04 11:28:22,090 [HttpRequestHandler-11178268] DEBUG istableBeanFactory - - Returning cached instance of singleton bean 'asdRMISocInfoService'
    2005-06-04 11:28:22,091 [HttpRequestHandler-11178268] DEBUG istableBeanFactory - - Bean with name 'asdRMISocInfoService' is a factory bean
    2005-06-04 11:28:22,093 [HttpRequestHandler-11178268] DEBUG org.springframework.ejb.access.SimpleRemoteStatele ssSessionProxyFactoryBean - - Trying to create reference to remote EJB
    2005-06-04 11:28:52,095 [HttpRequestHandler-11178268] DEBUG org.springframework.remoting.rmi.RmiClientIntercep torUtils - - Remote service [EjbCommandHub] threw exception
    com.evermind.server.rmi.RMIConnectionException: Server shutdown
    at voke(
    at com.evermind.server.rmi.RecoverableRemoteInvocatio nHandler.invoke(RecoverableRemoteInvocationHandler .java:22)
    at __Proxy0.create(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De
    at java.lang.reflect.Method.invoke(
    at org.springframework.ejb.access.AbstractSlsbInvoker Interceptor.create(AbstractSlsbInvokerInterceptor. java:174)
    at org.springframework.ejb.access.AbstractRemoteSlsbI nvokerInterceptor.newSessionBeanInstance(AbstractR
    at org.springframework.ejb.access.SimpleRemoteSlsbInv okerInterceptor.getSessionBeanInstance(SimpleRemot
    at org.springframework.ejb.access.SimpleRemoteSlsbInv okerInterceptor.doInvoke(SimpleRemoteSlsbInvokerIn
    at org.springframework.ejb.access.AbstractRemoteSlsbI nvokerInterceptor.invoke(AbstractRemoteSlsbInvoker
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed( :144)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(

    Any idea, Thanks in advance!


  • #2
    I found the cause

    After digging into this problem for a while, I found the cause this problem, here is the detail:
    In the JndiTemplate classe, when the lookup method is called, the Initial Context is created, run the lookup and then close the context. I guess because the connection is closed, when later on the proxy trying to create the bean using this hoem object, it could not connect to the remote JVM and the "Server Shutdown" exception is thrown.
    Now my question is, is this a bug of OC4J or Spring, and what's the best work around for this...



    • #3
      Seems weird to me. Maybe it helps if you disable the caching of the home interface in your SimpleRemoteStatelessSessionProxyFactoryBean?



      • #4
        Actually I did try to disable the home interface caching, but I got the same result. Now I'm more leaning to that this is a bug/issue of thr RMI implementation from OC4J. I will try to do the same using WebSphere and WebLogic over this weekend to see if there is anything differences

        Thanks for the suggestion Andreas!


        • #5
          I got exactly the same error while trying to access remote SLSB at OC4J apps server.
          May I know how could I disable the caching of the home interface?
          So quarksys did you found any workaround to resolve this issue?

          Thanks in advance for any help.


          • #6
            I modified the source code in Spring for now.
            File: org.springframework.jndi.JndiTemplate, inside method execute:

            change the line of

            You can make this behavior configurable by adding a flag. But still, I would consider this a temp solution. I'm not sure not closing the Intial Context could cause any problem.

            Hope helps


            • #7
              I'd like to propose another workaround solution which does not require Spring code being modified.

              Just subclass JndiTemplate and overwrite the "createInitialContext" method.
              The overwritten method should obtain the Context from the original implementation and wrap it into an own "Context" subclass instance which just delegates all methods and just ignores invocations of "close".

              So, when the bug might be fixed, you can just change your configuration (and don't have to patch each Spring version to come before).