2 Replies Latest reply on Oct 30, 2007 1:52 PM by Ryan Rutan

    Upgrade from 1.6.0 to 1.7.0 => Custom AuthFactory (java.lang.NoClassDefFoundError)

    Ryan Rutan

      Normally I am pretty good at tracking down classpath issues, but this one seems a bit off.  I have a process in place that will take Jive's WAR file, and extract the necessary files needed for compilation on that version...compile my extensions against that code for validation...and then bundle everything together accordingly.  This process has worked for my past upgrades with ClearspaceX; however, something has gone arye.

       

      When I deploy the ClearspacEX on OC4J 10.1.3.3, I get the following errors in the jive.error.log

       

      2007.10.29 14:30:27 initialize Clearspace was not able to initialize : null

      java.lang.NoClassDefFoundError

      at java.lang.Class.forName0(Native Method)

      at java.lang.Class.forName(Class.java:164)

      at com.jivesoftware.util.ClassUtils.loadNormalClass(ClassUtils.java:144)

      at com.jivesoftware.util.ClassUtils.loadClass(ClassUtils.java:104)

      at com.jivesoftware.util.ClassUtils.forName(ClassUtils.java:55)

      at com.jivesoftware.base.AuthFactory.loadAuthFactory(AuthFactory.java:688)

      at com.jivesoftware.base.AuthFactory.getSystemAuthToken(AuthFactory.java:194)

      at com.jivesoftware.community.gateway.GatewayListener.<init>(GatewayListener.java:27)

      at com.jivesoftware.community.gateway.DefaultGatewayManager.initialize(DefaultGatewayManager.java:338)

      at com.jivesoftware.community.lifecycle.JiveApplication$ManagerHandler.registerManager(JiveApplication.java:177)

      at com.jivesoftware.community.lifecycle.JiveApplicationLifeCycle.initManagers(JiveApplicationLifeCycle.java:568)

      at com.jivesoftware.community.lifecycle.JiveApplicationLifeCycle.initialize(JiveApplicationLifeCycle.java:202)

      at com.jivesoftware.community.lifecycle.JiveApplication.initialize(JiveApplication.java:80)

      at com.jivesoftware.community.web.webwork.LifeCycleListener.contextInitialized(LifeCycleListener.java:43)

      at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1141)

      at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:741)

      at com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:414)

      at com.evermind.server.Application.getHttpApplication(Application.java:570)

      at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:1987)

      at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(HttpSite.java:1906)

      at com.evermind.server.http.HttpSite.addHttpApplication(HttpSite.java:1603)

      at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:238)

      at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:99)

      at oracle.oc4j.admin.internal.ApplicationDeployer.bindWebApp(ApplicationDeployer.java:547)

      at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:202)

      at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)

      at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)

      at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)

      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)

      at java.lang.Thread.run(Thread.java:595)

       

       

       

       

       

       

       

      I have confirmed that the system is connecting appropriately to the database and grabbing the properties, as this also shows up in the jive.debug.log 

       

       

       

       

       

       

       

       

       

      2007.10.29 12:38:43 Loading auth factory...

      2007.10.29 12:38:43 ...using custom auth factory classname of: .......plugins.user.NiupAuthFactory

      2007.10.29 12:38:43 ...loading auth factory instance

       

       

       

       

       

       

      This class has been confirmed in the WEB-INF/lib in a JAR file named ni-clearspacex.jar.  As such, it should be visible.  Only thoughts remaining might be that a change was made to the AuthFactory class...and the serializations are now different...but I dont see anything that would prove that theory yet.

       

       

       

       

      This is the name of my custom AuthFactory....does anyone know of any classpath changes that may have caused this or has anyone else run into this problem?

       

       

       

      Is it possible a new third-party dependency has been added that OC4J doesn't have the appropriate libraries on the system classpath?  Will look tomorrow.

       

       

       

       

       

       

       

      As always, feedback is appreciated.

        • Re: Upgrade from 1.6.0 to 1.7.0 => Custom AuthFactory (java.lang.NoClassDefFoundError)
          Ryan Rutan

           

          Tracing it down to the Gateway Manager registration in JiveApplicationLifeCycle.

           

           

          From what I can, the Policy ClassLoader is having issues finding

           

           

          com.jivesoftware.community.gateway.GatewayListener

           

           

          I decompiled the file that is distributed via the ClearspaceX 1.7.0 release and compared it to the SRC made available for this class.  There was an extra import and minor differences, which were odd.  Continuing to look into the matter.

           

           

           

           

           

           

           

           

          • Re: Upgrade from 1.6.0 to 1.7.0 => Custom AuthFactory (java.lang.NoClassDefFoundError)
            Ryan Rutan

            It appears that the use of the CacheFactory is causing my AuthFactory from loading. Commenting out these lines in my AuthFactory allowed by Class to load successfully.  Forwarding to Support. 

             

            public static final Cache<Long,Long> JIVE_USER_BY_PROFILE_ID_CACHE = CacheFactory.createCache("ni.jiveUserByProfileId");

            static {

            JIVE_USER_BY_PROFILE_ID_CACHE.setMaxCacheSize(1048576); // 1MB

            JIVE_USER_BY_PROFILE_ID_CACHE.setMaxLifetime(JiveConstants.HOUR*6); // 6 Hours

            } // end static block

             

             

             

            ....

             

             

             

            on lookup...

             

             

             

            if (JIVE_USER_BY_PROFILE_ID_CACHE.containsKey(authToken.getProfileId())) {

            if(Log.isDebugEnabled()) {  Log.debug("NiupAuthToken does not have a User Profile Id");   }

            return JIVE_USER_BY_PROFILE_ID_CACHE.get(authToken.getProfileId());

            } // end if

             

             

             

             

             

            Something else that is worthing noting, we are defining our caches in the jive_startup.xml.  As such the defintion for the referenced cache above is the following:

             

             

              <cache>

                <!-- CUSTOM NI CACHES -->

                <ni>

                  <!-- CUSTOM NI CACHES -->

                  <jiveUserByProfileId>

                    <!-- CACHE IS Long, Long, SIZE=1MB, DURATION=6hrs -->

                    <size>1048576</size>

                    <maxLifetime>21600000</maxLifetime>

                  </jiveUserByProfileId>

                </ni> 

             

             

            .... many others...