3 Replies Latest reply on Dec 4, 2001 3:24 AM by Rajesh

    Use of classes present in jboss.jar

    Rajesh Newbie

      Hi I have written a cache service MBean
      "public class SCECachePolicy extends ServiceMBeanSupport implements SCECachePolicyMBean"
      The code is compiled and I have registered it in jboss.jcml file this way

      "
      security/CachePolicy
      "

      when I start the jboss by run.bat I get the following exception

      [Configuration] Could not create MBean DefaultDomain:service=security/CachePolic
      y(com.velankani.security.cache.SCECachePolicy)
      [Configuration] java.lang.NoClassDefFoundError: org/jboss/util/ServiceMBeanSupport
      [Configuration]at java.lang.ClassLoader.defineClass0(Native Method)
      [Configuration]at java.lang.ClassLoader.defineClass(Unknown Source)
      [Configuration]at java.security.SecureClassLoader.defineClass(Unknown S
      ource)
      [Configuration]at java.net.URLClassLoader.defineClass(Unknown Source)
      [Configuration]at java.net.URLClassLoader.access$100(Unknown Source)
      [Configuration]at java.net.URLClassLoader$1.run(Unknown Source)
      [Configuration]at java.security.AccessController.doPrivileged(Native Me
      thod)
      [Configuration] at java.net.URLClassLoader.findClass(Unknown Source)
      [Configuration]at java.lang.ClassLoader.loadClass(Unknown Source)
      [Configuration]at sun.misc.Launcher$AppClassLoader.loadClass(Unknown So
      urce)
      [Configuration]at java.lang.ClassLoader.loadClass(Unknown Source)
      [Configuration]at java.lang.ClassLoader.loadClass(Unknown Source)
      [Configuration]at com.sun.management.jmx.MBeanServerImpl.findClass(MBea
      nServerImpl.java:2466)
      [Configuration]at com.sun.management.jmx.MBeanServerImpl.createMBean(MB
      eanServerImpl.java:751)
      [Configuration]at org.jboss.configuration.ConfigurationService.create(C
      onfigurationService.java:579)
      [Configuration]at org.jboss.configuration.ConfigurationService.loadConf
      iguration(ConfigurationService.java:381)
      [Configuration]at java.lang.reflect.Method.invoke(Native Method)
      [Configuration]at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanSe
      rverImpl.java:1628)
      [Configuration]at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanSe
      rverImpl.java:1523)
      [Configuration]at org.jboss.Main.(Main.java:213)
      [Configuration]at org.jboss.Main$1.run(Main.java:127)
      [Configuration]at java.security.AccessController.doPrivileged(Native Me
      thod)
      [Configuration]at org.jboss.Main.main(Main.java:123)

      The class it is asking is in jboss.jar file if I place this in the classpath in run.bat file it gives lot many other exceptions.

      Thanking you all in before for your support.

        • 1. Re: Use of classes present in jboss.jar
          arthurg Newbie

          Hello,

          I've got a feeling that you have added the jar containing your mbean classes to the JBOSS_CLASSPATH in the run.bat file. All you should need to do is place the jar containing the mbean classes in the jboss/lib/ext directory and jboss will find it automatically. You should not have to put an entry in JBOSS_CLASSPATH.

          I've created an mbean that implements a custom cache policy and jboss has no problems when I do the above...

          arthurg.

          • 2. Re: Use of classes present in jboss.jar
            Rajesh Newbie

            Thank you arthurg,

            Yah its fine and the MBean is loaded. The problem I am facing is, I am not able to give any requests to the server. I am getting the following exception on client console
            Creating LoginContext
            Created LoginContext
            ini context created
            Got contextjnp://localhost:1000/interest/Interest
            Got reference
            Got Home ----object
            java.rmi.ServerException: RemoteException occurred in server thread; nested exce
            ption is:java.rmi.ServerException: Exception occurred; nested exception is: java.lang.NullPointerException
            java.rmi.ServerException: Exception occurred; nested exception is:java.lang.NullPointerException
            java.lang.NullPointerException at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)at sun.rmi.server.UnicastRef.invoke(Unknown Source)at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invokeHome(Unknown Source)at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invokeHome(HomeProxy.java:258)at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:182)at $Proxy0.create(Unknown Source)
            at InterestClientLC.mainInterestClientLC.java:108)
            java.rmi.ServerException: RemoteException occurred in server thread; nested exce
            ption is:java.rmi.ServerException: Exception occurred; nested exception is:java.lang.NullPointerException

            • 3. Re: Use of classes present in jboss.jar
              Rajesh Newbie

              Thank you arthurg,
              Yah it worked fine. One more need, do you know how to restrict a user logging from different systems?

              Thanks in advance