6 Replies Latest reply on Oct 24, 2007 6:57 PM by Manik Surtani

    jbosscache 1.4.1.sp5 running on oc4j 10.1.3

    zhe zhang Newbie

      when call treeCache.start(), it has a exception:
      07/10/23 15:49:24 java.lang.ClassCastException: org.apache.commons.logging.impl.LogFactoryImpl
      07/10/23 15:49:24 at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:504)
      07/10/23 15:49:24 at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:350)
      07/10/23 15:49:24 at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:381)
      07/10/23 15:49:24 at org.jgroups.blocks.MethodCall.(MethodCall.java:46)
      07/10/23 15:49:24 at java.lang.Class.forName0(Native Method)
      07/10/23 15:49:24 at java.lang.Class.forName(Class.java:164)
      07/10/23 15:49:24 at org.jboss.cache.marshall.MethodDeclarations.class$(MethodDeclarations.java:39)
      07/10/23 15:49:24 at org.jboss.cache.marshall.MethodDeclarations.(MethodDeclarations.java:268)
      07/10/23 15:49:24 at org.jboss.cache.interceptors.CallInterceptor.(CallInterceptor.java:30)
      07/10/23 15:49:24 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      07/10/23 15:49:24 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      07/10/23 15:49:24 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      07/10/23 15:49:24 at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
      07/10/23 15:49:24 at java.lang.Class.newInstance0(Class.java:350)
      07/10/23 15:49:24 at java.lang.Class.newInstance(Class.java:303)
      07/10/23 15:49:24 at org.jboss.cache.factories.InterceptorChainFactory.createInterceptor(InterceptorChainFactory.java:43)
      07/10/23 15:49:24 at org.jboss.cache.factories.InterceptorChainFactory.createPessimisticInterceptorChain(InterceptorChainFactory.java:95)
      07/10/23 15:49:24 at org.jboss.cache.factories.InterceptorChainFactory.buildInterceptorChain(InterceptorChainFactory.java:35)
      07/10/23 15:49:24 at org.jboss.cache.TreeCache._createService(TreeCache.java:1431)
      07/10/23 15:49:24 at org.jboss.cache.TreeCache.createService(TreeCache.java:1388)
      07/10/23 15:49:24 at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:245)
      07/10/23 15:49:24 at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:173)
      07/10/23 15:49:24 at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:265)
      07/10/23 15:49:24 at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:181)
      07/10/23 15:49:24 at com.igm.gml.cache.JbCacheUtil.(JbCacheUtil.java:37)
      07/10/23 15:49:24 at com.igm.gml.servlet.initServlet.init(initServlet.java:47)
      please help. thanks
      -Z

        • 1. Re: jbosscache 1.4.1.sp5 running on oc4j 10.1.3
          Brian Stansberry Master

          Did you put the commons-logging.jar that comes with JBossCache on your classpath? If you did, try removing it and just use whatever's already there.

          • 2. Re: jbosscache 1.4.1.sp5 running on oc4j 10.1.3
            zhe zhang Newbie

            thanks for reply, I tried by deleting commons-logging.jar from public_html/WEB-INF/lib

            and it still same exception.

            -Z

            • 3. Re: jbosscache 1.4.1.sp5 running on oc4j 10.1.3
              zhe zhang Newbie

              BTW, I am also using log4j.

              this is the coding:

              package com.igm.gml.cache;

              import java.net.InetAddress;

              import javax.servlet.ServletContext;

              import org.apache.log4j.BasicConfigurator;
              import org.apache.log4j.Logger;

              import org.jboss.cache.TreeCache;
              import org.jboss.cache.lock.IsolationLevel;


              public class JbCacheUtil {
              static Logger logger = Logger.getLogger(JbCacheUtil.class);
              static TreeCache tc = null;
              static ServletContext context = null;
              static {
              BasicConfigurator.configure();
              logger.info("TreeCache is initializing....");
              try {
              tc = new TreeCache();
              String ip = InetAddress.getLocalHost().getHostAddress();
              String hostName = InetAddress.getLocalHost().getHostName();
              System.out.println("host ip = " + ip);
              System.out.println("host name = " + hostName);
              org.jboss.cache.PropertyConfigurator config=new org.jboss.cache.PropertyConfigurator();
              try {
              config.configure(tc, "cache-service.xml"); // read in generic replSync xml
              System.out.println("cache configurator loaded cache-service.xml");
              } catch (Exception configException1) {
              configException1.printStackTrace();
              }
              System.out.println("CacheMode = " + tc.getCacheMode());
              tc.setIsolationLevel(IsolationLevel.SERIALIZABLE);
              tc.setLockAcquisitionTimeout(5000);
              tc.startService();
              System.out.println("TreeCache finished initializing.");
              } catch (Exception e) {
              logger.error(e, e);
              }
              }

              public static TreeCache getTreeCache() {
              return tc;
              }

              public static void setTreeCache(TreeCache treeCache) {
              tc = treeCache;
              }

              public static void setContext(ServletContext p_context) {
              context = p_context;
              }

              public static ServletContext getContext() {
              return context;
              }
              }

              • 4. Re: jbosscache 1.4.1.sp5 running on oc4j 10.1.3
                Manik Surtani Master

                what about in the OC4J libs? Does that come with a version of commons-logging?

                • 5. Re: jbosscache 1.4.1.sp5 running on oc4j 10.1.3
                  zhe zhang Newbie

                  I configured libraries as following:

                  1. C:\working\jbosscache-test\jbosscachetest\public_html\WEB-INF\lib\Log4j.jar

                  2. JSP Runtime which is a group/package of jar files:
                  C:\jdevstudio1013\j2ee\home\lib\ojsp.jar
                  C:\jdevstudio1013\j2ee\home\lib\taglib\ojsputil.jar
                  C:\jdevstudio1013\j2ee\home\lib\oc4j.jar
                  C:\jdevstudio1013\j2ee\home\lib\oc4j-internal.jar
                  C:\jdevstudio1013\j2ee\home\lib\servlet.jar
                  C:\jdevstudio1013\j2ee\home\lib\ojc.jar


                  3. Struts Runtime which is a group/package of jar files:
                  C:\jdevstudio1013\jakarta-struts\lib\struts.jar
                  C:\jdevstudio1013\jakarta-struts\lib\commons-beanutils.jar
                  C:\jdevstudio1013\jakarta-struts\lib\commons-collections.jar
                  C:\jdevstudio1013\jakarta-struts\lib\commons-fileupload.jar
                  C:\jdevstudio1013\jakarta-struts\lib\commons-digester.jar
                  C:\jdevstudio1013\jakarta-struts\lib\commons-lang.jar
                  C:\jdevstudio1013\jakarta-struts\lib\commons-logging.jar
                  C:\jdevstudio1013\jakarta-struts\lib\commons-validator.jar
                  C:\jdevstudio1013\jakarta-struts\lib\jakarta-oro.jar

                  4. C:\working\jbosscache-test\jbosscachetest\public_html\WEB-INF\lib\concurrent.jar

                  5. C:\working\jbosscache-test\jbosscachetest\public_html\WEB-INF\lib\javassist.jar

                  6. C:\working\jbosscache-test\jbosscachetest\public_html\WEB-INF\lib\jboss-cache.jar

                  7. C:\working\jbosscache-test\jbosscachetest\public_html\WEB-INF\lib\jboss-common.jar

                  8. C:\working\jbosscache-test\jbosscachetest\public_html\WEB-INF\lib\jboss-jmx.jar

                  9. C:\working\jbosscache-test\jbosscachetest\public_html\WEB-INF\lib\jboss-system.jar

                  10. C:\working\jbosscache-test\jbosscachetest\public_html\WEB-INF\lib\jgroups.jar

                  there is no common-logging.jar under C:\working\jbosscache-test\jbosscachetest\public_html\WEB-INF\lib\



                  • 6. Re: jbosscache 1.4.1.sp5 running on oc4j 10.1.3
                    Manik Surtani Master

                    So there is a commons-logging jar file in your struts directory. There is probably a version mismatch here - have you tried replacing the commons-logging jar in that directory with the jar that ships with JBC?