How to run Guidewire war file using tomcat?

146 views Asked by At

I have a specific need to launch the CC war file with the Tomcat server. I've created two war files - one using the "warTomcatDbcp" command and other using "warTomcatJndi" command. However, I'm encountering an error with both the wars when I attempt to start the Tomcat server. To make sure its not the issue with the tomcat, I deployed a war file created from a small Java project and it came up without any issues.

Is "gwb warTomcatDbcp" or "gwb warTomcatJndi" the correct way of building the war file in Guidewire? Additionally, are there any other steps or configurations required to build the war file correctly?

Please note - I'm attempting this with the OOTB version and haven't made any code changes and also I was able to start the server from the studio jetty server.

This is the cc logs which I get when I try to spin up the server from tomcat.

31-Oct-2023 09:02:57.488 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class [com.guidewire.pl.system.websocket.WebSocketServletContextListener]
    java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
        at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2352)
        at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:800)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1317)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1165)
        at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:491)
        at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:473)
        at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:143)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4349)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4860)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:683)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:658)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:712)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:975)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1952)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:776)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1659)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:114)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:345)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:893)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:845)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:240)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:917)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:795)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:347)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478)
    Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContextListener
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1353)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1165)
        ... 51 more

Any assistance or guidance on this matter would be greatly appreciated.

Thanks!

2

There are 2 answers

2
Martin Aavik On BEST ANSWER

Can you clarify whether this is a GWCP cloud release of PC? Or self-managed? If you can paste in the contents of project-version.properties it would help narrow this down.

From what I can see in the Platform Support Matrix (available on community.guidewire.com via login) there is no support for running cloud releases on a local Tomcat instance - the available Jetty server is considered sufficient for most cases. In the GWCP environment the latest release runs on Apache Tomcat 9.0.78 and later versions of 9.0.x. You could check your version (or the version associated with your release) to insure it isn't a compatibility issue.

1
Domenick Doran On

The difference between warTomcatDbcp and warTomcatJndi is that the former packages the database drivers into the war file, while the latter does not. The reason for this distinction is that the latter ant task assumes you'll be using a JNDI lookup of a database connection which is administered by the servlet container (in your case Tomcat), rather than managing its own connection pool. If you're using JNDI, you don't need the db drivers.

None of this is related to your issue, though. Much of the servlet packages are renamed in Tomcat 10 and beyond, which Guidewire products do not support. If you downgrade to Tomcat 9, you should be all set.