Hi,

On Wed, Nov 11, 2020 at 10:36 AM Tamás Barta <bartata...@gmail.com> wrote:

> Hi,
>
> Now it is a Spring Boot web application project without embedded tomcat.
> There is no library in war with javax.servlet api classes. There error is
> the same:
>
> 11-Nov-2020 09:34:06.719 SEVERE [localhost-startStop-1]
> org.apache.catalina.core.ContainerBase.addChildInternal
> ContainerBase.addChild: start:
>  org.apache.catalina.LifecycleException: Failed to start component
>
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ReplicationService-0.0.1-SNAPSHOT]]
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
> at
>
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
> at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:988)
> at
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1860)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.NoClassDefFoundError:
> javax/servlet/ServletContainerInitializer
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
> at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:348)
> at
>
> org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1277)
> at
>
> org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:348)
> at
>
> org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:188)
> at
>
> org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:159)
> at
>
> org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1622)
> at
>
> org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1135)
> at
>
> org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
> at
>
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
> at
>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
> at
>
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5105)
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> ... 10 more
> Caused by: java.lang.ClassNotFoundException:
> javax.servlet.ServletContainerInitializer
>

Definitely you mess up the classpath and there are none or more than one
servlet-api.jar in the classpath.

What happens if you put your sentry related jars in the .war file
(/WEB-INF/lib/) ? I.e. add them as proper Maven dependencies
Or if you put them in $CATALINA_BASE/lib ?
Why did you go with editing setenv.sh in first place ?


> at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> ... 38 more
>
> On Tue, Nov 10, 2020 at 11:28 PM Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
> > Tamás,
> >
> > On 11/10/20 15:42, Tamás Barta wrote:
> > > This is the content of setenv.sh:
> > >
> > > CLASSPATH=$CLASSPATH:$CATALINA_BASE/sentry/sentry-1.7.29.jar
> > > CLASSPATH=$CLASSPATH:$CATALINA_BASE/sentry/slf4j-api-1.7.24.jar
> > > CLASSPATH=$CLASSPATH:$CATALINA_BASE/sentry/jackson-core-2.8.10.jar
> > >
> > > The web application without this sentry configuration works well for
> > ages.
> > > But if I add the above configuration, it won't.
> > >
> > > Yes, it is a maven project, now I checked and I see that there are
> Tomcat
> > > jar-s in it:
> > >
> > > tomcat-annotations-api-8.5.23.jar  tomcat-embed-core-8.5.23.jar
> > >   tomcat-embed-el-8.5.23.jar  tomcat-embed-websocket-8.5.23.jar
> > > tomcat-jdbc-8.5.23.jar tomcat-juli-8.5.23.jar
> > >
> > > Maybe the problem is that Spring Boot application contains embed Tomcat
> > > jars? This is very interesting that this extra Sentry jar in classpath
> > > cause this problem.
> >
> > Wait... you are using Spring Boot and you are also using setenv.sh?
> >
> > I'm very confused.
> >
> > I wouldn't expect Sentry and its dependencies to cause a problem.
> >
> > -chris
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >
>

Reply via email to