problem with Tomcat 9 and Spring org.apache.catalina.LifecycleException - java

I have installed tomcat 9 again, also the java jdk but I still cannot solve the problem, I'm desperate, I don't know why, I must have something wrong in the classpath
mar 29, 2021 11:09:19 AM org.apache.catalina.startup.Catalina load
Server initialization in [462] milliseconds
GRAVE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start
component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/solution-code-spring-mvc-
adding-data-to-the-spring-model]]
Caused by: org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/solution-code-spring-mvc-adding-
data-to-the-spring-model]]
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.WebApplicationContext
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1364)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1187)
... 40 more
here is the project
https://github.com/darbyluv2code/spring-and-hibernate-for-beginners/tree/master/02-spring-mvc-5/solution-code-spring-mvc-adding-data-to-the-spring-model
i've downloaded these jar files
https://repo.spring.io/release/org/springframework/spring/5.0.3.RELEASE/

Related

Failed to initialize end point associated with ProtocolHandler ["ajp-nio-8009"]

Can someone help me?
GRAVE: Failed to initialize end point associated with ProtocolHandler ["ajp-nio-8009"]
java.lang.IllegalArgumentException: timeout < 0
at java.base/sun.nio.ch.ServerSocketAdaptor.setSoTimeout(ServerSocketAdaptor.java:162)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:352)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:823)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:476)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:960)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:568)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:871)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.startup.Catalina.load(Catalina.java:592)
at org.apache.catalina.startup.Catalina.load(Catalina.java:615)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:308)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:482)
fev. 04, 2023 9:26:28 PM org.apache.catalina.core.StandardService initInternal
GRAVE: Failed to initialize connector [Connector[AJP/1.3-8009]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[AJP/1.3-8009]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:568)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:871)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.startup.Catalina.load(Catalina.java:592)
at org.apache.catalina.startup.Catalina.load(Catalina.java:615)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:308)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:482)
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
at org.apache.catalina.connector.Connector.initInternal(Connector.java:962)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 10 more
Caused by: java.lang.IllegalArgumentException: timeout < 0
at java.base/sun.nio.ch.ServerSocketAdaptor.setSoTimeout(ServerSocketAdaptor.java:162)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:352)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:823)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:476)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:960)
... 11 more
I have no idea what it could be, can someone help me?
You are probably hitting this Tomcat bug: https://bz.apache.org/bugzilla/show_bug.cgi?id=63814
Socket timeout -1 no longer allowed since Java 13, leading to IllegalArgumentException and unit test hang for TestAbstractAjpProcessor
From the Tomcat 7 changelog, it was fixed in version 7.0.98.
63814: Do not set server socket timeout with negative values in NIO. (remm)
Since Java 13, setSoTimeout()'s behaviour was changed to explicitly throw an exception when a socket timeout was set to negative.
My guess is that you are running a very old version of Tomcat (< 7.0.98) with a newer version of Java (>= 13). Either upgrade Tomcat to a more recent version or downgrade your JDK to 12 or older.
If you need to use the particular versions you are using now, you could try explicitly setting the socket timeout configuration option to a positive value on the connector in Tomcat configuration file conf/server.xml.

Tomcat War Deployment Error with Logback in Spring Boot

I've set up logback with Spring Boot.
When I use 'mvn package', it creates the log files at the designated location specified in logback-spring.xml
Yet when I deploy the war onto Tomcat manager, I get the following error in the tomcat log files.
02-Jan-2023 19:36:45.008 INFO [http-nio-8080-exec-100] org.apache.catalina.core.ApplicationContext.log HTMLManager: start: Starting web application '/springapp'
02-Jan-2023 19:36:47.131 SEVERE [http-nio-8080-exec-100] org.apache.catalina.core.ApplicationContext.log HTMLManager: Error starting [/springapp]
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springapp]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
...
...
...
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE-ROLLING] - openFile(springapp.log,true) call failed. java.io.FileNotFoundException: springapp.log (Permission denied)
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:344)
...
...
...
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5211)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 35 more
Caused by: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE-ROLLING] - openFile(springapp.log,true) call failed. java.io.FileNotFoundException: springapp.log (Permission denied)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:80)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132)
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:329)
... 56 more
02-Jan-2023 19:36:47.131 INFO [http-nio-8080-exec-100] org.apache.catalina.core.ApplicationContext.log HTMLManager: list: Listing contexts for virtual host 'localhost
Tomcat is installed at /opt/tomcat/apache-tomcat-version/
My log file destination is /opt/tomcat/applogs/ with permissions
drwxr-xr-x 9 tomcat tomcat 4096 Dec 8 14:02 apache-tomcat-9.0.70
drwxrwxrwx 2 tomcat tomcat 4096 Jan 2 19:35 applogs
I've tried changing user:groups to {whoami}:{whoami}, root:root, among others, but tomcat manager won't start the war deployment
FAIL - Application at context path [/springapp] could not be started
FAIL - Encountered exception [org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springapp]]]
I know the logs created already are from spring boot and have nothing to do with tomcat, and I also know that tomcat requires a dedicated user for security purposes, but I'm at a loss on what to do at this point.
The log directory you specified has insufficient permission, and the application has no write permission。
you can use chmod 777 dir give that directory full access,Or specify a directory with access permission in the configuration file

Trying to run the RSA SDK under Tomcat 8

Java newbie here.
Working on a some java App that uses the RSA SDK 8.2. All applications work fine when run as a console application. We're need to put a Web front end on it but we error out as shows below.
We've tried running it on both Wildfly 10 and Tomcat 8.0. Using Java 1.8
Below is error received when running on Tomcat. The error of NoSuchMethodException below from org.glassfish.tyrus.server.TyrusServerConfiguration.()
This exists in one of the Jars provided in the SDK. If we remove the jar Tomcat will serve up the page but will fail when a call to the SDK is made. If we include the jar, we get the error below.
SEVERE: Error during ServletContainerInitializer processing<br>
javax.servlet.ServletException: java.lang.InstantiationException: org.glassfish.tyrus.server.TyrusServerConfiguration<br>
at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:88)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.InstantiationException: org.glassfish.tyrus.server.TyrusServerConfiguration
at java.lang.Class.newInstance(Class.java:427)
at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:74)
... 8 more
Caused by: java.lang.NoSuchMethodException: org.glassfish.tyrus.server.TyrusServerConfiguration.<init>()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.newInstance(Class.java:412)
... 9 more
Sep 26, 2017 3:00:39 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/tomcattest3] startup failed due to previous errors
I was able to duplicate this problem using Tomcat 9. I added websocket-ri-bundle-1.1.jar to Tomcat's lib without realizing that it already contained websocket-api-jar. When I removed the ri bundle I no longer got the error.

Neo4j Server Startup Exception

Iam unable to start the neo4j server..iam using java 1.7 and neo4j 2.0.0 when i run the sample java with maven example, iam getting this problem. Here is the log file
Oct 09, 2013 8:49:14 AM org.neo4j.server.logging.Logger log
INFO: Setting startup timeout to: 120000ms based on -1
Oct 09, 2013 8:49:15 AM org.neo4j.server.logging.Logger log
SEVERE:
org.neo4j.server.ServerStartupException: Starting Neo4j Server failed: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.transaction.XaDataSourceManager#ce8273' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:211)
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:86)
at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:49)
Caused by: java.lang.RuntimeException: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.transaction.XaDataSourceManager#ce8273' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:280)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:106)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:88)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:207)
at org.neo4j.kernel.impl.recovery.StoreRecoverer.recover(StoreRecoverer.java:114)
at org.neo4j.server.preflight.PerformRecoveryIfNecessary.run(PerformRecoveryIfNecessary.java:59)
at org.neo4j.server.preflight.PreFlightTasks.run(PreFlightTasks.java:70)
at org.neo4j.server.AbstractNeoServer.runPreflightTasks(AbstractNeoServer.java:276)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:162)
... 2 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.transaction.XaDataSourceManager#ce8273' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:497)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:104)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:258)
... 10 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource#1f5329f' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:497)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:104)
at org.neo4j.kernel.impl.transaction.XaDataSourceManager.start(XaDataSourceManager.java:128)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:491)
... 12 more
Caused by: org.neo4j.kernel.impl.storemigration.UpgradeNotAllowedByConfigurationException: Failed to start Neo4j with an older data store version. To enable automatic upgrade, please set configuration parameter "allow_store_upgrade=true"
at org.neo4j.kernel.impl.storemigration.ConfigMapUpgradeConfiguration.checkConfigurationAllowsAutomaticUpgrade(ConfigMapUpgradeConfiguration.java:39)
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.attemptUpgrade(StoreUpgrader.java:66)
at org.neo4j.kernel.impl.nioneo.store.StoreFactory.tryToUpgradeStores(StoreFactory.java:113)
at org.neo4j.kernel.impl.nioneo.store.StoreFactory.newNeoStore(StoreFactory.java:96)
at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.start(NeoStoreXaDataSource.java:240)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:491)
... 15 more
Oct 09, 2013 8:49:15 AM org.neo4j.server.logging.Logger log
SEVERE: Failed to start Neo Server on port [7474]
How to clear this?
According to the documentation,
set the Neo4j configuration parameter "allow_store_upgrade=true" in your neo4j.properties or embedded configuration
Hope that helps.
In general with Neo4j, a database can be upgraded from a minor version to the next, e.g. 1.7 → 1.8, and 1.8 → 1.9, but you can not jump directly from 1.7 → 2.0.
You have two options:
upgrade to each minor version in succession setting the Neo4j configuration parameter "allow_store_upgrade=true" as in #Vidya's answer, or
re-import your data into the new 2.0 version of Neo4j.

Need help in error in Neo4j

I am getting this error while clicking on the neo4j.bat file in Windows. I tried other answers on stackoverflow but none of them is working. I set all variables in path JAVA_HOME & JRE_HOME. It says database incorrectly shutdown, performing recovery. And then console goes off. I have installed jdk 1.7 & jre7.
Sep 15, 2013 11:52:57 PM org.neo4j.server.logging.Logger log
INFO: Setting startup timeout to: 120000ms based on -1
Sep 15, 2013 11:52:58 PM org.neo4j.server.logging.Logger log
SEVERE:
java.lang.RuntimeException: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter#3e890800' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:280)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:106)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:88)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:207)
at org.neo4j.kernel.impl.recovery.StoreRecoverer.recover(StoreRecoverer.java:114)
at org.neo4j.server.preflight.PerformRecoveryIfNecessary.run(PerformRecoveryIfNecessary.java:59)
at org.neo4j.server.preflight.PreFlightTasks.run(PreFlightTasks.java:70)
at org.neo4j.server.AbstractNeoServer.runPreflightTasks(AbstractNeoServer.java:280)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:160)
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:86)
at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:49)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter#3e890800' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:497)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:104)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:258)
... 10 more
Caused by: org.neo4j.kernel.StoreLockException: Could not create lock file
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:74)
at org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:40)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:491)
... 12 more
Sep 15, 2013 11:52:58 PM org.neo4j.server.logging.Logger log
SEVERE: Failed to start Neo Server on port [7474]
Most likely, you have an instance already running. Kill any Java processes and try again.

Categories

Resources