Tomcat started in Eclipse. But application is not started

This is a strange problem after I migrated from old version of STS to STS4.


Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/9.0.13
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Nov 2 2018 14:27:55 UTC
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 9.0.13.0
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 10
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 10.0
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jdk1.8.0_181\jre
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_181-b13
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: D:\Pandian\Documents\workspace_crm\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: H:\Dev\apache-tomcat-9.0.13
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=D:\Pandian\Documents\workspace_crm\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=H:\Dev\apache-tomcat-9.0.13
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=D:\Pandian\Documents\workspace_crm\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=H:\Dev\apache-tomcat-9.0.13\endorsed
Sep 19, 2019 5:20:19 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Sep 19, 2019 5:20:19 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: Loaded APR based Apache Tomcat Native library [1.2.18] using APR version [1.6.5].
Sep 19, 2019 5:20:19 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Sep 19, 2019 5:20:19 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
Sep 19, 2019 5:20:19 AM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized [OpenSSL 1.1.1 11 Sep 2018]
Sep 19, 2019 5:20:19 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Sep 19, 2019 5:20:21 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Sep 19, 2019 5:20:21 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Sep 19, 2019 5:20:21 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Sep 19, 2019 5:20:21 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2281 ms
Sep 19, 2019 5:20:21 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
Sep 19, 2019 5:20:21 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/9.0.13
Sep 19, 2019 5:20:22 AM org.apache.jasper.servlet.TldScanner scanJars
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.
Sep 19, 2019 5:20:22 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Sep 19, 2019 5:20:22 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Sep 19, 2019 5:20:22 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1107 ms

  • Removed the server tomcat and added again
  • Removed few .props files from workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings.
  • changed the server locations in Server overview screen

Nothing helped except Maven Build.. Still Open. I’ll update if I have a solution later.

I captured this Green corridor at Royal Botanical Gardens, Peradeniya

I captured this Green corridor at Royal Botanical Gardens, Peradeniya

Eclipse tomcat does not start – May be locked by another process.

Happy Western New Year 2019!

I had a single spring web project. It became too big over the day. I had to split it up into multiple reusable projects so that I can build APIs. After I split it, Tomcat refused to start with the following error.


Publishing failed with multiple errors
Could not delete D:/Pandian/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/crm-upload/WEB-INF/lib. May be locked by another process.
Could not delete D:/Pandian/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/crm-upload/WEB-INF. May be locked by another process.

I tried to clean work folder, It doesn’t work. I did the following sequence to resolve this.

  1. Remove the tomcat server from eclipse server tab
  2. Restart Eclipse
  3. Add a new tomcat server
  4. Start the project

 

No Spring WebApplicationInitializer types detected on classpath

Wah, what a stupid error it was!

My Spring web app, which was running smoothly, refused to start. I don’t find any logs in log4j or tomcat log. Only clue I had was –

No Spring WebApplicationInitializer types detected on classpath

Here is how I solved it –

  1. Stop the tomcat
  2. Clean and build all eclipse projects
  3. Goto server tab and select the tomcat server. Press clean. Press clean work directory.
  4. Right click on the tomcat and remove it.
  5. Delete the tomcat from the eclipse run times
  6. Add tomcat server to the eclipse servers again
  7. Start the application

 

Integrating Apache and Tomat with mod_jk

This post is a continuation of my previous post. In this post I’ll tell you what I did to access my tomcat apps via Apache.

All the files you edit here are very crucial. Take a backup and make a note of the changes you do. Otherwise, it may goof your Apache configuration.

Installing mon-jk library

$ sudo apt-get install libapache2-mod-jk

Make sure the AJP redirect port is enabled on tomcat/config/server.xml

<Connector port=”8009″ protocol=”AJP/1.3″ redirectPort=”8443″ />

Create a new worker file

sudo vi /etc/apache2/workers.properties

# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009

Reconfigure jk.conf

Change the JkWorkersFile property to /etc/apache2/workers.properties

sudo vi /etc/apache2/mods-available/jk.conf

# JkWorkersFile /etc/libapache2-mod-jk/workers.properties
JkWorkersFile /etc/apache2/workers.properties

Configure the URL Apache should pass through the Tomcat

sudo vi /etc/apache2/sites-enabled/000-default

and add the line starts with JKMount in your configurtation

<VirtualHost *:80>
…………………………………
…………………………………
JkMount /gplus* worker1
</VirtualHost *:80>

Restart apache

I found http://<apacheIP>/gplus worked.

Appreciations and thanks to http://thetechnocratnotebook.blogspot.sg/2012/05/installing-tomcat-7-and-apache2-with.html

 

 

 

 

 

Apache – Tomcat connector in Windows

This is another interesting assignment completed today. Though our CRM portal is no so busy, we want to in a robust infra. There are series of new releases available kn the market. JDK 7, Tomcat 7 etc. Previously the application was using tomcat itself as a web server. This is a risky situation since I expose the complete applivation to public. Hence I have installed the apache as web front-end and tomcat 7 as middleware.

Here is the procedure:

mod_proxy_ajp would be the easiest to use if you are using Apache 2.2. It is part of the Apache distribution so you don’t need to install any additional software.

In your httpd.conf you need to make sure that mod_proxy and mod_proxy_ajp are loaded:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

Then you can use the ProxyPass and ProxyPassReverse directives as follows:

ProxyPass /portal ajp://localhost:8009/portal
ProxyPassReverse /portal ajp://localhost:8009/portal

As simple as that.

java.lang.NoSuchMethodError while starting tomcat 7 from Eclipse

My tomcat 7 server is starting and working fine by itself. When I stop it and try to start from Eclipse, it gives a NoSuchMethodError which aborts the server starting.

java.lang.NoSuchMethodError: org.eclipse.wst.server.core.model.ServerBehaviourDelegate.getTempDirectory(Z)Lorg/eclipse/core/runtime/IPath;

somebody is getting same error, but still not resolved. http://www.eclipse.org/forums/index.php?t=msg&goto=557431&S=432a9edd157438a3661ca16edfe4a4ab

I have raised a bug report to eclipse. Lets see.

>>>

I just got an update from Eclipse Bugzilla

Your Build Identifier indicates you are using Eclipse 3.5, which only works
with WTP 3.1.x.  WTP 3.2.x, which includes the new Tomcat 7.0 support, requires
Eclipse 3.6.x.  Running WTP 3.2.x with Eclipse 3.5.x is not supported.  You
will have to install Eclipse 3.6 since upgrading 3.5.x to 3.6 is not supported.
Once you have Eclipse 3.6 with WTP 3.2.x installed (using the Java EE package
is the easiest) you can create a new workspace and import your existing
projects, or you can simply open old workspace.  If you open the old workspace
with Eclipse 3.6 and WTP 3.2.x, using that workspace with Eclipse 3.5 and WTP
3.1.x is not supported.

Since Eclipse 3.5.x and WTP 3.2.x is not a supported combination, I’m marking
this bug as invalid.

Upgrade karega!