5 Replies Latest reply on Sep 20, 2003 1:33 AM by riishi

    Client exceptions with JBOSS 3.2.1

    drjohnfoster Newbie

      I am trying to run a client app. which calls an EJB deployed under JBOSS 3.2.1 and J2SE 1.4.1.
      It finds the initial context OK, but fails on the JNDI lookup of the Register EJB with the following exception:

      Exception: null
      javax.naming.CommunicationException. Root exception is java.lang.ClassNotFoundE
      xception: au.com.keytrust.vaultAccess.RegisterHome (no security manager: RMI cla
      ss loader disabled)
      at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:521)
      at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:6
      39)
      at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:309
      )
      at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStrea
      m.java:241)
      at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1469)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1432)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
      626)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
      at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
      at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:3
      0)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at au.com.keytrust.vaultAccess.ContactClient.(Unknown Source)
      at au.com.keytrust.vaultAccess.ContactClient.main(Unknown Source)

      I read somewhere that I needed to add the following code:

      System.setSecurityManager(new java.rmi.RMISecurityManager());

      With this line addes, I get the following exception:


      Exception: access denied (java.net.SocketPermission 230.0.0.4 connect,accept,re
      olve)
      java.security.AccessControlException: access denied (java.net.SocketPermission
      30.0.0.4 connect,accept,resolve)
      at java.security.AccessControlContext.checkPermission(AccessControlCont
      xt.java:270)
      at java.security.AccessController.checkPermission(AccessController.java
      401)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
      at java.lang.SecurityManager.checkMulticast(SecurityManager.java:1198)
      at java.net.DatagramSocket.send(DatagramSocket.java:549)
      at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1
      33)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1127)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:478)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at au.com.keytrust.vaultAccess.ContactClient.(Unknown Source)
      at au.com.keytrust.vaultAccess.ContactClient.main(Unknown Source)

      Can anyone help me resolve these?
      John

        • 1. Re: Client exceptions with JBOSS 3.2.1
          Jon Barnett Master

          Check your security policies. See this for more information.
          http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html

          If it is an applet-based application, consider signing it. See this:
          http://java.sun.com/docs/books/tutorial/security1.2/toolsign/index.html

          • 2. Re: Client exceptions with JBOSS 3.2.1
            drjohnfoster Newbie

            RTFEM!

            The error message states quite clearly that this is a ClassNotFoundException - the security manager problem is a consequence, not a cause. Fix the ClassNotFoundException and you fix the problem.
            Mea culpa.
            John

            • 3. Re: Client exceptions with JBOSS 3.2.1
              Jon Barnett Master

              > I read somewhere that I needed to add the following
              >code:

              >System.setSecurityManager(new
              >java.rmi.RMISecurityManager());

              >With this line addes, I get the following exception:


              >Exception: access denied (java.net.SocketPermission
              >230.0.0.4 connect,accept,reolve)
              >java.security.AccessControlException: access denied
              >(java.net.SocketPermission 30.0.0.4
              >connect,accept,resolve)
              >at java.security.AccessControlContext.checkPermission
              >(AccessControlContext.java:270)

              So which problem are we solving? First or last?

              • 4. Re: Client exceptions with JBOSS 3.2.1
                Jon Barnett Master

                Had thought we had moved past the security manager issue. The security policy is related and you must specify a policy for the security manager. That is the consequence of defining the security manager.

                e.g. -Djava.security.policy=mage.policy -Djava.security.manager

                • 5. Re: Client exceptions with JBOSS 3.2.1
                  riishi Newbie

                  Hi jonlee,


                  I have traced your help across different forums to solve my problem.The last link is the one of integration between Lotus Domino Web-Server and JBoss 3.2.1 Application server.

                  I have a jndi lookup from the servlet placed in the Lotus Domino server to the Bean deployed in the jboss server.The same servlet when placed in the Tomcat webserver runs fine.But in the Lotus Domino server it throws the following error :

                  09/15/2003 02:11:09 PM HTTP JVM: java.security.AccessControlException: access d
                  enied (java.net.SocketPermission intradev:8083 connect,resolve)
                  09/15/2003 02:11:09 PM HTTP JVM: at java.security.AccessControlContext.ch
                  eckPermission(AccessControlContext.java:286)
                  09/15/2003 02:11:09 PM HTTP JVM: at java.security.AccessController.checkP
                  ermission(AccessController.java:413)
                  09/15/2003 02:11:09 PM HTTP JVM: at java.lang.SecurityManager.checkPermis
                  sion(SecurityManager.java:565)
                  09/15/2003 02:11:09 PM HTTP JVM: at sun.rmi.server.LoaderHandler$Loader.c
                  heckPermissions(LoaderHandler.java:786)
                  09/15/2003 02:11:09 PM HTTP JVM: at sun.rmi.server.LoaderHandler$Loader.a
                  ccess$000(LoaderHandler.java:740)
                  09/15/2003 02:11:09 PM HTTP JVM: at sun.rmi.server.LoaderHandler.getClass
                  Loader(LoaderHandler.java:279)
                  09/15/2003 02:11:09 PM HTTP JVM: at sun.rmi.server.MarshalInputStream.res
                  olveProxyClass(MarshalInputStream.java:204)
                  09/15/2003 02:11:09 PM HTTP JVM: at java.io.ObjectInputStream.inputProxyC
                  lassDescriptor(ObjectInputStream.java:1027)
                  09/15/2003 02:11:09 PM HTTP JVM: at java.io.ObjectInputStream.readObject(
                  ObjectInputStream.java:406)
                  09/15/2003 02:11:09 PM HTTP JVM: at java.io.ObjectInputStream.readObject(
                  ObjectInputStream.java:272)
                  09/15/2003 02:11:09 PM HTTP JVM: at java.io.ObjectInputStream.inputObject
                  (ObjectInputStream.java:1231)
                  09/15/2003 02:11:09 PM HTTP JVM: at java.io.ObjectInputStream.readObject(
                  ObjectInputStream.java:422)
                  09/15/2003 02:11:09 PM HTTP JVM: at java.io.ObjectInputStream.readObject(
                  ObjectInputStream.java:272)
                  09/15/2003 02:11:09 PM HTTP JVM: at java.rmi.MarshalledObject.get(Marshal
                  ledObject.java:152)
                  09/15/2003 02:11:09 PM HTTP JVM: at org.jnp.interfaces.MarshalledValuePai
                  r.get(MarshalledValuePair.java:30)
                  09/15/2003 02:11:09 PM HTTP JVM: at org.jnp.interfaces.NamingContext.look
                  up(NamingContext.java:514)
                  09/15/2003 02:11:09 PM HTTP JVM: at org.jnp.interfaces.NamingContext.look
                  up(NamingContext.java:471)
                  09/15/2003 02:11:09 PM HTTP JVM: at javax.naming.InitialContext.lookup(In
                  itialContext.java:359)
                  09/15/2003 02:11:09 PM HTTP JVM: at leaveForm.LeaveForm.doGet(LeaveForm.j
                  ava:56)
                  09/15/2003 02:11:09 PM HTTP JVM: at javax.servlet.http.HttpServlet.servic


                  There was a reference on http://www.advisor.com/doc/09164
                  which says

                  add these lines:

                  permission java.util.PropertyPermission
                  "java.naming.factory.initial", "write";
                  permission java.util.PropertyPermission "java.naming.provider.url", "write";
                  permission java.net.SocketPermission "xx.xx.xx.xx:8083", "connect,resolve";

                  (xx.xx.xx.xx is the IP address of your EJB container.)


                  Though I have made the changes still the problem continues.Please help me out