2 Replies Latest reply on Feb 9, 2007 3:49 PM by Victor Batista

    JbossCache 1.4.1 problem/bug

    Victor Batista Newbie

      Hi!
      I have just migrated JbossCache from version 1.2.4-SP2 to version 1.4.1 (I am using Jboss 4.0.3-SP1 and JVM 1.5).
      While initializing the cache, I was getting the following error:
      java.lang.NullPointerException
      at org.jboss.cache.TreeCache.getMBeanServer(TreeCache.java:6484)
      at org.jboss.cache.TreeCache._createService(TreeCache.java:1383)
      at org.jboss.cache.TreeCache.createService(TreeCache.java:1346)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:245)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:173)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:265)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:181)


      With version 1.2.4 everything was working fine. Loooking to JbossCache src code, the NullPointer occurs on the line server.getDefaultDomain().equalsIgno... :

      // return 'jboss' server if available
      for (int i = 0; i < servers.size(); i++)
      {
      MBeanServer server = (MBeanServer) servers.get(i);
      if (server.getDefaultDomain().equalsIgnoreCase(JBOSS_SERVER_DOMAIN))
      return server;
      }

      While looking for a solution to the problem, I realized that I was using the default JVM MBeanServer for Jboss:
      -Djboss.platform.mbeanserver

      This is the problem. I commented the option above, and everything worked fine. Why am I getting the NullPointerException. Does the call to server.getDefaultDomain() on the default MBeanServer returns Null?

      Thanks in advance.
      Best Regards,
      Victor Batista



        • 1. Re: JbossCache 1.4.1 problem/bug
          Manik Surtani Master

          Perhaps you could add a log message to see where the null is. What happens if you leave out the -Djboss.platform.mbeanserver option?

          • 2. Re: JbossCache 1.4.1 problem/bug
            Victor Batista Newbie

            Hi!
            Thanks for your reply.
            I confirm the error. I checked out the JBossCache src code and inserted some debug.
            When I run JBoss configured to use the default JVM MBeanServer (JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"), the call server.getDefaultDomain() returns null (It seems that the JVM is starting its MBean server with a null Default Domain). If I start the JVM without sharing the MBeanServers, the call server.getDefaultDomain() returns "jboss". In both cases I have obly one MBeanServer (It seems that the default JVM MBeanServer isn't created by default, only when it is needed).

            Below we can see the Debug I have inserted. If I got a null Default Domain I was printing its domains (there are no java domains).
            2007-02-09 18:10:05,340 INFO [org.jboss.cache.TreeCache] PTECH Found 1 MBean Servers.
            2007-02-09 18:10:05,340 INFO [org.jboss.cache.TreeCache] .PTECH:null (server.getDefaultDomain())
            2007-02-09 18:10:05,340 INFO [org.jboss.cache.TreeCache] PTECH MBean Server Default DOMAIN is NULL. Ignoring it. MBeanServer:org.jboss.system.server.jmx.LazyMBeanServer@166f936
            2007-02-09 18:10:05,340 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.deployment
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jmx.loading
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.web
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.rmi
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:pt.ptinovacao.wappremium
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.security
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:Catalina
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.jdbc
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.mq
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.jca
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.bean
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.j2ee
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.jms
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.aop
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.net
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.jmx
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.web.deployment
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.cache
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.mq.destination
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:JMImplementation
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.deployer
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.ejb
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.system
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.alerts
            2007-02-09 18:10:05,341 INFO [org.jboss.cache.TreeCache] ..PTECH: Domain:jboss.management.local

            I started with JbossCache-1.4.1.GA. I repeated the process with JbossCache-1.4.1.SP1 and I have exactly the same problem.

            Thanks in advance.
            Regards,
            Victor Batista