Tomcat 5.5: The requested resource is not available [duplicate] - java

This question already has answers here:
Servlet returns "HTTP Status 404 The requested resource (/servlet) is not available"
(19 answers)
Closed 6 years ago.
I'm having some trouble getting my web app to launch on my server. The URL is:
http://www.apollowebworks.com/kmsales/ItemSearch.do
It used to work fine, and still runs on my local build using Eclipse. I noticed it wasn't working anymore sometime after my hosting provider informed me that they were migrating to a new server.
This is the error I'm getting:
HTTP Status 404 - /kmsales/ItemSearch.do
type Status report
message /kmsales/ItemSearch.do
description The requested resource is not available.
Apache Tomcat/7.0.42
I find it suspicious that it's posting "Apache Tomcat/7.0.42". My host has Tomcat 5.5. I am running it on a 5.5 build locally. I was initially running it on a higher build, and I'm thinking maybe some of my xml files or jars might still reference the wrong Tomcat somehow. I can't find that anywhere though. Any idea where else to look?
The libraries I'm using are:
javacsv.jar
jstl.jar
mysql-connector-java-5.1.15-bin.jar
standard.jar

You said "migrating to a new server". This is most likely why you see there Tomcat 7. I think you need to check with your provider to see what exactly they migrated. Maybe your app wasn't copied to the new Tomcat. In any case you really need to see if your app is there where it should be and, if it is, check the log files.

Related

HTTP Status 404 - on Eclipse with Tomcat (with no generated web.xml) [duplicate]

This question already has answers here:
Servlet returns "HTTP Status 404 The requested resource (/servlet) is not available"
(19 answers)
Closed 3 years ago.
I'm working on an example with Eclipse and Tomcat 9.0, dynamic web module 4.0, without generating web.xml deployment.
The project directory is as follow:
where reverse.java is a servlet that get the input parameter send it back to the output page.
For some reason, after I hit the submit button, the "/reverse" servlet cannot be reached and tomcat prompts HTTP Status 404 - Not Found page. What did I do wrong?
After hitting the submit button on inputForm.jsp page, it got the error:
Type Status Report
Message /reverse
Description The origin server did not find a current representation
for the target resource or is not willing to disclose that one exists.
URL I called on submit when enter input = "abcd": http://localhost:8080/reverse?input=abcd
What did I do wrong? Thanks.
If you didn't set set context root explicitly, it is set by default to the same name as your project. If your project name is "bla", then the URL to call the servlet should be following: http://localhost:8080/bla/reverse.

Apache jMeter is not generating ApacheJMeterTemporaryRootCA.crt certificate for http request recording

I'm following step by step this tutorial to create the certificate ApacheJMeterTemporaryRootCA.crt.
http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf
However after I hit run nothing related to certificate is showing up, as if I was just running a simple test without recording. It's not even displaying error messages. I have read these threads but they are not helpful for my case:
Does any
- Apache jMeter not generating ApacheJMeterTemporaryRootCA.crt for https recording
- ApacheJMeterTemporaryRootCA.crt not generated
I am using Java 1.7.0,67, Jmeter 2.13 (both are newest versions). I have also followed this page to set up my environment variables
https://wiki.apache.org/jmeter/TestRecording210
Does anyone has an idea about what is missing here?
Thanks a million!!
I had a problem where I'd deleted the certificate and struggled to get it to regenerate.
In the bin folder there is a keystore file called proxyserver.jks, when I deleted that the certificate regenerated on the next start of the test script recorder
In the absolute majority of cases jmeter.log file contains all the answers or at least can help to figure out the cause of the problem.
If below checklist doesn't help - update your question with relevant bit of the JMeter log file.
Use JDK, not JRE
Make sure that you have the following environment variables set:
JAVA_HOME - pointing to JDK installation root
PATH - contains /bin folder of JAVA_HOME
If you using web browser for recording make sure that
"HTTP Proxy" is set to correct JMeter host and port
"Use proxy for all protocols" box is checked
"No proxy for" input doesn't filter out JMeter host (you can clean it)
Refer below image for example proxy settings for Firefox browser:
The easiest way to set up JMeter for recording is using Recording Template (File -> Templates -> Recording), this way you can get JMeter configured for recording in a single click
If above checklist didn't resolve your problem check out Recording HTTPS Traffic with JMeter's Proxy Server guide for troubleshooting tips.
Navigate to HTTP(S) Test Script Recorder, and click the Start button at the bottom.
http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf
This will start the JMeter proxy server which is used to intercept the browser requests.
A file called ApacheJMeterTemporaryRootCA.crt will be generated in jmeter/bin folder.
Possibly you run test instead of starting proxy server.

Constant warning when running tomcat from intellij

All of a sudden, when i run tomcat from within intellij, the output console is constantly bombarded with messages.
(very) short video showing this:
http://screencast.com/t/ddBhIh3UZiA
The messages constantly output is:
16:05:31,157 WARN http-nio-8222-exec-1 servlet.PageNotFound:198 - Request method 'HEAD' not supported
16:05:31,158 WARN http-nio-8222-exec-2 servlet.PageNotFound:1120 - No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'dispatcher'
I am using Spring 4.1 and tomcat 8.
Java 8 and Windows 8.1
This phenomenon didnt use to happen before and it suddently started occuring. What is going on?
I'm having the exact same problem. If you have your Tomcat run configuration set to open a browser on launch, IntelliJ will try to ping the website to ensure it's up prior to opening the browser. I believe it's doing HEAD requests and since your site isn't set to answer / HEAD requests, you get the error.
Unchecking the "After launch" checkbox under "Open browser" in the server tab of the run configuration fixed it for me.
As for getting JetBrains to fix this, I'm not sure what to do about it. I did just upgrade to 14.0.3 so that might be the cause...
Solved by JetBrains in this ticket, and if you want you can change a Jar to avoid the regression.
https://youtrack.jetbrains.com/issue/IDEA-135196
It seems your client is using HEAD has the request method. It is similar to GET but it says to the server that it must not return message-body in the response.
Either check your pages or client for HEAD requests or accept HEAD as RequestMethod like this:
#RequestMapping(method = {RequestMethod.GET, RequestMethod.HEAD})

Error pages in Grails app hosted using IIS 7 / Tomcat connector

I have a Grails application that is running in Tomcat 7 under IIS 7, using the Jakarta Isapi Tomcat connector version 1.2.30 and I'm having trouble getting the error handling to behave how I'd like. The Tomcat connector is configured in uriworkermap.properties to forward all requests below the application's URL to Tomcat:
/OrderSubmission/* = worker1
The Grails application has its own custom error pages which work fine when the application is running on a development machine without IIS / the Tomcat connector, but when on the server, if custom error pages are switched on in IIS, these always override the ones in the Grails application. This means that where I have a specific page to handle a certain exception type, e.g. in UrlMappings.groovy:
"500"(controller: 'error', action: 'itemNotFound', exception: ItemNotFoundException)
...I'm instead seeing the static 500 error page that I've pointed IIS at.
If I instead turn on detailed errors in IIS I get the correct error pages through from my Grails application - however, if a request is made for a URL outside of the application's context, I then see the detailed IIS 404 page, which is unacceptable. If I change the Tomcat connector's uriworkermap.properties to include everything from the root downwards then I instead see a default Tomcat 404 error page. I've tried getting the Tomcat connector to default to custom pages by setting the error_page option in isapi_redirect.properties to point to my IIS static custom pages like so:
error_page=/%d.htm
...but this doesn't work, and I can't find any example of using this setting anywhere.
What I need to happen is for the custom Grails error pages to be shown - unless the URL being requested is outside the application or the application is down, at which point I need custom static error pages to be shown.
Has anyone managed to achieve this?
TIA
I ended up making my error page controller methods return a status of 200 (OK), unless dealing with an AJAX request:
class ErrorController {
def pageNotFound() {
if (!request.xhr){
response.status = 200
}
}
}
IIS is set to 'Custom error pages'.
This prevents IIS stepping in and providing the custom static pages that I provide, unless the requested URL is outside the scope of the Grails application.
The error status is retained for AJAX requests in order to allow the caller to properly deal with the result.
I'm unsure whether it's satisfactory practice to return 200 from the application on error, particularly with regard to search engines - however it seems that even without this change, when an error occurs and the response is ultimately returned to the browser from IIS it has a status of 200, according to Fiddler.

how to solve error http status 404 in servlet jsp [duplicate]

This question already has answers here:
Servlet returns "HTTP Status 404 The requested resource (/servlet) is not available"
(19 answers)
Closed 6 years ago.
I am trying to run some basic servlet and jsp program with Tomcat. but it gives some error.
I am using Tomcat 6.0.29 and jdk 1.6.0_21.
When i click on WebAppl link in Tomcat then it gives below error
HTTP Status 404 - /WebAppl/
type Status report
message /WebAppl/
description The requested resource (/WebAppl/) is not available.
I tried another code which was running properly on Tomcat 5.5.9. But still gives same error here.
HTTP Status 404 - /SampleAppl/
type Status report
message /SampleAppl/
description The requested resource (/SampleAppl/) is not available.
What should I do to solve this error?
Is it because of new version of Tomcat? Can anyone guide me.
Either you are not using the right URL to access the web application, or you had an error when deploying. Have a look at the Tomcat server logs to see if there is anything in there.
Also the management console might help you getting the URL right.
It looks like your web applications are not deployed. Check carefully the log files of the booting of your tomcat. It will indicate when it starts deploying your webapps and why they failed.
The stacktraces stick out like a sore thumb and following the Up, or looking in down for 'Caused By' lines usually gives a reason why they do not deploy.
If you are stumped you may want to post some parts to this site to ask for guidance.
Your project hierarchy is the one that needs to be checked
project-
src-
servlet
webcontent-
web-inf-
web.xml
index.jsp
Your url will be http://localhost:8080/project
You say you are using tomcat. In that case check the $tomcat/webapps directory. There should be a WebAppl and a SampleAppl directory (and/or war) in there.
Als check the $tomcat/logs directory and read catalina.out (the logfile). Check for Exceptions and the text deployed. You would expect that it says that application WebAppl is deployed.
Of course,you do have to connect to your tomcat. Tomcat is usually listening in port 8080 (check $tomcat/conf/servlet.xml). It could be that you are connecting to another application at port 80 (the http default, usually Apache or IIS).
If it is in port 8080, your URL should look like: http://localhost:8080/WebAppl
Might be
1)Don't violate folder creation structure hierarchy and place corresponding files
2)web applications are not deployed
3)right URL to access the web application
4)Container not yet started(because check out the port numbers that may clash with earlier configured setups )
It could be due to missing tld files in WEB-INF directory which are being used, inside JSP, example JSTL Core.
<c:out value="${salary}"/>

Categories