There is a maven spring mvc project which I imported in eclipse . The same project is running successfully in my colleague's desktop . When i start the tomcat server in eclipse, I am not able to see http://localhost:8080/test/ , it is showing as error http status 404 . I even changed the port no to 8081 and ran it again but it is giving same error . It is not able to find the index.jsp page .
Try to use
File -> Import -> [General] -> Project interchange (for the whole ZIP)
or
File -> Import -> [General] -> Existing project into workspace (for the extracted file)
for eclipse to import them properly.
Do you see tomcat running properly under localhost:8080 or 8081 ? if not, then it means something is wrong with Tomcat in general, what can you see in catalina.log file during tomcat start attempt (or in the command shell where you attempt 'catalina start' ?
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
The first answer in the above query solved the issue . I was getting classNotFoundException due to which index.jsp I was unable to view .
Related
My Tomcat located in the ~/Library/Tomcat9 path.
I can find it by this way:
But when I configure the Application Server using IntelliJ IDEA, I can not find the path, because it is a hidden directory.
Attempt -1
I have tried in my terminal:
defaults write com.apple.finder AppleShowAllFiles -bool true
and restart my Finder.
Attempt -2
Finder Command + F, to set Files visibility.
Refer to Minjun Yu's suggestion, I finally solved this issue by type the path in the Configure:
/Users/luowensheng/Library/Tomcat9
I need help figuring out why a couple of my web applications are intermittently throwing 404 errors when trying to bring up a JSP. One of them has the JSP accessed directly and the other has a servlet that is forwarding to a JSP. The pages work most of the time, but occasionally will throw a 404. If the user refreshes their browser 1-3 times, the page starts working again without any changes required.
Here is a sample of the error as seen in the web browser (Chrome):
type: Status report
message: /app_root/my_page.jsp
description: The requested resource is not available
The problem seems to be related to recompiling the JSP pages. The .war file and expanded directory haven't changed. There are always three errors in the logs that correspond to each 404 error:
WARNING: Failed to delete generated class file [D:\Apache Software Foundation\Tomcat 7.0\work\Catalina\localhost\app_root\org\apache\jsp\my_005fpage_jsp.class]
May 19, 2015 6:32:24 AM org.apache.jasper.compiler.Compiler removeGeneratedFiles
WARNING: Failed to delete generated Java file [D:\Apache Software Foundation\Tomcat 7.0\work\Catalina\localhost\app_root\org\apache\jsp\my_005fpage_jsp.java]
May 19, 2015 6:32:24 AM org.apache.jasper.compiler.Compiler generateJava
WARNING: Failed to delete generated Java file [D:\Apache Software Foundation\Tomcat 7.0\work\Catalina\localhost\app_root\org\apache\jsp\my_005fpage_jsp.java]
I'm running Java 1.7 on Tomcat 7.0.53. Tomcat is running on a Windows 2008 R2 server.
Here is what I've tried so far, based on the information I've found from google. However, the 404's continue.
Disabled Windows indexing on the entire Tomcat directory
Turned off development mode in my production environment
Increased modificationTestInterval in my QA environment from the default (4 seconds) to 3600 (1 hour) [Note: it is currently set to 0 to try to help me reproduce the issue]
Changed the owner on the Tomcat work directory to be the same id as the id that the service is running as.
I am in the process of getting anti-virus turned off on the work directory to see if that helps.
While this issue is occurring on my prod and QA servers, it doesn't occur for me on my local Tomcat instance. In fact, I have yet to see the problem from my workstation even when running the QA and Prod applications. The issue has only been seen by other people.
The Tomcat container caches .java and .class files generated by the JSP parser, which are used by the web application. Sometimes these get corrupted or cannot be found. This may occur after a patch or upgrade that contains modifications to JSPs.
Solution is to just simply delete the work directory and restart the tomcat
I had the same problem after deploying a .war on our live server. These are the steps that I followed to solve the problem:
1) Shut down the tomcat server
2) Go to <your tomcat directory> -> work -> Catalina -> localhost -> <your project> -> org -> apache -> jsp ->
3) Manually delete both .class and .java
4) Delete the .war file and the deployed folder from the website that is having the issue on the webapps folder.
5) Export a new .war, and put it into the webapps folder.
6) Start up the tomcat service again.
Once the server is finished deploying, it will auto re-generate the deleted files in the "work" directory and the website should be available again without the intermittent 404 error.
I hope it works for you too.
Check the authority of this file or folder. Generally this problem is caused by lack of access to folders.
I am facing a problem when i try to run eclipse in debug mode. I have added the app jar to tomcat 6.0 in eclipse and when i try to debug or start the tomcat server it throwing this error over and over again. I have tried to run eclipse in admin mode but even that does not help. PFB the error details!
Publishing the configuration... Error copying file to
C:/Software/Softwares/apache-tomcat-6.0.41/backup\server.out.xml:
C:\Software\Softwares\apache-tomcat-6.0.41\conf\server.out.xml (The
system cannot find the file specified)
C:\Software\Softwares\apache-tomcat-6.0.41\conf\server.out.xml (The
system cannot find the file specified)
you don't have the file server.out.xml file on your conf folder from tomcat. I suggest you to check if you change your configuration of tomcat. I have tomcat 7 and this file isn't on my conf folder. Also you can try download a newer version of tomcat.
What worked for me was to remove the tomcat server v6.0 from eclipse and add again.
create empty file "server.out.xml " in *C:\Software\Softwares\apache-tomcat-6.0.41\conf* and C:/Software/Softwares/apache-tomcat-6.0.41/backup
Attempting to set up jenkins and its container deploy plugin.
However, I am receiving the following stacktrace :
ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
org.codehaus.cargo.container.ContainerException: Failed to deploy [/myHome/jenkins/jobs/myAPP/workspace/target/ROOT.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:111)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:187)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:60)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:86)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:73)
at hudson.FilePath.act(FilePath.java:784)
at hudson.FilePath.act(FilePath.java:766)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:73)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:45)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:700)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:675)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:998)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:622)
at hudson.model.Run.run(Run.java:1429)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:481)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Failed to deploy application at context path /ROOT
Which isn't really that helpful, I can deploy manually using tomcat manager, and also copying the war file across using command line options works. But i can not get the automated deploy to work.
I am using a tomcat url of http://localhost:8080/ and the deploy fails when their is no app currently deployed.
Any help gratefully received, thanks.
Just a wild guess but the ROOT context is not: /ROOT but rather / maybe there is something wrong in your config
Its a ContainerExc not fileNotFound; therefore the war file has been located.
URL should be http://localhost:8080
Is userName and Password provided?
Is this userName assigned a role of manager-script?
is the tomcat webapp cleared down once for work and temp folder?
If YES to above all, now run the tomcat without any war fiel present in the webapps folder and open a web broswer to see http://localhost:8080 is accessible.
Now whilst this tomcat running, build the jenkins job and deployment should be fine.
I have just downloaded the Atmosphere Samples from Github. When I ran jetty:run goal on the chat-sample, I have some problems.
I can access to the page (http://localhost:9090) with my browser, but when i start chatting, nothing append, because the server return an 404 error page for each AJAX request.
What am I doing wrong?
I had the same problem, and was able to solve it by running jetty not through maven but with jett-runner. You have to download 2 jars:
wget http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-websocket/8.1.4.v20120524/jetty-websocket-8.1.4.v20120524.jar
wget http://repo1.maven.org/maven2/org/mortbay/jetty/jetty-runner/8.1.4.v20120524/jetty-runner-8.1.4.v20120524.jar
build the war with:
mvn package
and than you can run it by:
java -jar jetty-runner-8.1.4.v20120524.jar --jar jetty-websocket-8.1.4.v20120524.jar --path /atmosphere target/atmosphere-chat.war
now you can open your browser to:
http://localhost:8080/atmosphere/
Ok something similar happened to me recently. Along with no message being sent, there were also 404 errors for all the JS files. Thats when I realized that trailing slash in http://localhost:9090/ is important :)