6

I have copied the hybris server from mac to windows mechine. In Mac, hybris instance was working fine but in windows its giving some errors hence unable to see hybris login page. Below are the stacktrace.

ERROR [localhost-startStop-3] [ContextLoader] Context initialization failed
java.lang.NullPointerException: null
        at java.net.URI$Parser.parse(URI.java:3042) ~[?:1.8.0_201]
        at java.net.URI.<init>(URI.java:588) ~[?:1.8.0_201]
        at java.net.URI.create(URI.java:850) ~[?:1.8.0_201]
        at com.hybris.backoffice.BackofficeModulesManager.lambda$8(BackofficeModulesManager.java:533) ~[classes/:?]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:1.8.0_201]
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:1.8.0_201]
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_201]
        at java.util.Iterator.forEachRemaining(Iterator.java:116) ~[?:1.8.0_201]
        at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[?:1.8.0_201]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_201]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_201]
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:1.8.0_201]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:1.8.0_201]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_201]
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:1.8.0_201]
        at com.hybris.backoffice.BackofficeModulesManager.assureCorrectExistingModulesStructure(BackofficeModulesManager.java:532) ~[classes/:?]
        at com.hybris.backoffice.BackofficeApplicationContext.prepareRefresh(BackofficeApplicationContext.java:96) ~[classes/:?]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:512) ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443) ~[spring-web-4.3.17.RELEASE.jar:4.3.17.RELEASE]
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325) [spring-web-4.3.17.RELEASE.jar:4.3.17.RELEASE]                      at de.hybris.platform.spring.HybrisContextLoaderListener.doInitWebApplicationContext(HybrisContextLoaderListener.java:225) [coreserver.jar:?]
        at de.hybris.platform.spring.HybrisContextLoaderListener.initWebApplicationContext(HybrisContextLoaderListener.java:199) [coreserver.jar:?]                            at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) [spring-web-4.3.17.RELEASE.jar:4.3.17.RELEASE]
        at de.hybris.platform.spring.HybrisContextLoaderListener.contextInitialized(HybrisContextLoaderListener.java:95) [coreserver.jar:?]
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792) [catalina.jar:8.5.32]
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256) [catalina.jar:8.5.32]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.5.32]
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421) [catalina.jar:8.5.32]
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411) [catalina.jar:8.5.32]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_201]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
ERROR [localhost-startStop-3] [ContextLoader] Context initi

At the end, Server startup instialized message comes up.

    Jul 03, 2019 11:30:18 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-9001"]
Jul 03, 2019 11:30:18 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["https-jsse-nio-9002"]
Jul 03, 2019 11:30:18 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Jul 03, 2019 11:30:18 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 169082 ms
Vivek Dhiman
  • 1,967
  • 6
  • 46
  • 82

3 Answers3

9

@zdhim you are getting this error because BackofficeModulesManager is not able to load the dependent Backoffice extensions from the given path. The dependent extension paths are maintained in the file library.info (at /HYBRIS_HOME/data/backoffice/widgetlib). While you copied Hybris files from Mac to Windows, you would have also copied this file which still had the Mac path.

Though Hybris itself updates the extension paths in this file each time you start the server, but since server startup was failing, it was unable to do so.

You can manually correct the path in library.info and it should work. That function assureCorrectExistingModulesStructure() from BackofficeModulesManager which looks for the library.info has been internally deprecated by Hybris now.

Hope this helps someone who encountered similar issue.

Jogger
  • 397
  • 5
  • 15
3

clean your data/backoffice folder.

0

Try to clean your data folder. Or take a backup of your data and try to initialize your system using HAC or ant initialize