SEVERE: Context [/web-viewer] startup failed due to previous errors - 14.0 Web Viewer
search cancel

SEVERE: Context [/web-viewer] startup failed due to previous errors - 14.0 Web Viewer

book

Article ID: 268590

calendar_today

Updated On:

Products

Output Management Web Viewer

Issue/Introduction

Errors deploying Web Viewer 14.0 under CCS Tomcat:

 org.apache.catalina.core.StandardContext listenerStart
 SEVERE: Error configuring application listener of class [com.ca.om.contentviewer.system.ServletContextManager]
 java.lang.NoClassDefFoundError: org.apache.logging.log4j.util.PropertiesUtil (initialization failure)
     at java.lang.J9VMInternals.initializationAlreadyFailed(J9VMInternals.java:87)
     at org.apache.logging.log4j.status.StatusLogger.<clinit>(StatusLogger.java:78)
     at org.apache.logging.log4j.web.Log4jServletContextListener.<clinit>(Log4jServletContextListener.java:44)
     at com.ca.om.contentviewer.system.ServletContextManager.<init>(ServletContextManager.java:47)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:88)
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:436)
     at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:151)
     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4640)
     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5177)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:706)
     at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1023)
     at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1903)
     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:522)
     at java.util.concurrent.FutureTask.run(FutureTask.java:277)
     at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
     at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
     at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:824)
     at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
     at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1611)
     at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
     at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
     at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
     at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
     at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
     at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
     at java.util.concurrent.FutureTask.run(FutureTask.java:277)
     at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
     at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
     at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
     at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
     at org.apache.catalina.core.StandardService.startInternal(StandardService.java:434)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
     at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
     at org.apache.catalina.startup.Catalina.start(Catalina.java:838)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
     at java.lang.reflect.Method.invoke(Method.java:507)
     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
 Caused by: java.lang.NoClassDefFoundError: org.osgi.framework.BundleContext
     at org.apache.logging.log4j.util.ServiceLoaderUtil.loadServices(ServiceLoaderUtil.java:90)
     at org.apache.logging.log4j.util.PropertiesUtil$Environment.<init>(PropertiesUtil.java:471)
     at org.apache.logging.log4j.util.PropertiesUtil$Environment.<init>(PropertiesUtil.java:444)
     at org.apache.logging.log4j.util.PropertiesUtil.<init>(PropertiesUtil.java:88)
     at org.apache.logging.log4j.util.PropertiesUtil.<init>(PropertiesUtil.java:80)
     at org.apache.logging.log4j.util.PropertiesUtil.<clinit>(PropertiesUtil.java:56)
     at org.apache.logging.log4j.util.Constants.<clinit>(Constants.java:30)
     at org.apache.logging.log4j.spi.AbstractLogger.createClassForProperty(AbstractLogger.java:207)
     at org.apache.logging.log4j.spi.AbstractLogger.<clinit>(AbstractLogger.java:95)
     ... 48 more
 Caused by: java.lang.ClassNotFoundException: org.osgi.framework.BundleContext
     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1364)
     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1187)
     ... 57 more
0Jun 13, 2023 2:47:18 PM org.apache.catalina.core.StandardContext listenerStart
 SEVERE: Skipped installing application listeners due to previous error(s)
 Jun 13, 2023 2:47:18 PM org.apache.catalina.core.StandardContext startInternal
 SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
 Jun 13, 2023 2:47:18 PM org.apache.catalina.core.StandardContext startInternal
 SEVERE: Context [/web-viewer] startup failed due to previous errors

Environment

Release : 14.0

Cause

From the verbose Tomcat log we saw that the BundleContext was loaded by the classloader immediately after loading OsgiServiceLocator which would support the eager-loading theory.
 
The fact that this is somehow unique to this environment, and that their JVM is extremely old makes it the likely cause of the problem.

Resolution

Add the osgi.framework library into the CLASSPATH. Given the fact that Web Viewer is not running in an OSGi container and the way Log4j2 2.20 checks for OSGi, that should bypass this particular problem.

Workaround:
1. Obtain the OSGi Framework library: https://repo1.maven.org/maven2/org/osgi/org.osgi.framework/1.10.0/org.osgi.framework-1.10.0.jar
2. Upload it (binary transfer) to the mainframe somewhere where the STC user can read it.
3. Update the CLASSPATH in the started task JCL to include this jar file: CLASSPATH="${CLASSPATH} /path/to/org.osgi.framework-1.10.0.jar" 

Additional Information

Because a workaround was important (time sensitive) simply adding the osgi.framework library into the CLASSPATH was the best solution. Given the fact that Web Viewer code is not running in an OSGi container and the way Log4j2 2.20 checks for OSGi, it should bypass this particular problem. But from a long-term supportability perspective, the JVM ought to be upgraded.