Disable Tomcat JAAS? - java

I have an active/passive nodes with Tomcat using heartbeat. When I shutdown the active node, Tomcat on passive node starts. This is a piece of the starting trace:
INFO: Initializing Coyote HTTP/1.1 on http-8080 May 22, 2014
7:37:43 PM org.apache.catalina.startup.Catalina load INFO:
Initialization processed in 366 ms May 22, 2014 7:37:43 PM
org.apache.catalina.realm.JAASRealm setContainer INFO: Set JAAS
app name VentusProxy May 22, 2014 7:37:59 PM
org.apache.catalina.mbeans.JmxRemoteLifecycleListener createServer
It takes 15 seconds to initialize JAAS, that means 15 seconds more without service.
I don't use JAAS at all in my application, so I'd like to disable it or, at least, try to reduce this 15 seconds.
Can anybody tell me if this is possible and how?

Related

High Thread Counts - JVM becoming unresponsive - Tomcat 8.5.13

We face intermittent High Thread Counts followed by JVM's slowdown and during the same timeframe, we could find the below mentioned exceptions. Please suggest if these are SYMPTOMS or CAUSES and help understand the remediation steps.
Mar 23, 2022 2:44:13 PM org.apache.catalina.connector.CoyoteAdapter checkRecycled
INFO: Encountered a non-recycled response and recycled it forcedly.
org.apache.catalina.connector.CoyoteAdapter$RecycleRequiredException
Mar 23, 2022 2:57:56 PM org.apache.coyote.AbstractProtocol$ConnectionHandler process
SEVERE: Error reading request, ignored
java.lang.NullPointerException: Inflater has been closed

Initial EJB RMI works but with exception

I'm working through an EJB tutorial where my client program invokes a method via remote stateless EJB to add a book. Upon exit the client retrieves and prints all the books from the EJB (I know it's not a good idea to store data in a list within a stateless EJB). All of this works fine, except the initial RMI also returns the following exception (I've included the full output from the client test as well).
Client output:
Nov 29, 2016 11:34:29 PM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 2.1.4.Final
**********************
Welcome to Book Store
**********************
Options
1. Add Book
2. Exit
Enter Choice: 1
Enter book name: Some book
Nov 29, 2016 11:34:44 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.4.0.Final
Nov 29, 2016 11:34:44 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.4.0.Final
Nov 29, 2016 11:34:44 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 4.0.21.Final
Nov 29, 2016 11:34:45 PM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: EJBCLIENT000017: Received server version 2 and marshalling strategies [river]
Nov 29, 2016 11:34:45 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext#4f7d0008, receiver=Remoting connection EJB receiver [connection=org.jboss.ejb.client.remoting.ConnectionPool$PooledConnection#271053e1,channel=jboss.ejb,nodename=slave01:server01]} on channel Channel ID 87a6ebda (outbound) of Remoting connection 64bfbc86 to /127.0.0.1:8133 of endpoint "client-endpoint" <64bf3bbf>
Nov 29, 2016 11:34:45 PM org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager getEJBReceiver
INFO: Could not create a connection for cluster node ClusterNode{clusterName='ejb', nodeName='slave01:server01', clientMappings=[ClientMapping{sourceNetworkAddress=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='0.0.0.0', destinationPort=8080}], resolvedDestination=[Destination address=0.0.0.0, destination port=8080]} in cluster ejb
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.xnio.nio.WorkerThread$ConnectHandle.handleReady(WorkerThread.java:321)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:567)
at ...asynchronous invocation...(Unknown Source)
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:294)
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:430)
at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:153)
at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:133)
at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:78)
at org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51)
at org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager.getEJBReceiver(RemotingConnectionClusterNodeManager.java:79)
at org.jboss.ejb.client.ClusterContext$EJBReceiverAssociationTask.call(ClusterContext.java:469)
at org.jboss.ejb.client.ClusterContext$EJBReceiverAssociationTask.call(ClusterContext.java:443)
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)
**********************
Welcome to Book Store
**********************
Options
1. Add Book
2. Exit
Enter Choice: 2
Book(s) entered so far: 2
1. test1
2. Some book
***Using second lookup to get library stateless object***
Book(s) entered so far: 2
1. test1
2. Some book
So everything with the client, other than the exception, appears to work correctly. I suspect this issue has something to do with the zero'd out node addresses, but I'm not certain. The client properties file is below (in case that configuration is incorrect).
jboss-ejb-clients.properties:
endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
invocation.timeout=3000
reconnect.tasks.timeout=2000
# User Credentials
username=user
password=pass
# Remote Connections
remote.connections=h1,h2
remote.connection.h1.host=127.0.0.1
remote.connection.h1.port=8133
remote.connection.h1.username=user
remote.connection.h1.password=pass
remote.connection.h2.host=127.0.0.1
remote.connection.h2.port=8134
remote.connection.h2.username=user
remote.connection.h2.password=pass
# Cluster
remote.clusters=ejb
remote.cluster.ejb.connect.timeout=2500
remote.cluster.ejb.max-allowed-connected-nodes=2
remote.cluster.ejb.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.cluster.ejb.connect.options.org.xnio.Options.SSL_ENABLED=false
remote.cluster.ejb.username=user
remote.cluster.ejb.password=pass
After extensive research (and a good amount of trial and error with test code), I found a book on Safari (Java EE 7 Development with WildFly) that lead me in the right direction. I had to drop the jboss-ejb-clients.properties file and add the ejb-client configuration found in the answer here to my main client class.

Starting tomcat server with error [duplicate]

This question already has answers here:
To prevent a memory leak, the JDBC Driver has been forcibly unregistered
(14 answers)
Closed 8 years ago.
when i starting tomcat server
I got this error
INFO: Server startup in 1751 ms
20 mai 2014 10:42:47 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
GRAVE: The web application [/servlet] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
20 mai 2014 10:42:47 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [/servlet] appears to have started a thread named [Thread-4] but has failed to stop it. This is very likely to create a memory leak.
20 mai 2014 10:42:47 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [/servlet] appears to have started a thread named [CronTriggers_Worker-1] but has failed to stop it. This is very likely to create a memory leak.
20 mai 2014 10:42:47 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [/servlet] appears to have started a thread named [CronTriggers_Worker-2] but has failed to stop it. This is very likely to create a memory leak.
can you help me please
Check whether you have created any static connection objects. Static object tend to live in the server heap even when the application is stopped.

Struts2 Tutorials giving 404 on .action pages

I seem to be having the same problem that everyone has with Struts2 and getting it up and running, driving me mad :#
Having manually written the files from the Hello_World_Struts2_Ant project and run into build path issues, I decided I should just download the project to see it up and running.....
For some reason the only page I can access from this project is index.jsp, when i try to click on the link for hello.action or visit hello.action through the address bar, it gives me a tomcat 404. (I am running tomcat 7).
I would usually concede that it is my own idiocy that has led me here, but the fact that the project download from the struts site isn't working is just plain annoying.....
I'm not great with tomcat error logs, but I can't see anything that can help me with this issue.
Any help would be greatly appreciated.
To save me loading this page with all code that I have, I've got the code that is distributed here: http://code.google.com/p/struts2-examples/downloads/detail?name=Hello_World_Struts_2_Ant_2_3_1_2.zip&can=2&q=
Catalina Log
=====================================
INFO: Server startup in 3099 ms
08-Aug-2012 22:28:39 org.apache.jasper.compiler.TldLocationsCache tldScanJar
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them.
Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
08-Aug-2012 22:28:46 org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
08-Aug-2012 22:28:46 org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
08-Aug-2012 22:28:46 org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
08-Aug-2012 22:28:46 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/Hello_World_Struts2_Ant] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#39bde3d2]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#61b80d9b]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
08-Aug-2012 22:28:46 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/Hello_World_Struts2_Ant] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#39bde3d2]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#7a856d3b]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
08-Aug-2012 22:28:46 org.apache.coyote.AbstractProtocol stop
stderr Log (INFOS Removed)
================================
08-Aug-2012 22:28:46 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/Hello_World_Struts2_Ant] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#39bde3d2]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#61b80d9b]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
08-Aug-2012 22:28:46 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/Hello_World_Struts2_Ant] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#39bde3d2]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#7a856d3b]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
08-Aug-2012 22:28:46 org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
08-Aug-2012 22:28:46 org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
After a reading the above posts I deleted my Tomcat installation and started again from scratch that way, it seemed that Tomcat had been the problem as it worked straight away for me after reinstalling tomcat.
It had perhaps been me deploying things as root.war that caused the tomcat issue.
The "same problem" thing was that I had done a bit of search before posting this and found a lot of folk having issues with getting struts up and running, perhaps a poor phrase to describe the issue on my part.
Thanks for the help though! Defainately going to look into Maven as a lot of folk seem to recommend it, although the copying to WEB-INF/lib and configuring build path works for now :)

Tomcat Memory Leak Using Struts2 xwork

SEVERE: The web application [/ppAdmin] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#126212dd]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#64c47498]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Mar 22, 2012 12:43:00 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/ppAdmin] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#1dc2dad7]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#63ad6884]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Mar 22, 2012 12:43:00 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/ppAdmin] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#1dc2dad7]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#da8e53c]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Mar 22, 2012 12:43:01 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/Nemo] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Mar 22, 2012 12:43:01 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/Nemo] registered the JDBC driver [net.sourceforge.jtds.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Mar 22, 2012 12:43:01 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/Nemo] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
Mar 22, 2012 12:43:01 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/Nemo] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#28318d]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#4ecd200f]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Mar 22, 2012 12:43:01 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/Nemo] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#7cf3e133]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#6f461b5b]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Mar 22, 2012 12:43:01 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/Nemo] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#28318d]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#63ae2c6f]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Mar 22, 2012 12:43:01 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/Nemo] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#28318d]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#3fe75e89]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Mar 22, 2012 12:43:01 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/Nemo] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#28318d]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#6eef9525]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Mar 22, 2012 12:43:01 PM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
WHY THE MEMORY LEAK WARNINGS ARE THERE???TOMCAT 6.0.35 ALLOWS GC TOOL.STILL IT GIVES SUCH WARNINGS.I AM BOTHERED ABOUT THESE WARNINGS.PLEASE HELP ME HOW TO MANAGE WITH THESE?
ANY HELP WILL BE HIGHLY APPRECIATED..................THANKS IN ADVANCE.
I had the same problem with Tomcat 6 and Struts2 2.1.8 webapp (maven 3.0.3 + eclipse keepler + JDK 1.6.0_22). I'm new in struts2+tomcat developing and I'm not used to solve this kind of problems.
After having made some changes on my code (and don't use svn nor git...), and after start using a mvn tomcat:redeploy task (witch confused me) I had this same behavior, and don't know what were causing to fail the deployment (the project keeps compiling ok).
The error seems so confusing and zero descriptive to me, and I've read many related posts. I've tryed to update the struts2 version, cause I've read that this kind of problems seems solved in struts2 2.3.3 (was using 2.1.8).
https://issues.apache.org/jira/browse/WW-3768
I dont't know why I was just reading catalina log:
SEVERE: Error filterStart
12/02/2014 10:46:23 org.apache.catalina.core.StandardContext start
SEVERE: Context [/validador] startup failed due to previous errors
The answer was very close, in localhost-date.log!
That point me to a bad declared action in struts.xml, so simple to solve and so descriptive, but so dificult to figure out just reading catalina log.
SEVERE: Exception starting filter struts2
Unable to load configuration. - action - file:/C:/apps/apache-tomcat- 6.0.39/webapps/validador/WEB-INF/classes/struts.xml:74:83
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:501)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
...
...
Caused by: Action class [aoc.action.signature.CompletePDFUpload] not found - action - file:/C:/apps/apache-tomcat-6.0.39/webapps/validador/WEB-INF/classes/struts.xml:74:83
I hope someone else missed to check the correct log and solve as easy as me their problem.

Categories

Resources