7 Replies Latest reply on Jul 27, 2010 12:56 PM by alpyanar

    Getting Error when trying to deploy Portlet Application on WebLogic Server

    782782
      Hi,

      We have a WebLogic server installed on a Windows machine. We created a new Domain, extended it with ADF Runtime and with Web Center Framework. It created three servers for us along with the already existing AdminServer, WLS_Portlet, WLS_Spaces, WLS_Service.

      We created a portlet Application on our development machine using JDeveloper. When we run it from JDeveloper it runs as expected without any errors.

      We created a Deployment profile for the application as an EAR file. Then we copied this EAR file over to the machine on which WebLogic server is installed (deployment machine).

      On the Deployments screen of the WebLogic Server Console, we selected "Install", selected the EAR file we had created above, selected "Install as Application" and then selected the WLS_Portlet server on which to install it. Then we just kept clicking Next and Finish.

      The first time we tried it, we got a NoClassDefFound exception for some class like JAXRPCServer. We did some research and found that to fix this issue we can put the containing .jar files of the classes not found into the public_html\WEB-INF\lib folder. We tried this for the above error by placing "wsserver.jar" file into the lib folder. Then we got anothe NoClassDefFound error. We again searched for the containing .jar file and put it into the lib folder. This continued for around ten to twenty errors and now we are stuck at a point where we are not able to find a way out.

      The current error that we are getting is NoClassDefFound: oracle/security/jps/internal/policystore/GranteeFactory. We searched for the containing jar of this class and found it to be jps-internal.jar which is already present in our lib folder. The stack trace of the exception is:

      <Jul 2, 2010 11:23:13 AM GMT+05:30> <Error> <Console> <BEA-240003> <Console encountered the following error weblogic.application.ModuleException: oracle/security/jps/internal/policystore/GranteeFactory
      at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1516)
      at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:486)
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
      at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
      at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:201)
      at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:249)
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:427)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
      at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
      at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:28)
      at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:1269)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
      at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
      at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
      at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
      at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
      at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
      at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:164)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:69)
      at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
      Caused by: java.lang.NoClassDefFoundError: oracle/security/jps/internal/policystore/GranteeFactory
      at oracle.security.jps.internal.policystore.JavaPolicyProvider.getPermissions(JavaPolicyProvider.java:216)
      at java.security.Policy.initPolicy(Policy.java:299)
      at java.security.Policy.setPolicy(Policy.java:243)
      at oracle.security.jps.internal.jaas.JaasUtil.setPolicyProvider(JaasUtil.java:54)
      at oracle.security.jps.wls.JpsWeblogicFilter.<clinit>(JpsWeblogicFilter.java:47)
      at oracle.security.jps.wls.JpsWlsPlatformFactory.getJpsFilter(JpsWlsPlatformFactory.java:87)
      at oracle.security.jps.ee.http.JpsFilter.<init>(JpsFilter.java:59)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at java.lang.Class.newInstance0(Class.java:355)
      at java.lang.Class.newInstance(Class.java:308)
      at weblogic.servlet.internal.WebComponentContributor.getNewInstance(WebComponentContributor.java:225)
      at weblogic.servlet.internal.WebComponentContributor.createFilterInstance(WebComponentContributor.java:257)
      at weblogic.servlet.internal.FilterManager.loadFilter(FilterManager.java:94)
      at weblogic.servlet.internal.FilterManager.preloadFilters(FilterManager.java:59)
      at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1867)
      at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3126)
      at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1512)
      at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:486)
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
      at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
      at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
      at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
      at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
      at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
      at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:1267)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
      at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
      at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
      at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
      at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
      at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
      at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)

      Any help would be appreciated on this since we are stuck at this point and have no idea to get across this hurdle.
      One more thing, this is the first time that we are trying to play with WebLogic or even Java. So, some of our questions or steps performed might seem irrelevant here.

      Thanks,
      Gaurav
        • 1. Re: Getting Error when trying to deploy Portlet Application on WebLogic Server
          Jay SenSharma MiddlewareMagic
          Hi Gaurav,

          The Root Cause of this Exception is : <font color=red>Caused by: java.lang.NoClassDefFoundError: oracle/security/jps/internal/policystore/GranteeFactory</font>>

          The Missing class is available inside the *"jps-internal.jar"* Jar File. Please make sure that either this Jar is added in any of the folowing Location:

          1). the Server CLasspath (U can add that Jar in "setDomainEnv.sh" POST_CLASSPATH variable)
          OR
          2). In "<DOMAIN_HOME>\lib"
          OR
          3). inside your Applications "<YOUR_EAR_FILE>\APP-INF\lib"
          OR
          4).inside "YOUR_WAR_FILE\WEB-INF\lib" directory.

          .
          .
          Thanks
          Jay SenSharma
          http://weblogic-wonders.com/weblogic (WebLogic Wonders Are Here)
          • 2. Re: Getting Error when trying to deploy Portlet Application on WebLogic Server
            782782
            Hi Jay,

            Thanks for the reply.

            The problem is that we already have this jps-internal.jar file inside our WEB-INF/lib folder. Our EAR contains a WAR file inside it and inside this WAR file we have kept a copy of this jar file at the proper location.

            As suggested by you, I also tried the deploying the application after copying the jps-internal.jar file into the <DOMAIN_HOME>\lib folder. But the exception still remains.

            I got the same error message as before that the GranteeFactory class is not found.

            What else could be the reason for this exception?

            Thanks,
            Gaurav
            • 3. Re: Getting Error when trying to deploy Portlet Application on WebLogic Server
              Jay SenSharma MiddlewareMagic
              Hi,

              it looks like Classloader issue now... Please try this.... Place all the required Jars...inside *"<WEBAPPLICATION>\WEB_INF\lib"* directory and then place the following Tag inside the *"<WEBAPPLICATION>\WEB_INF\weblogic.xml"* like following:

              <weblogic-web-app xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns=”http://www.bea.com/ns/weblogic/90″ xsi:schemaLocation=”http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd”>
              <b><font color=maroon>
              <container-descriptor>
              <prefer-web-inf-classes>true</prefer-web-inf-classes>
              </container-descriptor>
              </font></b></weblogic-web-app>


              The above Tag will force WLS container to Load the Class Specially from the WEB Applications Lib Directory. ONLY If all the Needed Jars are Placed inside WEB-INF\lib diectory.

              .
              .
              Thanks
              Jay SenSharma
              • 4. Re: Getting Error when trying to deploy Portlet Application on WebLogic Server
                782782
                Hi,

                I tried what you had suggested by putting in the required entry into the weblogic.xml file.

                But now we have started getting a new error. The error message is:
                java.lang.LinkageError: Class javax/xml/transform/Source violates loader constraints

                I also removed the jps-internal.jar file that I had copied into the <Domain_Home>/lib folder thinking that the jar being at two places might be causing this problem but without any sustions as to what might be wrong now?ccess.

                The WEB-INF/lib folder contains all the jar files that we had identified till now as required for the deployment.

                Any suggestions as to what might be wrong now?

                Thanks for all your help till now.

                Thanks,
                Gaurav
                • 5. Re: Getting Error when trying to deploy Portlet Application on WebLogic Server
                  782782
                  Hi,

                  Another update on this issue.

                  To remove the error that we were getting (java.lang.LinkageError: Class javax/xml/transform/Source violates loader constraints), we tried some searching around and found out that the way to fix it is to provide correct versions of xalan.jar, xml-apis.jar and xercesImpl.jar. We downloaded the required version from the apache site and added it to our WEB-INF/lib folder in the WAR file.

                  Now, we are getting this error:

                  XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom

                  What else we might be missing in our libs or do we need to check some other configurations?

                  Any help on this would be much appreciated.

                  Thanks,
                  Gaurav
                  • 6. Re: Getting Error when trying to deploy Portlet Application on WebLogic Server
                    782782
                    Another Update.

                    After some more research it seems like this error is caused by missing entries in JAXP.properties file.

                    The code tries to search for "javax.xml.xpath.XPathFactory" or maybe "http://java.sun.com/jaxp/xpath/dom" in JAXP.properties and if not found it fails with this exception.

                    We downloaded JAXP_142.jar file but could not find the properties file inside this jar file.

                    From where can we get this properties file in which we can get the proper configuration for fixing this issue?

                    Also, where does this property file need to go in our EAR?

                    Thanks in advance.
                    Gaurav
                    • 7. Re: Getting Error when trying to deploy Portlet Application on WebLogic Server
                      alpyanar
                      Hello
                      I want to answer your first post:
                      Do you have jps-internal.jar file under your WL_HOME/server/lib directory? I asked it because libraries have priority to be loaded and wars libraries have low priority. May be you shoul put that jar file's convenient version under that directory.

                      P.S.
                      Priorities:
                      JVM lib>Pre Classpath>Classpath>Server Lib>Ear lib>War lib