Announcement Announcement Module
Collapse
No announcement yet.
no security manager: RMI class loader disabled Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • no security manager: RMI class loader disabled

    I am referring the following URL for implementing RMI using Spring

    http://static.springsource.org/sprin.../remoting.html

    The Server side Spring configuration :
    <bean class="org.springframework.remoting.rmi.RmiService Exporter">
    <property name="serviceName" value="CreatePortCallRMIService" />
    <property name="service" ref="createPortCallRMIService" />
    <property name="serviceInterface" value="com.wisdom.poseidon.business.CreatePortCall RMIService" />
    <property name="registryPort" value="1199" />
    </bean>
    <!-- On the Server side, the transaction setting for the Service class are as follows: -->
    <bean id="txManager" class="org.springframework.transaction.jta.WebLogi cJtaTransactionManager"/>
    <aop:config>
    <aopointcut id="PCUT-AllBI" expression="execution(* com.wisdom.poseidon.business.*.*(..))" />
    <aop:advisor advice-ref="ADV-AllBI" pointcut-ref="PCUT-AllBI"/>
    </aop:config>
    <tx:advice id="ADV-AllBI" transaction-manager="txManager">
    <tx:attributes>
    <tx:method name="*" propagation="REQUIRED" rollback-for="java.lang.Exception"/>
    </tx:attributes>
    </tx:advice>
    On the Server, there is a Weblogic 10.3 Application Server running with an RMI Service

    package com.wisdom.poseidon.business;
    import com.marcura.dadesk.dis.domain.CreatePortCallType;
    public interface CreatePortCallRMIService {
    public String createPortCall(CreatePortCallType createPortCallType) ;
    // explicitly I am not throwing any exception back from the service method
    // even in the implementation, all the exceptions are caught and never thrown to calling client code
    }


    The Client side Spring configuration :
    <bean id="createPortCallRMIService" class="org.springframework.remoting.rmi.RmiProxyFa ctoryBean" lazy-init="true">
    <property name="serviceUrl"
    value="rmi://192.168.0.210:1199/CreatePortCallRMIService" />
    <property name="serviceInterface"
    value="com.wisdom.poseidon.business.CreatePortCall RMIService" />
    </bean>
    On the Client side, there is Apache Tomcat 6.0 application server running

    I am getting the following exception, while trying to invoke the RMI Service :

    Running com.marcura.dadesk.dis.service.impl.CreatePortCall ServiceCase
    com.marcura.dadesk.dis.services.exception.DisServi ceException: Error Creating Port Call : Could not access remote service [rmi://192.168.0.210:1199/CreatePortCallRMIService]; nested exception is java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
    java.lang.ClassNotFoundException: weblogic.transaction.RollbackException (no security manager: RMI class loader disabled)
    at com.marcura.dadesk.dis.services.impl.CreatePortCal lServiceImpl.createPortCall(CreatePortCallServiceI mpl.java:61)
    at com.marcura.dadesk.dis.service.impl.CreatePortCall ServiceTestCase.createPortCall(CreatePortCallServi ceTestCase.java:66)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.test.context.junit4.SpringTest Method.invoke(SpringTestMethod.java:160)
    at org.springframework.test.context.junit4.SpringMeth odRoadie.runTestMethod(SpringMethodRoadie.java:233 )
    at org.springframework.test.context.junit4.SpringMeth odRoadie$RunBeforesThenTestThenAfters.run(SpringMe thodRoadie.java:333)
    at org.springframework.test.context.junit4.SpringMeth odRoadie.runWithRepetitions(SpringMethodRoadie.jav a:217)
    at org.springframework.test.context.junit4.SpringMeth odRoadie.runTest(SpringMethodRoadie.java:197)
    at org.springframework.test.context.junit4.SpringMeth odRoadie.run(SpringMethodRoadie.java:143)
    at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.invokeTestMethod(SpringJUnit4ClassRu nner.java:160)
    at org.junit.internal.runners.JUnit4ClassRunner.runMe thods(JUnit4ClassRunner.java:51)
    at org.junit.internal.runners.JUnit4ClassRunner$1.run (JUnit4ClassRunner.java:44)
    at org.junit.internal.runners.ClassRoadie.runUnprotec ted(ClassRoadie.java:27)
    at org.junit.internal.runners.ClassRoadie.runProtecte d(ClassRoadie.java:37)
    at org.junit.internal.runners.JUnit4ClassRunner.run(J Unit4ClassRunner.java:42)
    at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.run(SpringJUnit4ClassRunner.java:97)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.exe cute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryT estSuite.executeTestSet(AbstractDirectoryTestSuite .java:138)
    at org.apache.maven.surefire.suite.AbstractDirectoryT estSuite.execute(AbstractDirectoryTestSuite.java:1 25)
    at org.apache.maven.surefire.Surefire.run(Surefire.ja va:132)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.ru nSuitesInProcess(SurefireBooter.java:290)
    at org.apache.maven.surefire.booter.SurefireBooter.ma in(SurefireBooter.java:818)
    Caused by: org.springframework.remoting.RemoteAccessException : Could not access remote service [rmi://192.168.0.210:1199/CreatePortCallRMIService]; nested exception is java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
    java.lang.ClassNotFoundException: weblogic.transaction.RollbackException (no security manager: RMI class loader disabled)
    at org.springframework.remoting.rmi.RmiClientIntercep torUtils.convertRmiAccessException(RmiClientInterc eptorUtils.java:190)
    at org.springframework.remoting.rmi.RmiClientIntercep tor.doInvoke(RmiClientInterceptor.java:346)
    at org.springframework.remoting.rmi.RmiClientIntercep tor.invoke(RmiClientInterceptor.java:258)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy9.createPortCall(Unknown Source)
    at com.marcura.dadesk.dis.services.impl.CreatePortCal lServiceImpl.createPortCall(CreatePortCallServiceI mpl.java:58)
    ... 28 more
    Caused by: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
    java.lang.ClassNotFoundException: weblogic.transaction.RollbackException (no security manager: RMI class loader disabled)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Str eamRemoteCall.java:227)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:1 42)
    at org.springframework.remoting.rmi.RmiInvocationWrap per_Stub.invoke(Unknown Source)
    at org.springframework.remoting.rmi.RmiClientIntercep tor.doInvoke(RmiClientInterceptor.java:397)
    at org.springframework.remoting.rmi.RmiClientIntercep tor.doInvoke(RmiClientInterceptor.java:343)
    ... 33 more
    Caused by: java.lang.ClassNotFoundException: weblogic.transaction.RollbackException (no security manager: RMI class loader disabled)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandl er.java:375)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandl er.java:165)
    at java.rmi.server.RMIClassLoader$2.loadClass(RMIClas sLoader.java:620)
    at java.rmi.server.RMIClassLoader.loadClass(RMIClassL oader.java:247)
    at sun.rmi.server.MarshalInputStream.resolveClass(Mar shalInputStream.java:197)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1575)
    at java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1496)
    at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1732)
    at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1329)
    at java.io.ObjectInputStream.defaultReadFields(Object InputStream.java:1947)
    at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1871)
    at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1329)
    at java.io.ObjectInputStream.defaultReadFields(Object InputStream.java:1947)
    at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1871)
    at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:351)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Str eamRemoteCall.java:225)
    ... 37 more


    Is there a way to fix this problem ?

    Firstly, i want to stop the propagation of weblogic.transaction.RollbackException to the client side.

    In Server side, when an exception occurs, the exception is caught in the CreatePortCallRMIServiceImpl explicitly.

    Could there be any relation ship between the transaction management and rmi service.

    Any help is greatly appreciated.

  • #2
    Please use [ code][/code ] tags when posting code. You shouldn't catch the exceptions or at least not swallow them because that breaks transaction management. Make sure that you can access the server and on that specific port, it might nog bind to all urls (only localhost/127.0.0.1 instead of the remote one). Make sure there is no firewalling etc. happening.

    Comment


    • #3
      no security manager: RMI class loader disabled

      Marten Deinum, thanks for the reply.

      We don't want to propagate the transaction exception from RMI Service(running in weblogic app server) to RMI Client (running in apache tomcat app server).

      Hence made certain changes as below to stop the transaction propagation.

      Code:
      <aop:config>
      
      <aop:pointcut id="PCUT-RmiService" expression="execution(* com.wisdom.poseidon.business.CreatePortCallRMIService.*(..))" />
      <aop:advisor advice-ref="ADV-PCUT-RmiService" pointcut-ref="PCUT-RmiService"/>
      
      </aop:config>
      
      <tx:advice id="ADV-PCUT-RmiService" transaction-manager="txManager">
      		<tx:attributes>
      			<tx:method name="*" propagation="NOT_SUPPORTED" />
      		</tx:attributes>
      </tx:advice>
      Cheers !

      Comment


      • #4
        In general you want service methods to be transactional, currently they aren't.. Also springs tx exceptions don't propagate the service proxy takes care of that, as well as the client proxy. So currently imho you are trying to fix a problem, which shouldn't be fixed... You don't want the weblogic tx exceptions to propagate, I suggest you simply take the RmiServiceExporter and extend it, there is a method which resolves/transforms exceptions and you can simply extend to to extract the root cause instead of the Rollback exception (or you can throw your own exception).
        Last edited by Marten Deinum; Aug 23rd, 2010, 05:35 AM.

        Comment

        Working...
        X