I use Jelastic platform from different providers: dogado.de (Jelastic version is 4.6.2) and mirhosting.com (Jelastic version is 4.6.1). I have some environments on both platforms. These environments have next configuration:
Java 8
Apache Tomcat 8.5.3
MySQL 5.7.10
The Tomcat prints next info to the log file:
Server version: Apache Tomcat/8.5.3
Server number: 8.5.3.0
OS Name: Linux
OS Version: 2.6.32-042stab113.21
Architecture: amd64
Java Home: /usr/java/jdk1.8.0_72/jre
JVM Version: 1.8.0_72-b15
JVM Vendor: Oracle Corporation
CATALINA_BASE: /opt/repo/versions/8.5.3
CATALINA_HOME: /opt/repo/versions/8.5.3
I'm trying to enable Jelastic GC agent. So I changed the conf/variables.conf file, so now it contains next lines:
-javaagent:/opt/repo/versions/8.5.3/lib/jelastic-gc-agent.jar=debug=true,period=60
It means that the debug mode should be enabled now and the agent must print every 60 seconds the info about memory releasing. For previous Tomcat version (7.0.39; on the same platform, but another environment) it looks like this:
Jul 14, 2016 6:08:30 PM com.jelastic.java.gc.JelasticGCAgent$1 run
INFO: JelasticGCAgent - Start Full GC : [free memory] : 181834896 bytes
Jul 14, 2016 6:08:30 PM com.jelastic.java.gc.JelasticGCAgent$1 run
INFO: JelasticGCAgent - Finish Full GC : [free memory] : 74885120 bytes
But it does not work for Tomcat 8: memory usage is not changing at all time, there are no any new messages in the log file. I asked supports of these providers how to fix this issue, but the issue still there. And even more it looks like a bug in Jelastic agent or in the whole platform.
Did anybody face with the same issue already? Any known ways to fix it? Maybe I need to use another jar files?
Any ideas are welcome and of course I want to ask Jelastic team about this problem.
It seems to be a problem with configuration file for variables parsing.
As a workaround:
log into your Tomcat node via SSH
navigate to /opt/repo/versions/8.5.3/bin/
edit variablesparser.sh file and change the third line from
CONFFILE='/opt/repo/versions/${Version}/conf/variables.conf'
to
CONFFILE="/opt/repo/versions/${Version}/conf/variables.conf"
restart Tomcat
Related
i am using digitalocean and trying to install and start tomcat on ubuntu but unfortunately i can not do it. (created new droplets and tried 10 times)
1GB Ram 30GB SSD Disk Amsterdam 2 Ubuntu 14.04 x64
When i start tomcat, it says "Tomcat started". But i can not access page from browser. and ./shutdown.sh returns error.
What can be the problem ?
I noticed something now. While i am writing this question, tomcat page is displayed. it took 28 minutes to display the page
catalina.out says: INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [1,718,769] milliseconds.
Here are my installation steps (These steps works on different vps but doesn't work on digitalocean droplets):
Install oracle jdk
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
sudo apt-get install oracle-java7-set-default
java -version
java version "1.7.0_72"
Java(TM) SE Runtime Environment (build 1.7.0_72-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode)
Set java path
sudo nano /etc/environment
JAVA_HOME="/usr/lib/jvm/java-7-oracle"
source /etc/environment
wget http://ftp.itu.edu.tr/Mirror/Apache/tomcat/tomcat-7/v7.0.56/bin/apache-tomcat-7.0.56.tar.gz
tar xvzf apache-tomcat-7.0.56.tar.gz
mv apache-tomcat-7.0.56/ apache-tomcat-7.0.56-server-1/
Start Tomcat
./startup.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-7.0.56-server-1
Using CATALINA_HOME: /usr/local/apache-tomcat-7.0.56-server-1
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0.56-server-1/temp
Using JRE_HOME: /usr/lib/jvm/java-7-oracle/jre
Using CLASSPATH: /usr/local/apache-tomcat-7.0.56-server-1/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.56-server-1/bin/tomcat-juli.jar
Tomcat started.
Checkout Port 8080
netstat -ln
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 :::8009 :::* LISTEN
tcp6 0 0 :::8080 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
Checkout process
ps -ef | grep tomcat
root 2825 1 1 14:23 pts/0 00:00:03 /usr/lib/jvm/java-7-oracle/jre/bin/java -Djava.util.logging.config.file=/usr/local/apache-tomcat-7.0.56-server-1/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/apache-tomcat-7.0.56-server-1/endorsed -classpath /usr/local/apache-tomcat-7.0.56-server-1/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.56-server-1/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/apache-tomcat-7.0.56-server-1 -Dcatalina.home=/usr/local/apache-tomcat-7.0.56-server-1 -Djava.io.tmpdir=/usr/local/apache-tomcat-7.0.56-server-1/temp org.apache.catalina.startup.Bootstrap start
Open web site at port 8080 http://5.101.107.56:8080/ Page is waiting... [content is displayed after 28 minute or more]
Try to shutdown tomcat if content is not displayed yet (before tomcat starts properly).
./shutdown.sh
SEVERE: Could not contact localhost:8005. Tomcat may not be running.
Oct 17, 2014 2:40:29 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSoc
Checkout logs
catalina.out
Oct 17, 2014 2:31:47 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Oct 17, 2014 2:31:47 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1492 ms
Oct 17, 2014 2:31:47 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Oct 17, 2014 2:31:47 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.56
Oct 17, 2014 2:31:47 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/local/apache-tomcat-7.0.56-server-1/webapps/host-manager
I also installed nginx and navigate to http://5.XXX.XXX.XX/ nginx welcome page is opened immediately
I checked catalina.out when i see the page in browser, it says:
Oct 17, 2014 2:31:47 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/local/apache-tomcat-7.0.56-server-1/webapps/host-manager
Oct 17, 2014 3:00:27 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took **[1,718,769] milliseconds.**
Memory:
total used free shared buffers cached
Mem: 1017912 849512 168400 332 18780 688468
Replacing securerandom.source=file:/dev/urandom with securerandom.source=file:/dev/./urandom in $JAVA_PATH/jre/lib/security/java.security has solved my problem.
Even when file:/dev/urandom is specified, JRE will still use /dev/random for SHA1PRNG (see bug JDK-4705093):
In SHA1PRNG, there is a SeedGenerator which does various things
depending on the configuration.
If java.security.egd or securerandom.source point to "file:/dev/random" or "file:/dev/urandom", we will use
NativeSeedGenerator, which calls super() which calls
SeedGenerator.URLSeedGenerator(/dev/random). (A nested class within
SeedGenerator.) The only things that changed in this bug was that
urandom will also trigger use of this code path.
If those properties point to another URL that exists, we'll initialize SeedGenerator.URLSeedGenerator(url). This is why
"file:///dev/urandom", "file:/./dev/random", etc. will work.
From Wikipedia on /dev/random:
In this implementation, the generator keeps an estimate of the number
of bits of noise in the entropy pool. From this entropy pool random
numbers are created. When read, the /dev/random device will only
return random bytes within the estimated number of bits of noise in
the entropy pool. /dev/random should be suitable for uses that need
very high quality randomness such as one-time pad or key generation.
When the entropy pool is empty, reads from /dev/random will block
until additional environmental noise is gathered. The intent is to
serve as a cryptographically secure pseudorandom number generator,
delivering output with entropy as large as possible. This is suggested
for use in generating cryptographic keys for high-value or long-term
protection.
Environmental noise?
The random number generator gathers environmental noise from device
drivers and other sources into an entropy pool. The generator also
keeps an estimate of the number of bits of noise in the entropy pool.
From this entropy pool random numbers are created.
That means in practice, it’s possible to block tomcat for an unknown amount of time.
This also works:
Actually, by setting the following in /etc/default/tomcat7, I was fine:
JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xmx1024m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC"
Comment from :
https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-7-on-ubuntu-14-04-via-apt-get
While using /dev/urandom as the source for entropy is a workaround that reduces the startup time for Tomcat, it is not a good idea because it can have unintended side effects.
Other components running in the Tomcat server (e.g. web applications) might depend on a securely initialized SecureRandom instance and there might be security issues when the entropy for the random numbers is not sufficient.
Actually, this is one of the reasons why using /dev/urandom does not work, but /dev/./urandom does. The SHA1PRNG heavily relies on a good seed. If the seed is not good, the random numbers are predictable. Therefore, the developer ensured that for this purpose /dev/random is used as the source of entropy, even if the JVM is configured to use /dev/urandom. There are two bug reports about this (bug 1, bug 2).
So instead of changing the entropy source to /dev/urandom, one should rather make sure that /dev/random has enough entropy. If the system has a hardware RNG, installing rng-tools should do the trick. Otherwise, installing haveged provides a very good source of entropy that does not rely on a special hardware RNG to be present. In a virtual machine, rng-tools can use entropy from the host through a virtual hardware RNG. As an alternative to this, EGD could be used, but at the moment this software is not included in the Ubuntu repositories, so that it is bothersome to use it.
After being killed once, selenium server hangs on all further startups without even trying to acquire the server port.
Rebooting fixes the problem. Running as a different user makes selenium start up again as well, but after that process gets killed it won't work no more.
This is on Linux 2.6.32-5-amd64 (debian squeeze) in a VirtualBox VM. Looking at a log of the system calls when it's working and when it's not, some component seems to lock up before the socket is even bound. The selenium log isn't of much help.
The output doesn't give any indication either:
$ java -jar selenium-server-standalone-2.28.0.jar
Dec 27, 2012 5:41:35 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
17:41:35.703 INFO - Java: Sun Microsystems Inc. 14.0-b16
17:41:35.704 INFO - OS: Linux 2.6.32-5-amd64 amd64
17:41:35.737 INFO - v2.28.0, with Core v2.28.0. Built from revision 18309
17:41:35.867 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
17:41:35.868 INFO - Version Jetty/5.1.x
17:41:35.868 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
17:41:35.869 INFO - Started HttpContext[/selenium-server,/selenium-server]
17:41:35.869 INFO - Started HttpContext[/,/]
This is a Java problem; its RNG needlessly reads from /dev/random. On a VM, the random pool is limited and often exhausted after one or two runs. For some reason, a part of the selenium/Jetty startup asks for the problematic RNG. To fix the problem, advise Java to use /dev/urandom instead:
java -Djava.security.egd=file:/dev/./urandom \
-jar selenium-server-standalone-2.28.0.jar
works fine.
suddenly for some reason tomcat server is not runnin/starting/stopping.
below is the result I get when i run the startup command,
C:\Program Files\jasperserver-3.5.0\apache-tomcat\bin>startup
Using CATALINA_BASE: C:\Program Files\jasperserver-3.5.0\apache-tomcat
Using CATALINA_HOME: C:\Program Files\jasperserver-3.5.0\apache-tomcat
Using CATALINA_TMPDIR: C:\Program Files\jasperserver-3.5.0\apache-tomcat\temp
Using JRE_HOME: C:\PROGRA~1\JASPER~1.0\java\jre
The tomcat window pops up for a split of a second and goes away.
(I have another java instance installed under c:\program files)
Help!!!
Update:
Logs from catalina file
Mar 22, 2011 3:41:50 AM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 22, 2011 3:41:50 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1017 ms
Mar 22, 2011 3:41:51 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 22, 2011 3:41:51 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.20
Mar 22, 2011 3:41:51 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Mar 22, 2011 3:42:06 AM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 22, 2011 3:42:06 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 22, 2011 3:42:06 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/43 config=null
Mar 22, 2011 3:42:06 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Mar 22, 2011 3:42:06 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 15374 ms
Use catalina.bat run instead of startup.bat. Then the window won't go away and you can see what's going on
In my case that was a problem with final slash in %CATALINA_HOME% path: final slash should not be there!
C:\tomcat\8.0.30 - correct
C:\tomcat\8.0.30\ - wrong
See http://blackandwhitecomputer.blogspot.de/2015/09/tomcat-debug-cannot-startup.html
Honestly, I had not expected modern applications may be depended on final slash in environment variable path!
I ran into a similar problem. I open cmd prompt and cd to tomcat\bin\startup.bat. The issue was my JRE_HOME not defined in the environment variables. I added and it worked.
I had the same problem and I solved it this way:
First, following #ykaganovich suggestions, I tried to start the server using the catalina.bat start command; it did not solve the problem, but at least it showed a log that specified the error, which was really helpful.
In my case, the log said that the problem was because of the java versión. I had the JAVA_HOME variable pointing to the JDK7, but my tomcat version needed it to point to the JDK8.
I changed the JAVA_HOME variable to point to JDK8 (instead of JDK7) and then , when I executed the catalina.bat start command again, it worked perfectly and the server started. I hope my suggestion could be helpful to someone.
Hmm it's very strange problem because in the log you have that server started, so try this:
restart computer :) - the best solution for strange situations
change tomcat port
close every unnecessary applications: skype, ip phones etc (I've encountered similar problem someday and application ip phone "softly" blocked this port ("softly" - in tomcat log everything was OK but in reality webapp doesn't work)
Add tomcat in your eclipse and start it from there. Configure tomcat as 'Use Tomcat installation'. It will work
Had same problem with apache Tomcat 9 version.
Solution very simple.
Apache Tomcat 9 is supported by Java 8 and later versions.
So, i had JRE_HOME with JRE7 path, I binded it to new JRE8 and everything works fine.
Different versions of Apache Tomcat are available for different versions of the Servlet and JSP specifications. The mapping between the specifications and the respective Apache Tomcat versions is:
Hope this will work for you guys, cheers!
If Tomcat was earlier working fine and Tomcat not starting happens unexpectedly, it's because some other process has started using the port you were using Tomcat on. In my case, I had shutdown Tomcat and was trying to run my servlet directly from Eclipse. So Eclipse took control of the port. After I closed Eclipse and tried restarting Tomcat (with startup.bat), everything worked fine.
ykaganovich's answer helped me track down my issue.
Non of the solutions above worked for me.
I found my way out by removing my current tomcat and replace it with a new one and setting up again my workspace.
I hope this may help someone
Open up the Tomcat users file (tomcat-users.xml)and check that you've closed all your speech marks. That is what fixed it for me.
Now double-check the role names:
<tomcat-users>
<role rolename="admin" />
<role rolename="manager" />
<user username="admin" password="secret" roles="admin,manager" />
</tomcat-users>
Finally, execute startup.bat file from bin
Try to open Tomcat7w.exe or follow the below steps.
(I have installed Tomcat under folder C:\Program Files\Apache Software Foundation\Tomcat 7.0)
open command prompt as Administrator
run --> "C:\Program Files\Apache Software Foundation\Tomcat 7.0\bin\Tomcat7w.exe" //MS//
now you can see icon in the system tray
double click on icon and start/stop
I'm embarrassed to have to ask this, but I can't for the life of me figure out what I'm doing wrong.
I've downloaded the appengine-java-sdk-1.4.2 via the eclipse 3.6 plugin as per the instructions on Installing the Java SDK page. I am running Mac OSX 10.5.8 with JRE version 1.5.0_26. I have made the dev_appserver.sh file executable (chmod u+x dev_appserver.sh) and when I attempt to start the app server with one of the demos via the command
bin/dev_appserver.sh demos/guestbook/war/
I get the following output, but the server does not start up:
2011-03-13 17:52:43.404 java[839:80f] [Java CocoaComponent compatibility mode]: Enabled
2011-03-13 17:52:43.405 java[839:80f] [Java CocoaComponent compatibility mode]: Setting timeout for SWT to 0.100000
********************************************************
Warning: Future versions of the Dev App Server will require Java 1.6 or later. Please upgrade your JRE.
********************************************************
Mar 13, 2011 9:52:44 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Mar 13, 2011 9:52:44 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed /Applications/eclipse_3.6/plugins/com.google.appengine.eclipse.sdkbundle.1.4.2_1.4.2.v201102111811/appengine-java-sdk-1.4.2/demos/guestbook/war/WEB-INF/appengine-web.xml
Mar 13, 2011 9:52:44 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed /Applications/eclipse_3.6/plugins/com.google.appengine.eclipse.sdkbundle.1.4.2_1.4.2.v201102111811/appengine-java-sdk-1.4.2/demos/guestbook/war/WEB-INF/web.xml
I see the warning about upgrading the JRE, but I don't think this is the problem, as there are no exceptions reported. It just won't start up. I've tried creating a hello world app from within Eclipse using the plugin and running as Web server, but that also spits out the same text but does not start up the web server.
Any idea what I'm doing wrong and how to remedy the problem?
By changing the line in dev_appserver.sh to
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java -ea -cp "$JAR_FILE" \
com.google.appengine.tools.KickStart \
com.google.appengine.tools.development.DevAppServerMain $*
instead of using the default java (which is set to 1.5.0_26 as I mentioned earlier) the web server starts up.
I had the same problem and simply tried running Eclipse as Administrator and then debugging worked fine.
I'm trying to setup josso on an apache tomcat server running on windows.
I've installed Apache Tomcat/6.0.26 fro zip file to c:\tomcat
then installed josso following the documentation at
http://www.josso.org/confluence/display/JOSSO1/Quick+Start
started tomcat with c:\tomcat\bin\startup.bat, and noticed the following warnings
ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Realm} Setting property '
debug' to '1' did not find a matching property.
21/03/2010 15:55:03 org.apache.tomcat.util.digester.SetPropertiesRule begin
ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Host/Valve} Setting prope
rty 'appName' to 'josso' did not find a matching property.
...
ADVERTENCIA: Unable to find required classes (javax.activation.DataHandler and j
avax.mail.internet.MimeMultipart). Attachment support is disabled.
...
ADVERTENCIA: Bean with key 'josso:type=SSOAuditManager' has been registered as a
n MBean but has no exposed attributes or operations
...
but then everything seems to work fine, the problem is I can no longer access http://localhost:8080/manager/html using user tomcat /tomcat, as configured in \conf\tomcat-users.xml (before installing josso it worked)
I tried with tomcat/tomcatpwd as defined in \lib\josso-credentials.xml and even added tomcat and the manager role to \lib\josso-users.xml, with no luck...
Is anybody having the same problem? how can I access tomcat's manager page?
Thanks a lot
saludos
sas
This is my config:
C:\tomcat\bin>catalina version
Using CATALINA_BASE: "C:\tomcat"
Using CATALINA_HOME: "C:\tomcat"
Using CATALINA_TMPDIR: "C:\tomcat\temp"
Using JRE_HOME: "c:\java"
Using CLASSPATH: "C:\tomcat\bin\bootstrap.jar"
Server version: Apache Tomcat/6.0.26
Server built: March 9 2010 1805
Server number: 6.0.26.0
OS Name: Windows XP
OS Version: 5.1
Architecture: x86
JVM Version: 1.5.0_22-b03
JVM Vendor: Sun Microsystems Inc
ps: moreover, when shutting down, I get a couple of error like this
GRAVE: A web application appears to have started a thread named [JOSSOAssertionM
onitor] but has failed to stop it. This is very likely to create a memory leak.
21/03/2010 15:57:06 org.apache.catalina.loader.WebappClassLoader clearReferences
Threads
and then tomcat's shutdown freezes at
21/03/2010 15:57:07 org.apache.coyote.ajp.AjpAprProtocol destroy
INFO: Parando Coyote AJP/1.3 en ajp-8009
ps: sorry for this lengthy question...
this may helps you to correct the problem (can't access manager page).
1:In the $CATALINA_BASE/conf/server.xml file remove the following code if present
$CATALINA_BASE/conf/server.xml
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
2:For each non-jossified application add a with configuration in $CATALINA_BASE/conf//
(i.e. In Catalina/localhost set the Tomcat Manager web application as non-jossified)
$CATALINA_BASE/conf/Catalina/localhost
<Context docBase="${catalina.home}/server/webapps/manager" privileged="true" antiResourceLocking="true" antiJARLocking="true">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
http://www.josso.org/confluence/display/JOSSO1/Jossify+your+Application+for+Tomcat+-+Quick+Start