I have a Maven project that I debug with Tomcat 7 within Eclipse.
The problem is, when I make a minimal change in the pom.xml file, e.g. change the version of a Maven plugin or adding a configuration property, the server does not start properly anymore. It really does not matter what I change.
When I start the server with "Debug As", Apache Click and Shiro don't start anymore and accessing localhost leads to a 404 message by Tomcat.
The funny thing is, the problem persists even when I undo the change. The only thing that helps is a GIT -> Replace With command of the whole project.
Edit: I found out that even if I don't change anything in the pom.xml and just run Maven -> Update Project I have the issue.
Here is the log file before the change when everything works fine:
Nov 15, 2012 10:28:10 AM 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\jdk1.7.0\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jdk1.7.0\jre\bin;C:/Program Files/Java/jdk1.7.0/bin/../jre/bin/client;C:/Program Files/Java/jdk1.7.0/bin/../jre/bin;C:/Program Files/Java/jdk1.7.0/bin/../jre/lib/i386;C:\Program Files\Java\jdk1.7.0\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\apache-maven-3.0.4\bin;C:\Program Files\Java\jdk1.7.0\bin;C:\Program Files\Eclipse JEE Indigo;;.
Nov 15, 2012 10:28:12 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:testproject' did not find a matching property.
Nov 15, 2012 10:28:12 AM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Nov 15, 2012 10:28:12 AM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Nov 15, 2012 10:28:12 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2201 ms
Nov 15, 2012 10:28:12 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Nov 15, 2012 10:28:12 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Nov 15, 2012 10:28:13 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\Data\Programming\Eclipse Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\testproject\WEB-INF\lib\servlet-api-1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Nov 15, 2012 10:28:13 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\Data\Programming\Eclipse Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\testproject\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Nov 15, 2012 10:28:13 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Shiro environment
[Click] [info ] *** Initializing Click 2.3.0 in development mode ***
[Click] [info ] initialized LogService: org.apache.click.service.ConsoleLogService
[Click] [info ] found jar: file:/D:/Data/Programming/Eclipse%20Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testproject/WEB-INF/lib/click-nodeps-2.3.0.jar
[Click] [info ] Click 2.3.0 initialized in development mode
Nov 15, 2012 10:28:14 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Nov 15, 2012 10:28:14 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Nov 15, 2012 10:28:14 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2076 ms
[Click] [info ] handleRequest: /index.htm - 57 ms
And this is the log after a minimal change to the pom file:
Nov 15, 2012 10:25:23 AM 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\jdk1.7.0\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jdk1.7.0\jre\bin;C:/Program Files/Java/jdk1.7.0/bin/../jre/bin/client;C:/Program Files/Java/jdk1.7.0/bin/../jre/bin;C:/Program Files/Java/jdk1.7.0/bin/../jre/lib/i386;C:\Program Files\Java\jdk1.7.0\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\apache-maven-3.0.4\bin;C:\Program Files\Java\jdk1.7.0\bin;C:\Program Files\Eclipse JEE Indigo;;.
Nov 15, 2012 10:25:24 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:testproject' did not find a matching property.
Nov 15, 2012 10:25:24 AM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Nov 15, 2012 10:25:24 AM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Nov 15, 2012 10:25:24 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 570 ms
Nov 15, 2012 10:25:24 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Nov 15, 2012 10:25:24 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Nov 15, 2012 10:25:39 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Nov 15, 2012 10:25:39 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Nov 15, 2012 10:25:39 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 14905 ms
Can anybody explain me what is happening here? I'm thankful for any tipps!
I'm using Tomcat6 with Maven and I have a similar problem at Eclipse.
Sometimes looks like Tomcat stucks and stay completely blind with my configured project.
When this thing happens I try this steps, always testing if one of then already resolved my problem.
Maven -> Project update
F5 over the project (ussualy works at this point)
Clean the Tomcat
Clean the project (Project > Clean)
Removes the project (Right button over the server > Add and Remove), save and add it again.
How it's your server.xml? Is it your project a web application?
Unfortunately I don't know why this kind of problem occur, but it looks like much more a problem with the Tomcat's cache then with Maven at all.
Anyway, it's a problem that takes me a lot of time each day.
Related
when i run my JSP page on apache tomcat 7 in my eclipse, server output shows up in 30000ms or more some times it never starts up, at first output got in lessthan 700ms,
Any help or suggession on this problem...
sample output...
NFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Mar 18, 2014 10:42:39 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [156] milliseconds.
Mar 18, 2014 10:42:58 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mar 18, 2014 10:42:58 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Mar 18, 2014 10:42:58 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 30553 ms
Consider the following 2 suggestions:
1)As I commented above check if more then one application is running on the same server.This could be the primary reason.May be 3 or 4 applications might be running once you start your tomcat service.
2)May be some library that you are using for your application is creating some problem,for example the library might be initializing some file storage or may be something else.For this you will have to debug and check your stacktraces.
I've been following the Servlet and JSP development with Eclipse WTP from vogella.com. I've installed Tomcat 7, copy-pasted the code (a simple Data Access Object and a simple HpptServlet), and started the server from eclipse.
When I open http://localhost:8080/de.vogella.wtp.filecounter/FileCounter in the web, the expected result is:
But I got a 404 error:
And this error log in the console:
Sep 15, 2013 7:27:09 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: /Users/adamatan/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
Sep 15, 2013 7:27:09 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.
Sep 15, 2013 7:27:09 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Sep 15, 2013 7:27:09 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Sep 15, 2013 7:27:09 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 525 ms
Sep 15, 2013 7:27:09 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 15, 2013 7:27:09 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
Sep 15, 2013 7:27:09 PM org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base /Users/adamatan/Personal/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/de.vogella.wtp.filecounter does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:138)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:5055)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5235)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Sep 15, 2013 7:27:09 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error in resourceStart()
Sep 15, 2013 7:27:09 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error getConfigured
Sep 15, 2013 7:27:09 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/de.vogella.wtp.filecounter] startup failed due to previous errors
Sep 15, 2013 7:27:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Sep 15, 2013 7:27:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Sep 15, 2013 7:27:09 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 255 ms
Relevant information:
Tomcat runs OK from the command line (catalina run).
There is only one instance of Tomcat running at the same time.
I could not get any other Tomcat servlet to run from Eclipse.
Any idea why isn't tomcat running my simple Servlet?
Update: I'm using OSX
I suspect you are running tomcat using an own user - it's a common practice in unix systems - and that that user does not have read privilege to your home directory /Users/adamatan.
Then you could try to add the tomcat user to you the group your user belongs to.
Better yet try to change the server location as described in this so question to a location where eclipse has write access and the tomcat user has read access.
EDIT
Actually its a setting in the Dynamic Web Project wizard, If you choose Dynamic web module version 3.0 (which is default) or higher on the first page then on the last page the checkbox for Generate web.xml deployment descriptor is disabled by default. If you choose 2.5 or lower it is then enabled by default. It has nothing to do with which tomcat you are actually using. If you want to use annotations though, then you have to have tomcat 7 with servlet specs 3.0
It was a Tomcat 6 tutorial, and I was using Tomcat 7.
Eclipse did not create a web.xml file, because it was expecting annotations in the Java code. The tutorial code did not contain any annotations, so the server started without servlets.
I am building an application that uses Spring+MyBatis+JSP in Eclipse. Its a very basic application. The program complies without any errors or warnings. When I click on Run on a Server in the project I get the following output in the console.
Output:
Jul 17, 2013 4:42:45 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:\Python33\;C:\Oracle\Ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Symantec\Workspace Virtualization\;C:\Program Files\Enterprise Vault\EVClient\;C:\Program Files\Lenovo\Access Connections\;C:\Program Files\Microsoft Office\Office14;C:\Program Files\Perforce;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files\Nmap;C:\eclipse-jee-juno-SR2-win32\eclipse;;.
Jul 17, 2013 4:42:45 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:MyBatisHelloWorld' did not find a matching property.
Jul 17, 2013 4:42:46 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jul 17, 2013 4:42:46 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jul 17, 2013 4:42:46 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1133 ms
Jul 17, 2013 4:42:46 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 17, 2013 4:42:46 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Jul 17, 2013 4:42:47 PM org.apache.catalina.core.ApplicationContext log
INFO: Set web app root system property: 'webapp.root' = [C:\Users\Anand_Roongta\workspace1\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\MyBatisHelloWorld\]
Jul 17, 2013 4:42:48 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing log4j from [C:\Users\Anand_Roongta\workspace1\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\MyBatisHelloWorld\WEB-INF\classes\log4j-helloworld.xml]
Jul 17, 2013 4:42:48 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'HelloWorldMyBatis'
2013-07-17 16:42:48,436 INFO DispatcherServlet:454 FrameworkServlet 'HelloWorldMyBatis': initialization started
2013-07-17 16:42:48,502 INFO XmlWebApplicationContext:510 Refreshing WebApplicationContext for namespace 'HelloWorldMyBatis-servlet': startup date [Wed Jul 17 16:42:48 IST 2013]; root of context hierarchy
2013-07-17 16:42:48,597 INFO XmlBeanDefinitionReader:315 Loading XML bean definitions from ServletContext resource [/WEB-INF/HelloWorldMyBatis-servlet.xml]
2013-07-17 16:42:49,090 INFO DefaultListableBeanFactory:596 Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#ac0f75: defining beans [helloWorldController,numbersServiceImpl,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,viewResolver,dataSource,txManager,sqlSessionFactory,sqlSession,userDao,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
2013-07-17 16:42:49,844 INFO DefaultAnnotationHandlerMapping:315 Mapped URL path [/index] onto handler 'helloWorldController'
2013-07-17 16:42:49,844 INFO DefaultAnnotationHandlerMapping:315 Mapped URL path [/index.*] onto handler 'helloWorldController'
2013-07-17 16:42:49,844 INFO DefaultAnnotationHandlerMapping:315 Mapped URL path [/index/] onto handler 'helloWorldController'
2013-07-17 16:42:49,844 INFO DefaultAnnotationHandlerMapping:315 Mapped URL path [/helloWorld] onto handler 'helloWorldController'
2013-07-17 16:42:49,845 INFO DefaultAnnotationHandlerMapping:315 Mapped URL path [/helloWorld.*] onto handler 'helloWorldController'
2013-07-17 16:42:49,845 INFO DefaultAnnotationHandlerMapping:315 Mapped URL path [/helloWorld/] onto handler 'helloWorldController'
2013-07-17 16:42:50,184 INFO DispatcherServlet:473 FrameworkServlet 'HelloWorldMyBatis': initialization completed in 1745 ms
Jul 17, 2013 4:42:50 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jul 17, 2013 4:42:50 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jul 17, 2013 4:42:50 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3847 ms
This according me is a working application. But the application simply won't show up in a browser window. Tomcat doesn't open any browser (like it does as its default behavior like an internal browser or Firefox etc.) Any suggestions.?
I'd like to run my Spring application using STS, but I have no idea how to do that. I see the tc server instance, and I can run it, but this does not start my application. I've tried dragging my project workspace onto it, but that hasn't worked either. I've right-clicked and read/checked out all of the options on the context-sensitive menu, but I don't see anything to run my project inside tc server. Does anyone know how?
EDIT:
This is what I get when running the project. I see nothing about my project's war at all. It is included as a "web module" when I check out the tc server settings though. And it does have a web.xml and all of that other good stuff. The project works fine in maven's tomcat goal and inside IDEA. I am just having problems getting it to run in eclipse.
Mar 30, 2012 3:35:51 PM com.springsource.tcserver.security.PropertyDecoder <init>
INFO: tc Runtime property decoder using memory-based key
Mar 30, 2012 3:35:51 PM com.springsource.tcserver.security.PropertyDecoder <init>
INFO: tcServer Runtime property decoder has been initialized in 206 ms
Mar 30, 2012 3:35:52 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 30, 2012 3:35:52 PM com.springsource.tcserver.serviceability.rmi.JmxSocketListener init
INFO: Started up JMX registry on 127.0.0.1:6969 in 65 ms
Mar 30, 2012 3:35:52 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 741 ms
Mar 30, 2012 3:35:52 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 30, 2012 3:35:52 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: VMware vFabric tc Runtime 2.6.3.RELEASE/7.0.23.A.RELEASE
Mar 30, 2012 3:35:52 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\me\Documents\workspace-sts-2.9.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\trainingdividend.xml
Mar 30, 2012 3:35:52 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:trainingdividend' did not find a matching property.
Mar 30, 2012 3:35:52 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive C:\Users\me\Documents\workspace-sts-2.9.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\insight.war
Mar 30, 2012 3:35:52 PM com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader start
INFO: Context [localhost|insight] will not be woven
Mar 30, 2012 3:35:53 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Mar 30, 2012 3:36:03 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'Spring MVC Dispatcher Servlet'
Mar 30, 2012 3:36:05 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mar 30, 2012 3:36:05 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 13468 ms
If you are missing the Run As > Run on Server option, then chances are your project does not have the Dynamic Web Module facet.
I was running into 404 errors in my J2ee project, created using Dynamic WebModules. Initially I thought it was a context problem, as the url that STS was attempting to run was quite wrong. However the project the context was correct. But needed to get rid of the errors shown in the markers tab (which may not stop attempts to run as Server) before I made any progress.
After resolving obvious code, jar,path errors, I then check if I can export a war file correctly. If not, it is usually an issue in the DEPLOYMENT ASSEMBLY portion of the projects properties (at least in my Java project). Specifying the class files and jars from required projects is needed to get the correct war file structure. Once accomplished, bye bye 404s
I have a web service application that I deployed successfully on Apache Tomcat using Eclipse IDE. However after a restart to my computer is not working any more. While trying to the list of services I get the following.
HTTP Status 404 - /ScWS/services/listServices
type Status report
message /ScWS/services/listServices
description The requested resource (/ScWS/services/listServices) is not available.
Apache Tomcat/7.0.11
When Tomcat is loading I see the following in the console logs:
Mar 19, 2011 10:46:57 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-6-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib/jni:/lib:/usr/lib
Mar 19, 2011 10:47:05 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 19, 2011 10:47:05 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Mar 19, 2011 10:47:05 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 10342 ms
Mar 19, 2011 10:47:06 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 19, 2011 10:47:06 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.11
Mar 19, 2011 10:47:08 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ScWS.xml from /home/blueprint/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/Catalina/localhost
Mar 19, 2011 10:47:08 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ScWS' did not find a matching property.
Mar 19, 2011 10:47:11 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mar 19, 2011 10:47:11 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Mar 19, 2011 10:47:11 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5593 ms
Anyone have any ideas what might be the Issue?
I deleted everything about Tomcat and installed again and everything was up and running.