Unexpected Tomcat Shutdown - windows

Tomcat: 6.0.20.0
OS: Windows Server2003
Architecture: x86
JVM: 1.5.0_19
We have a Tomcat instance that looks to be shutting down unexpectedly. The logs look like the following:
[DATE] org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
[DATE] org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
[DATE] org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
There are no exceptions such as out of memory in the logs. It looks like a clean graceful shutdown. The code in our app has been checked for System.exit(). Also nothing should be sending SHUTDOWN to port 8005.
We have a service wrapper in c# that calls a .bat with start/stop commands which in turn call catalina.bat. The service still shows Tomcat as running whenever Tomcat shuts down unexpectedly. The App logs do not log the service shutdown when it's unexpected but logs shutdowns manually done through the service in Windows.
Tomcat Manager is not configured.

Related

how to debug TC pivotal server

I have a SPRING WEB project which I imported from nearly the same environnement and it was working perfectly. When I imported it to the current PC it didn't work.
this is what the pivotal server says :
févr. 28, 2017 10:56:07 AM org.apache.catalina.startup.Catalina load
INFOS: Initialization processed in 8010 ms
févr. 28, 2017 10:56:09 AM org.apache.catalina.startup.Catalina start
INFOS: Server startup in 2389 ms
there's no log other than that.
this is the catalina log file
and when I start the server I get this page : The requested resource is not available.
How can I debug this ?
Or how do I activate the debugging of the server ?
Any help will be appreciated.Thank you.
What steps I need to do to identify the problem ?

glassfish-4 start failed after upgrade Mac OS Sierra

I already upgraded to MacOS Sierra and my Netbeans 8.0.2 throw an error when I try to run Glassfish.
Please check server admin user name and password properties.
Also please check the server log file for other possible causes.
I tried all posibles solutions that I found in stackoverflow but nothing worked.
Glassfish 4 Admin not running from Netbeans 7.4 (Password Incorrect)
This is the log of Glassfish
objc[35340]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/bin/java (0x1000a54c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x1001b84e0). One of the two will be used. Which one is undefined.
Listening for transport dt_socket at address: 9009
Launching GlassFish on Felix platform
Nov 02, 2016 11:28:52 AM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner createBundleProvisioner
INFO: Create bundle provisioner class = class com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.
Nov 02, 2016 11:28:53 AM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner$DefaultCustomizer getLocations
WARNING: Skipping entry because it is not an absolute URI.
Nov 02, 2016 11:28:53 AM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner$DefaultCustomizer getLocations
WARNING: Skipping entry because it is not an absolute URI.
Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishRuntime#c76ff05 in service registry.
Found populator: com.sun.enterprise.v3.server.GFDomainXml
#!## LogManagerService.postConstruct : rootFolder=/Applications/NetBeans/glassfish-4.1/glassfish
#!## LogManagerService.postConstruct : templateDir=/Applications/NetBeans/glassfish-4.1/glassfish/lib/templates
#!## LogManagerService.postConstruct : src=/Applications/NetBeans/glassfish-4.1/glassfish/lib/templates/logging.properties
#!## LogManagerService.postConstruct : dest=/Applications/NetBeans/glassfish-4.1/glassfish/domains/domain4/config/logging.properties
Info: Running GlassFish Version: GlassFish Server Open Source Edition 4.1 (build 13)
Info: Server log file is using Formatter class: com.sun.enterprise.server.logging.ODLLogFormatter
Info: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
Info: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
Info: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
Info: Authorization Service has successfully initialized.
Info: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
Info: Grizzly Framework 2.3.15 started in: 58ms - bound to [/0.0.0.0:9090]
Info: Grizzly Framework 2.3.15 started in: 12ms - bound to [/0.0.0.0:9191]
Info: Grizzly Framework 2.3.15 started in: 2ms - bound to [/0.0.0.0:4848]
Info: Grizzly Framework 2.3.15 started in: 1ms - bound to [/0.0.0.0:3700]
Info: GlassFish Server Open Source Edition 4.1 (13) startup time : Felix (37,175ms), startup services(1,405ms), total(38,580ms)
Info: Creating a SecureRMIServerSocketFactory # 0.0.0.0 with ssl config = GlassFishConfigBean.org.glassfish.grizzly.config.dom.Ssl
Info: SSLParams =org.glassfish.admin.mbeanserver.ssl.SSLParams#5baca86
Warning: All SSL cipher suites disabled for network-listener(s). Using SSL implementation specific defaults
Info: SSLParams =org.glassfish.admin.mbeanserver.ssl.SSLParams#5baca86
Warning: All SSL cipher suites disabled for network-listener(s). Using SSL implementation specific defaults
Info: Grizzly Framework 2.3.15 started in: 11ms - bound to [/0.0.0.0:7676]
Info: Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl#3baf6936 as OSGi service registration: org.apache.felix.framework.ServiceRegistrationImpl#4acb2510.
Info: visiting unvisited references
Info: Created HTTP listener http-listener-1 on host/port 0.0.0.0:9090
Info: Created HTTP listener http-listener-2 on host/port 0.0.0.0:9191
Info: Created HTTP listener admin-listener on host/port 0.0.0.0:4848
Info: Created virtual server server
Info: Created virtual server __asadmin
Info: Setting JAAS app name glassfish-web
Info: Virtual server server loaded default web module
Info: Java security manager is disabled.
Info: Entering Security Startup Service.
Info: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
Info: Security Service(s) started successfully.
Info: visiting unvisited references
Info: visiting unvisited references
Info: visiting unvisited references
Info: Initializing Mojarra 2.2.7 ( 20140610-1547 https://svn.java.net/svn/mojarra~svn/tags/2.2.7#13362) for context ''
Info: HV000001: Hibernate Validator 5.0.0.Final
Info: SSLServerSocket /0.0.0.0:8686 and [SSL: ServerSocket[addr=/0.0.0.0,localport=8686]] created
Info: Loading application [__admingui] at [/]
Info: Loading application __admingui done in 15,743 ms
Info: JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://10.57.116.239:8686/jndi/rmi://10.57.116.239:8686/jmxrmi
I don't know what else to do.
Please help me with this problem.
you can set system java version,and this can do by jenv;please reference
http://boxingp.github.io/blog/2015/01/25/manage-multiple-versions-of-java-on-os-x/

TeamCIty Server on EC2 Linux instance dies before it's done starting up

I'm installing TeamCity in EC2, starting with the Server then moving on the agents. I'm starting with the Amazon Linux AMI, running on a micro instance. Then I did:
sudo yum update
wget http://download.jetbrains.com/teamcity/TeamCity-7.1.1.tar.gz
tar -xvzf TeamCity-7.1.1.tar.gz
cd TeamCity
bin/teamcity-server.sh start
When I start it using bin/teamcity-server.sh start, things happen. I can connect using a web browser which shows the 'TeamCity is starting' page. The teamcity-server.log shows a bunch of activity, unzipping plugins etc.
But then suddently, the server process just disappears. The port's no longer listened to, ps shows no java process running, and the browser can't connect.
There's no error messages in the catalina or teamcity logs. After much trial and error though, I ran bin/teamcity-server.sh run (instead of start) to get console output, and got the following:
Using CATALINA_BASE: /home/ec2-user/TeamCity
Using CATALINA_HOME: /home/ec2-user/TeamCity
Using CATALINA_TMPDIR: /home/ec2-user/TeamCity/temp
Using JRE_HOME: /usr/lib/jvm/jre
Using CLASSPATH: /home/ec2-user/TeamCity/bin/bootstrap.jar:/home/ec2-user/TeamCity/bin/tomcat-juli.jar
Nov 1, 2012 7:22:25 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Nov 1, 2012 7:22:26 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8111"]
Nov 1, 2012 7:22:26 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2742 ms
Nov 1, 2012 7:22:26 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Nov 1, 2012 7:22:26 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.23
Nov 1, 2012 7:22:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/ec2-user/TeamCity/webapps/ROOT
Log4J configuration file /home/ec2-user/TeamCity/bin/../conf/teamcity-server-log4j.xml will be monitored with interval 10 seconds.
Nov 1, 2012 7:22:30 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8111"]
Nov 1, 2012 7:22:30 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3786 ms
=======================================================================
TeamCity 7.1.1 (build 24074) initialized, OS: Linux, JRE: 1.6.0_24-b24
TeamCity is running in professional mode
bin/teamcity-server.sh: line 18: 4231 Killed ./catalina.sh $1
I promise that I did not kill the process! I can find my way around in Linux well enough, but I'm not at all sure where to go next to find out why or what killed the process. Can anyone help?
After some further scanning of .sh files to see how TeamCity was starting itself up, I noticed that it was grabbing a fair amount of memory for it's java process (either 512m or 750m depending on which line you use).
The EC2 micro instance only has 613m of RAM total. When I realized this, I tried the whole process again with a larger instance, and things worked fine.
I'm still curious if there's a better way I could've known what was causing catalina to die, so if anyone wants to answer with that information...

Unable to start Apache Tomcat server while start up

When I try to start Apache tomcat 7.0.26 server is not starting. This is first time.
console message as follows :
Mar 7, 2012 12:06:18 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 470 ms
It has been started and the starting process took 470 ms.
That's what the message says.
I have the suspicion that you didn't even bother to check the url of web management to see if Tomcat is up or not.

How to set level logging to DEBUG in Tomcat?

I would like to set level logging to DEBUG in tomcat but in console nevertheless only INFO and WARN output.
Could anybody tell me what's wrong?
My C:\tomcat\logging.properties:
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional DEBUGrmation regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
############################################################
# Handler specific properties.
# Describes specific configuration DEBUG for Handlers.
############################################################
1catalina.org.apache.juli.FileHandler.level = DEBUG
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.
2localhost.org.apache.juli.FileHandler.level = DEBUG
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.
3manager.org.apache.juli.FileHandler.level = DEBUG
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.FileHandler.prefix = manager.
4host-manager.org.apache.juli.FileHandler.level = DEBUG
4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
4host-manager.org.apache.juli.FileHandler.prefix = host-manager.
java.util.logging.ConsoleHandler.level = DEBUG
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = DEBUG
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = DEBUG
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = DEBUG
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.FileHandler
# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
#org.apache.catalina.startup.ContextConfig.level = DEBUG
#org.apache.catalina.startup.HostConfig.level = DEBUG
#org.apache.catalina.session.ManagerBase.level = DEBUG
#org.apache.catalina.core.AprLifecycleListener.level=DEBUG
Example of my log:
INFO: Deploying configuration descriptor manager.xml
08.11.2010 1:06:42 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive spring-mvc-trial.war
08.11.2010 1:06:46 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
08.11.2010 1:06:46 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
08.11.2010 1:06:46 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
08.11.2010 1:06:46 org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
08.11.2010 1:06:46 org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009
08.11.2010 1:06:46 org.apache.catalina.startup.Catalina start
INFO: Server startup in 3777 ms
08.11.2010 1:09:36 org.apache.coyote.http11.Http11AprProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
08.11.2010 1:09:36 org.apache.coyote.ajp.AjpAprProtocol pause
INFO: Pausing Coyote AJP/1.3 on ajp-8009
08.11.2010 1:09:37 org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
08.11.2010 1:09:37 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/spring-mvc-trial] registered the JBDC 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.
08.11.2010 1:09:37 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/spring-mvc-trial] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak.
08.11.2010 1:09:38 org.apache.coyote.http11.Http11AprProtocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
08.11.2010 1:09:38 org.apache.coyote.ajp.AjpAprProtocol destroy
INFO: Stopping Coyote AJP/1.3 on ajp-8009
Firstly, the level name to use is FINE, not DEBUG. Let's assume for a minute that DEBUG is actually valid, as it makes the following explanation make a bit more sense...
In the Handler specific properties section, you're setting the logging level for those handlers to DEBUG. This means the handlers will handle any log messages with the DEBUG level or higher. It doesn't necessarily mean any DEBUG messages are actually getting passed to the handlers.
In the Facility specific properties section, you're setting the logging level for a few explicitly-named loggers to DEBUG. For those loggers, anything at level DEBUG or above will get passed to the handlers.
The default logging level is INFO, and apart from the loggers mentioned in the Facility specific properties section, all loggers will have that level.
If you want to see all FINE messages, add this:
.level = FINE
However, this will generate a vast quantity of log messages. It's probably more useful to set the logging level for your code:
your.package.level = FINE
See the Tomcat 6/Tomcat 7 logging documentation for more information. The example logging.properties file shown there uses FINE instead of DEBUG:
...
1catalina.org.apache.juli.FileHandler.level = FINE
...
and also gives you examples of setting additional logging levels:
# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
#org.apache.catalina.startup.ContextConfig.level = FINE
#org.apache.catalina.startup.HostConfig.level = FINE
#org.apache.catalina.session.ManagerBase.level = FINE
JULI logging levels for Tomcat
SEVERE - Serious failures
WARNING - Potential problems
INFO - Informational messages
CONFIG - Static configuration messages
FINE - Trace messages
FINER - Detailed trace messages
FINEST - Highly detailed trace messages
You can find here more
https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/pasoe-admin/tomcat-logging.html
In addition to what has already been said (DEBUG -> FINE, FINER, FINEST in JULI), in case you're running Tomcat using an IDE, say Eclipse, note that it stores the configuration on a different path than CATALINA_HOME, so you may need to add
-Djava.util.logging.config.file="C:\apache-tomcat-9.0.31\conf\logging.properties"
to explicit set your logging properties.
More on this here: Where can I view Tomcat log files in Eclipse?

Resources