1 2 Previous Next 18 Replies Latest reply: Feb 14, 2013 6:11 AM by 951671 RSS

    java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search

    951671
      Hi everyone,

      I'm develoing a Web Center App Jdev v 11.1.1.6.0 .

      In a page, i added a search toolbar. In runtime, when i try to search a content it directs me white blank page with the error of :

      java.lang.NoClassDefFoundError: Could not initialize class oracle.webcenter.search.model.SearchPreferences


      Does anybody know about this problem?

      In forum there is no helpful topic/thread.

      Helps will be appreciated.

      Erdo
        • 1. Re: java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search
          Daniel Merchán
          Hi.

          During runtime WebCenter Search libraries seem to be missing or duplicated in the classpath for some reason.

          Check:
          - Classpath of application in runtime verifying that exists only one instance of search-view and search-model libraries. A tip for this step is use:
          ClassLoader cl = ClassLoader.getSystemClassLoader();
           
                  URL[] urls = ((URLClassLoader)cl).getURLs();
           
                  for(URL url: urls){
                       System.out.println(url.getFile());
                  }
          - Verify that you aren't including in the deployment options of your Portal Application the WebCenter libraries.

          Use http://[host]:[port]/wls-cat/ tool of WebLogic. Is easy find classpath problems with it ;).

          Regards.
          • 2. Re: java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search
            951671
            Hi Daniel, thanks for reply.

            Here is the result :

            /C:/Oracle/Middleware/oracle_common/modules/oracle.jdbc_11.1.1/ojdbc6dms.jar
            /C:/Oracle/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar
            /C:/Oracle/Middleware/patch_jdev1111/profiles/default/sys_manifest_classpath/weblogic_patch.jar
            /C:/Oracle/Middleware/jdk160_24/lib/tools.jar
            /C:/Oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar
            /C:/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar
            /C:/Oracle/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar
            /C:/Oracle/Middleware/wlserver_10.3/server/lib/webservices.jar
            /C:/Oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar
            /C:/Oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar
            /C:/Users/Erdo/AppData/Roaming/JDeveloper/system11.1.1.6.38.61.92/DefaultDomain/wcps-lib/derby-10.6.1.0.jar
            /C:/Users/Erdo/AppData/Roaming/JDeveloper/system11.1.1.6.38.61.92/DefaultDomain/wcps-lib/derbytools-10.6.1.0.jar
            /C:/Oracle/Middleware/jdeveloper/webcenter/modules/oracle.portlet.server_11.1.1/oracle-portlet-api.jar
            /C:/Oracle/Middleware/jdeveloper/webcenter/modules/wcps_11.1.1.4.0/wcps-connection-mbeans.jar
            /C:/Oracle/Middleware/oracle_common/modules/oracle.jrf_11.1.1/jrf.jar
            /C:/Oracle/Middleware/wlserver_10.3/common/derby/lib/derbyclient.jar
            /C:/Oracle/Middleware/wlserver_10.3/server/lib/xqrl.jar


            I couldn't see any problem. only there are two weblogic_patch.jar, but in the different folders.

            Secondly, i couldn't connect your add : I guess i misunderstood . Is it correct, please correct me : http://localhost:7101/wls_cat

            Regards

            Erdo
            • 3. Re: java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search
              951671
              I wroted wls_cat, the correct one wls-cat :) I found the problem.

              But i don't know what i'm doing.
              • 4. Re: java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search
                Daniel Merchán
                http://localhost:7101/wls-cat is the correct.
                • 5. Re: java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search
                  Daniel Merchán
                  Generate a report in wls-cat and verify that WebCenter libraries corresponding to Search Services is in the classpath and are not duplicated.

                  Regards.
                  • 6. Re: java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search
                    Daniel Merchán
                    wls-cat is a tool to verify possible problems in the classpath of applications.

                    You have to select your Application from the left tree and click in "Generate Report". It generate a XML with all the libraries used by your Portal Application.

                    java.lang.NoClassDefFoundError: Could not initialize class oracle.webcenter.search.model.SearchPreferences

                    That class is in search-model.jar


                    Regards.
                    • 7. Re: java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search
                      951671
                      There are 3 searc-model.jar entries :

                      <entry path="C:\Users\Erdo\AppData\Roaming\JDeveloper\system11.1.1.6.38.61.92\DefaultDomain\servers\DefaultServer\tmp\_WL_user\oracle.webcenter.framework\owur7d\APP-INF\lib\search-model.jar" checksum="ea4dbae8cc13cb4e4e3597cbcb7e1daa"/>

                      <entry path="C:\Users\Erdo\AppData\Roaming\JDeveloper\system11.1.1.6.38.61.92\DefaultDomain\servers\DefaultServer\tmp\_WL_user\oracle.webcenter.framework\owur7d\APP-INF\lib\search-model.jar" checksum="ea4dbae8cc13cb4e4e3597cbcb7e1daa"/>

                      <entry path="C:\Users\Erdo\AppData\Roaming\JDeveloper\system11.1.1.6.38.61.92\DefaultDomain\servers\DefaultServer\tmp\_WL_user\oracle.webcenter.framework\owur7d\APP-INF\lib\search-model.jar" checksum="ea4dbae8cc13cb4e4e3597cbcb7e1daa"/>

                      Those are the same. Now what can i do? To erase them and after to add, will it be helpful?

                      Regards.

                      Erdo
                      • 8. Re: java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search
                        Daniel Merchán
                        Hi.

                        This is the reasson of the problem.

                        You have to verify your deployment profiles:

                        EAR Deployment profile:
                        - Click in the symbol at the right of your application name and click in "Application Properties".
                        - Go to "Deployments" and click in "Edit" of your deployment profile.
                        - Go to "Application Libraries > Contributors". All libraries of the product must be unchecked.

                        WAR Deployment profile:
                        - Click in "Portal" project an go to "Project Properties".
                        - Do the same check about the libraries (only the WebCenter Search related).

                        Previously to re-deploy delete WLuser/[NameOfYourPortalApp] cache of weblogic.

                        In addition, verify that in the path showed are not 3 search-model.jar. Only must to be one.

                        Redeploy your application and give me a feedback.

                        Regards.
                        • 9. Re: java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search
                          Daniel Merchán
                          If my previous post don't solve the problem do the next.

                          Delete all content in WLuser/ folder (is only a cache folder) and restart your WebLogic.

                          Regards.
                          • 10. Re: java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search
                            951671
                            Hi Daniel,

                            I verified your suggestions. There is no problem on EAR and War Deployment Profile.

                            Redploying doesn't solve the problem and i applied your next post. I deleted the WLuser folder and run my application. When testing search toolbar, the error message :

                            "In adf-config file, there are no oracle webcenter environment informations." (The error message is in Turkish, so i translated it English , not the exact message.)

                            Then the error log goes on ;

                            javax.el.ELException: java.lang.ExceptionInInitializerError
                                 at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:415)
                                 at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
                                 at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
                                 at oracle.adfinternal.view.faces.config.rich.RecordRequestAttributesDuringDispatch.dispatch(RecordRequestAttributesDuringDispatch.java:44)
                                 at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
                                 at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
                                 at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
                                 at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$OverrideDispatch.dispatch(FacesContextFactoryImpl.java:267)
                                 at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:469)

                            ..

                            How can i edit adf-config file? I couldn't see anything about web center environment in it.

                            Regards

                            Erdo
                            • 11. Re: java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search
                              Daniel Merchán
                              If you are in JDeveloper with a WebCenter Portal Framework.

                              Go to Application Resources -> Descriptors -> ADF META-INF and open & edit your adf-config.xml.

                              Regards.
                              • 12. Re: java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search
                                951671
                                The solution is about preferences.xml file. I deleted AutoGenerated folder and redeployed the application. It worked but didn't bring results.
                                • 13. Re: java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search
                                  Daniel Merchán
                                  OOTB WebCenter Portal is prepared to use Oracle SES. If you don't have Oracle SES change adf-config:
                                  <crawl-properties fullCrawlInterval="P5D" enableWcServicesCrawl="true"
                                                        enableWcDiscussionsCrawl="true" enableWcUcmCrawl="true"/>
                                  to
                                  <crawl-properties fullCrawlInterval="P5D" enableWcServicesCrawl="false"
                                                        enableWcDiscussionsCrawl="false" enableWcUcmCrawl="false"/>
                                  Setting this configuration then is going to use WebCenter Default Search adapters instead of SES.

                                  Regards.
                                  • 14. Re: java.lang.NoClassDefFoundError: Could not initialize ...search.model.Search
                                    951671
                                    I don't how i'm going to thank you. It works now. Thank you very much :)

                                    With my apologies, i just want to ask a question -off the record- ,

                                    After searching a content, search toolbar directs me a page with page_globe_template. How can i change it?

                                    Thanks again.

                                    Erdo
                                    1 2 Previous Next