javaofbiz

Apache OFBiz startup exception


I am trying to setup OFBiz in my computer. So far, I have followed the step by step procedure on installing the software. The problem is when I try to run the server by executing the command java -jar ofbiz.jar I always encounter a startup exception. Even if I execute the startofbiz.bat it will display the same error:

org.ofbiz.base.start.StartupException: Cannot locate container class (org.ofbiz.service.rmi.RmiServiceContainer)
    at org.ofbiz.base.container.ContainerLoader.loadContainer(ContainerLoader.java:164)
    at org.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:65)
    at org.ofbiz.base.start.Start.initStartLoaders(Start.java:259)
    at org.ofbiz.base.start.Start.init(Start.java:96)
    at org.ofbiz.base.start.Start.main(Start.java:410)
java.lang.ClassNotFoundException: org.ofbiz.service.rmi.RmiServiceContainer
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.ofbiz.base.util.CachedClassLoader.loadClass(CachedClassLoader.java:196)
    at org.ofbiz.base.util.CachedClassLoader.loadClass(CachedClassLoader.java:169)
    at org.ofbiz.base.container.ContainerLoader.loadContainer(ContainerLoader.java:162)
    at org.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:65)
    at org.ofbiz.base.start.Start.initStartLoaders(Start.java:259)
    at org.ofbiz.base.start.Start.init(Start.java:96)
    at org.ofbiz.base.start.Start.main(Start.java:410)
java.lang.ClassNotFoundException: org.ofbiz.service.rmi.RmiServiceContainer
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.ofbiz.base.util.CachedClassLoader.loadClass(CachedClassLoader.java:196)
    at org.ofbiz.base.util.CachedClassLoader.loadClass(CachedClassLoader.java:169)
    at org.ofbiz.base.container.ContainerLoader.loadContainer(ContainerLoader.java:162)
    at org.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:65)
    at org.ofbiz.base.start.Start.initStartLoaders(Start.java:259)
    at org.ofbiz.base.start.Start.init(Start.java:96)
    at org.ofbiz.base.start.Start.main(Start.java:410)

Please help!


Solution

  • Assuming you've run the ant run-install step as you have been following step by step instructions you should debug the exception like you would any other java exception.

    Firstly in your stack trace the key lines to look at are:

    {org.ofbiz.base.start.StartupException: Cannot locate container class (org.ofbiz.service.rmi.RmiServiceContainer)} {java.lang.ClassNotFoundException: org.ofbiz.service.rmi.RmiServiceContainer}

    These are telling you that the class, org.ofbiz.service.rmi.RmiServiceContainer, was attempted to be loaded and was not found.

    You should check to see whether you have the class file RmiServiceContainer.class. In my installation of OFBiz this class is located under:

    /ofbiz/framework/service/build/classes/org/ofbiz/service/rmi/RmiServiceContainer.class

    If you find the class file then try rebuilding OFBiz using ant refresh.

    If you could not find the class file then search for the java file that is used to create this class RmiServiceContainer.java. The java code that is compiled to created this class is located under:

    /ofbiz/framework/service/src/org/ofbiz/service/rmi/RmiServiceContainer.java

    If you find the Java file, again, try and rebuild OFBiz using ant refresh and confirm the class file was created. If you cannot find the java file then you should download OFBiz again.

    If running ant refresh fails to fix the issue then it's likely something isn't configured correctly in your classpath.