Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 16.11.01
    • Component/s: framework/webtools
    • Labels:
      None

      Description

      While working on OFBIZ-7016, I excluded the ecommerce component from the component-load.xml file in the special purpose folder.

      In a clean, up-to-date setup I executed ./gradlew cleanAll loadDefault ofbiz to start up the new setup. And the following error got thrown:

      2016-08-02 11:46:53,805 |0.0.0.0-startStop-1  |[/webtools]                   |E| StandardWrapper.Throwable
      java.lang.ExceptionInInitializerError
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_45]
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_45]
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_45]
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[?:1.8.0_45]
      	at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_45]
      	at org.apache.ofbiz.base.util.template.FreeMarkerWorker.loadTransforms(FreeMarkerWorker.java:151) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.base.util.template.FreeMarkerWorker.makeConfiguration(FreeMarkerWorker.java:133) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.base.util.template.FreeMarkerWorker.<clinit>(FreeMarkerWorker.java:85) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.webapp.ftl.FreeMarkerViewHandler.<init>(FreeMarkerViewHandler.java:48) ~[ofbiz.jar:?]
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_45]
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_45]
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_45]
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[?:1.8.0_45]
      	at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_45]
      	at org.apache.ofbiz.base.util.ObjectType.getInstance(ObjectType.java:159) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.webapp.view.ViewFactory.<init>(ViewFactory.java:49) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.webapp.control.RequestHandler.<init>(RequestHandler.java:99) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.webapp.control.RequestHandler.getRequestHandler(RequestHandler.java:84) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.webapp.control.ControlServlet.getRequestHandler(ControlServlet.java:329) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.webapp.control.ControlServlet.init(ControlServlet.java:80) ~[ofbiz.jar:?]
      	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1238) [tomcat-catalina-8.0.33.jar:8.0.33]
      	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1151) [tomcat-catalina-8.0.33.jar:8.0.33]
      	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1038) [tomcat-catalina-8.0.33.jar:8.0.33]
      	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4996) [tomcat-catalina-8.0.33.jar:8.0.33]
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) [tomcat-catalina-8.0.33.jar:8.0.33]
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [tomcat-catalina-8.0.33.jar:8.0.33]
      	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) [tomcat-catalina-8.0.33.jar:8.0.33]
      	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) [tomcat-catalina-8.0.33.jar:8.0.33]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_45]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_45]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_45]
      	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_45]
      Caused by: java.lang.NullPointerException
      	at org.apache.ofbiz.product.category.SeoConfigUtil.init(SeoConfigUtil.java:119) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.product.category.ftl.CatalogUrlSeoTransform.<clinit>(CatalogUrlSeoTransform.java:76) ~[ofbiz.jar:?]
      	... 32 more
      2016-08-02 11:46:53,811 |0.0.0.0-startStop-1  |[/webtools]                   |E| Servlet [ControlServlet] in web application [/webtools] threw load() exception
      java.lang.NullPointerException
      	at org.apache.ofbiz.product.category.SeoConfigUtil.init(SeoConfigUtil.java:119) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.product.category.ftl.CatalogUrlSeoTransform.<clinit>(CatalogUrlSeoTransform.java:76) ~[ofbiz.jar:?]
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_45]
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_45]
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_45]
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[?:1.8.0_45]
      	at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_45]
      	at org.apache.ofbiz.base.util.template.FreeMarkerWorker.loadTransforms(FreeMarkerWorker.java:151) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.base.util.template.FreeMarkerWorker.makeConfiguration(FreeMarkerWorker.java:133) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.base.util.template.FreeMarkerWorker.<clinit>(FreeMarkerWorker.java:85) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.webapp.ftl.FreeMarkerViewHandler.<init>(FreeMarkerViewHandler.java:48) ~[ofbiz.jar:?]
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_45]
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_45]
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_45]
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[?:1.8.0_45]
      	at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_45]
      	at org.apache.ofbiz.base.util.ObjectType.getInstance(ObjectType.java:159) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.webapp.view.ViewFactory.<init>(ViewFactory.java:49) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.webapp.control.RequestHandler.<init>(RequestHandler.java:99) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.webapp.control.RequestHandler.getRequestHandler(RequestHandler.java:84) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.webapp.control.ControlServlet.getRequestHandler(ControlServlet.java:329) ~[ofbiz.jar:?]
      	at org.apache.ofbiz.webapp.control.ControlServlet.init(ControlServlet.java:80) ~[ofbiz.jar:?]
      	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1238) ~[tomcat-catalina-8.0.33.jar:8.0.33]
      	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1151) ~[tomcat-catalina-8.0.33.jar:8.0.33]
      	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1038) ~[tomcat-catalina-8.0.33.jar:8.0.33]
      	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4996) [tomcat-catalina-8.0.33.jar:8.0.33]
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) [tomcat-catalina-8.0.33.jar:8.0.33]
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [tomcat-catalina-8.0.33.jar:8.0.33]
      	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) [tomcat-catalina-8.0.33.jar:8.0.33]
      	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) [tomcat-catalina-8.0.33.jar:8.0.33]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_45]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_45]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_45]
      	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_45]
      

        Activity

        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        It's only a temporary workaround, but like Taher suggested on dev ML, disabling all specialpurpose components but example will help working on OFBIZ-7016.

        Show
        jacques.le.roux Jacques Le Roux added a comment - It's only a temporary workaround, but like Taher suggested on dev ML , disabling all specialpurpose components but example will help working on OFBIZ-7016 .
        Hide
        jacques.le.roux Jacques Le Roux added a comment - - edited

        I though noticed the same issue than you on start, not when loading demo data and this is because of OFBIZ-6125

        Show
        jacques.le.roux Jacques Le Roux added a comment - - edited I though noticed the same issue than you on start, not when loading demo data and this is because of OFBIZ-6125
        Hide
        pfm.smits Pierre Smits added a comment -

        Another workaround is to copy SeoConfig.xml to the config folder of a component in the application stack, e.g. commonext

        Show
        pfm.smits Pierre Smits added a comment - Another workaround is to copy SeoConfig.xml to the config folder of a component in the application stack, e.g. commonext
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Good idea Pierre, actually the SEO is not only for ecommerce, and could also be used by hot-deploy (or later plugins) ecommerce alike or of other types components/plugins.

        But we were once again wrong when moving SeoConfig.xml to e-commerce at r1752863 for OFBIZ-6125. I applied your patch when I should have moved the file myself locally and committed directly. So I'll 1st revert r1752863 and then do the right move.

        Show
        jacques.le.roux Jacques Le Roux added a comment - Good idea Pierre, actually the SEO is not only for ecommerce, and could also be used by hot-deploy (or later plugins) ecommerce alike or of other types components/plugins. But we were once again wrong when moving SeoConfig.xml to e-commerce at r1752863 for OFBIZ-6125 . I applied your patch when I should have moved the file myself locally and committed directly. So I'll 1st revert r1752863 and then do the right move.
        Hide
        pfm.smits Pierre Smits added a comment - - edited

        Should we not create a new JIRA issue to tackle the SeoConfig configuration?

        With any addition of a new and deletion of a existing website (cmssite and ecommerce store) this needs to be adjusted, and current way (modifying SeoConfig.xml) isn't particularly flexible.

        Show
        pfm.smits Pierre Smits added a comment - - edited Should we not create a new JIRA issue to tackle the SeoConfig configuration? With any addition of a new and deletion of a existing website (cmssite and ecommerce store) this needs to be adjusted, and current way (modifying SeoConfig.xml) isn't particularly flexible.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Fixed with r1755032 and r1755034. Since SeoConfig.xml is located at init by UtilURL.fromResource() its location is not a pb.

        Show
        jacques.le.roux Jacques Le Roux added a comment - Fixed with r1755032 and r1755034. Since SeoConfig.xml is located at init by UtilURL.fromResource() its location is not a pb.
        Hide
        jacques.le.roux Jacques Le Roux added a comment - - edited

        What needs to be adjusted exactly? As I said below SeoConfig.xml location is not a problem because it is located at init by UtilURL.fromResource(). If it's something else and you have an actionnable plan feel free to do so, else please refrain.

        Show
        jacques.le.roux Jacques Le Roux added a comment - - edited What needs to be adjusted exactly? As I said below SeoConfig.xml location is not a problem because it is located at init by UtilURL.fromResource(). If it's something else and you have an actionnable plan feel free to do so, else please refrain.
        Hide
        pfm.smits Pierre Smits added a comment -

        I will create a new JIRA.

        Show
        pfm.smits Pierre Smits added a comment - I will create a new JIRA.

          People

          • Assignee:
            jacques.le.roux Jacques Le Roux
            Reporter:
            pfm.smits Pierre Smits
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development