Controlling Tomcat starting issue with Eclipse - java

I am trying to start Tomcat 7.0.55 from Eclipse Luna on Ubuntu 14.04.
It is working perfectly fine when the Eclipse is run through sudo nautilus.
But when the Eclipse is used via normal user and Tomcat is started, the following
error occurs:
Server Tomcat v7.0 Server at localhost was unable to start within 45
seconds. If the server requires more time, try increasing the timeout
in the server editor.
I have tried to increase the timeouts to 200 seconds, but still the same error.
Till the time Eclipse tries to start the Tomcat, the server tab shows following status
Tomcat 7.0 Server at localhost [ Starting, Synchronized]
and the console tab shows:
Sep 17, 2014 3:02:07 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-7-openjdk-i386/jre/lib/i386/server:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386:/usr/lib/jvm/java-7-openjdk-i386/jre/../lib/i386:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/client:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386::/usr/java/packages/lib/i386:/usr/lib/i386-linux-gnu/jni:/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:/usr/lib/jni:/lib:/usr/lib
Sep 17, 2014 3:02:07 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:testprj' did not find a matching property.
Sep 17, 2014 3:02:08 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Sep 17, 2014 3:02:08 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Sep 17, 2014 3:02:08 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1168 ms
Sep 17, 2014 3:02:08 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 17, 2014 3:02:08 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.55
Sep 17, 2014 3:02:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Sep 17, 2014 3:02:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Sep 17, 2014 3:02:09 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1131 ms
and once the error pops, the Eclipse server tab shows:
Tomcat v7.0 Server at localhost [ Stopped, Synchronized]
Any help ?

Related

Java / Spring application: Tomcat suddenly not able to deploy anymore

After noticing that my web application is not running on the production server anymore, I looked inside the tomcat log (catalina.out):
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Listening for transport dt_socket at address: 8000
Mar 26, 2018 7:53:26 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 26, 2018 7:53:26 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 4624 ms
Mar 26, 2018 7:53:26 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 26, 2018 7:53:26 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
Mar 26, 2018 7:53:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Listening for transport dt_socket at address: 8000
Mar 26, 2018 7:54:26 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 26, 2018 7:54:26 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2108 ms
Mar 26, 2018 7:54:26 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 26, 2018 7:54:26 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
Mar 26, 2018 7:54:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Listening for transport dt_socket at address: 8000
Mar 26, 2018 7:55:31 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 26, 2018 7:55:32 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2428 ms
Mar 26, 2018 7:55:32 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 26, 2018 7:55:32 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
Mar 26, 2018 7:55:32 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Listening for transport dt_socket at address: 8000
Mar 26, 2018 7:56:36 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 26, 2018 7:56:36 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1873 ms
Mar 26, 2018 7:56:36 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 26, 2018 7:56:36 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
Mar 26, 2018 7:56:36 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Listening for transport dt_socket at address: 8000
Mar 26, 2018 7:57:42 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 26, 2018 7:57:42 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2534 ms
Mar 26, 2018 7:57:42 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 26, 2018 7:57:42 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
Mar 26, 2018 7:57:42 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
The deploy "loop" starts with the following message:
Mar 26, 2018 5:00:45 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Mar 26, 2018 5:00:46 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
I tried to restart Tomcat and the entire server multiple times without success.
Can you imagine what's going wrong here?
Similar cases have been reported and the explanation was a Memory Leak.
About this warning which mentions that PermGen is ignored, why don't you use the correct option ? This might explain an insufficient memory leading to your problem.
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
If after using the correct option (XX:MaxMetaspaceSize) you still have this problem, try giving it more memory. Try to understand what changed then your application cannot run anymore (data has changed in the DB ? how ?). If you still to convince yourself, remove the application and start Tomcat with no webapps at all.
Strange...
Can you run your app with other server ? Such as glassfish or jetty ?
I know it doesn't answer your question,but if the app work with the servers mentioned above, than your tomcat is with some problem,but if not work if them, than your code have some problems.

JSP pages not loading on loaclhost while working with Tomcat7 on Eclipse IDE

I am working on a project for which I am using Java Servlets and JSP. Earlier the project was running fine, but now when running the project, the server is properly setup but some JSP pages are not running and others do not show any CSS applied to it.
Also console shows a warning.
Apr 19, 2016 8:24:57 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.2.
Apr 19, 2016 8:24:57 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Apr 19, 2016 8:24:58 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:TPC' did not find a matching property.
Apr 19, 2016 8:24:58 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1f 6 Jan 2014)
Apr 19, 2016 8:24:58 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
Apr 19, 2016 8:24:58 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Apr 19, 2016 8:24:58 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2996 ms
Apr 19, 2016 8:24:58 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 19, 2016 8:24:58 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
Apr 19, 2016 8:25:01 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Apr 19, 2016 8:25:02 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Apr 19, 2016 8:25:02 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3405 ms
Can you check if you war/ear file is present in tomcat and also getting deployed.
If not sure, just restart the server after clean up (deleting temp,work and logs directory).
Then try to access http://localhost:8080/ or http://localhost:8080/YOUR_DEPLOYABLE_FILE_NAME
If it still doesn't work then check mappings in web.xml.

Eclipse Kepler fails to start Tomcat 7

I'm using Eclipse Kepler and Tomcat 7 and Ubuntu 12.04. When Tomcat starts it after 45 seconds it says
Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.
I increased the timeout, reinstalled Eclipse and Tomcat but still the problem is not solved.
In debug mode I get this error.
<terminated, exit value: 143>/usr/lib/jvm/java-7-openjdk-amd64/bin/java (May 26, 2014, 12:26:09 PM)
My console says:
May 26, 2014 12:26:10 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/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
May 26, 2014 12:26:10 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
May 26, 2014 12:26:10 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
May 26, 2014 12:26:10 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 995 ms
May 26, 2014 12:26:10 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
May 26, 2014 12:26:10 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.54
May 26, 2014 12:26:11 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
May 26, 2014 12:26:11 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
May 26, 2014 12:26:11 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 804 ms
Add server runtime at starting of creation of anything in your eclipse environment
add specified installed tomcat library and jdk location and it will works

Eclipse Error in Tomcat7 Server

I have configured Tomcat 7 with Eclipse Helios 1.3.2 on port number 8080. Tomcat Service and everything is installed.
When I am starting the server from Eclipse, it does some process and shows the status as STARTED. But when I try to hit http://localhost:8080, it says The requested resource (/) is not available. i.e. in fact server is not started in reality.
However, when I am starting the server from Windows Explorer by running Tomcat7.exe or Tomcat7w.exe, it starts well and I am able to see Apache Home page by referring to http://localhost:8080.
Below is the server start up log.
Jul 02, 2012 1:20:12 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: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Perforce;O:\ora1106w\bin;C:\Program Files\Java\jdk1.6.0_12\bin;;C:\Program Files\WinMerge;C:\Users\KNIRAV\Downloads\eclipse-jee-helios-SR2-win32\eclipse;;.
Jul 02, 2012 1:20:17 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jul 02, 2012 1:20:17 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jul 02, 2012 1:20:17 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 5674 ms
Jul 02, 2012 1:20:17 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 02, 2012 1:20:17 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.28
Jul 02, 2012 1:20:18 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [126] milliseconds.
Jul 02, 2012 1:20:18 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jul 02, 2012 1:20:18 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jul 02, 2012 1:20:18 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1788 ms
Can I have some solution to this please?
There is no problem. When you start Tomcat from Eclipse a root application is not deployed. Only the projects that you deploy through the server view are available.
Have you tried to deploy a project on the server?

Tomcat fails to start in Eclipse - java.net.BindException: Address already in use

I'm new to Tomcat and Eclipse, but have been searching for a solution for days. I've installed Tomcat v7.0 and can start/stop it from the terminal, but I can't get it to work from Eclipse. I'm following the tutorial at http://www.vogella.de/articles/EclipseWTP/article.html#jspservlets, but when I attempt to run my servlet I get the alert: "Server Tomcat v7.0 Server at localhost failed to start" with the console output as:
Feb 18, 2012 7:05:54 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: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Feb 18, 2012 7:05:54 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:de.vogella.wtp.filecounter' did not find a matching property.
Feb 18, 2012 7:05:54 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Feb 18, 2012 7:05:54 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Feb 18, 2012 7:05:54 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1046 ms
Feb 18, 2012 7:05:54 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Feb 18, 2012 7:05:54 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.25
Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Feb 18, 2012 7:05:55 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 654 ms
Feb 18, 2012 7:05:55 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:8005]:
java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.<init>(ServerSocket.java:194)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:422)
at org.apache.catalina.startup.Catalina.await(Catalina.java:728)
at org.apache.catalina.startup.Catalina.start(Catalina.java:674)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Feb 18, 2012 7:05:55 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
netstat doesn't show ports 8080, 8005 or 8009 in use before I attempt to run Tomcat, so that doesn't seem to be the problem. Any idea what's going wrong?
It seems when you installed Tomcat- it decided to run in service mode and must be running when you start your system. Hence the error when you start the tomcat through eclipse.Using other ports in server.xml maynot solve your problem.My guess is that another instance of tomcat is already running.Can you check in taskmanager of another instance of tomcat is running before you start it from eclipse ?
Also can you post result from netstat run ?
step 1: go to C:\Windows\System32\drivers\etc
step 2:
find hosts file and open it with notepad with admin mode
step 3:
replace local host ip with 127.0.0.1
example
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
# ::1 localhost
step 4:
save that file and run server
Change Tomcat port setting:
It seems the Tomcat is already integrated in Eclipse. So there should be a project called "Servers" in your Eclipse, you could find your Tomcat configuration node. Change the port attribute in server.xml. Of course, the plugin provides many ways to integrate with Tomcat, but basic idea is to change server.xml.

Categories

Resources