I have created a jersey web-service in Java and I have the following issue:
When I run the project in my localhost apache tomcat server, I call it with the URL localhost:8080/api/verify? and I haven't any problem.
When I upload it in my web-hosting and I call it with URL myDomainName/api/verify? I get 404 error.
Does anyone know why it's happened?
Thank you in advance
Check your web service to be deployed and successfully started (on 80 port).
Check your hosting security settings to allow access to /api/*.
Please try what others have suggested and also check if your domain name (myDomainName) is the correct one. If you have packed your projected as a war check the name of the generated folder.
Check your DNS server, your firewall, and your load balancer to make sure they are pointing to your app.
Verify if you are using http or https.
Edited to add: make sure your default tomcat port 8080 is there in the load balancer (if you have one). If you don't have one yet try http://yourDomainName:8080/api/verify and see if that's all you need.
Thank you all for your responses.
The problem was resolved by my web hosting support.
The solution was the following:
He changed the mappings (mod jk tomcat connector ) from .jsp to / to fix the issue.
Related
Today only I heard about the Thoughtworks GO and started the installation configuration. Windows Installation is went well and I am able to run the server over HTTP using 8153 ports.
Then I have installed agent in the same box using the localhost. What i am not able to figure out is how to connect the agent automatically using HTTP ? I am getting error in the go agent log that is trying to access the https : //localhost :8153 I am right now not concerned with HTTPS and all. all I want to register the Agent.
One more thing just for FYI. I have enabled user authentication file based. that is working fine.
Please suggest if there is alternate way to change the URL Protocol to HTTPS.
Finally I run the manual installation by downloading the zip for the go server and then I got the server running with both HTTP and HTTPS without any additional efforts.
This answer will be useful is the installation is having issue with the windows installer. Use the zip.
Thanks.
Praveen
While deploying my app to mochahost, I met the problem between servlet and GWT-RPC communicate. The error shows:
HTTP Status 404 - /403.shtml
type Status report
message /403.shtml
description The requested resource (/403.shtml) is not available.
.war file works perfectly on my workstation, but not working on mochahost.
Any ideas to solve it?
Thanks in advance.
Mochahost have a very good support, try livechatting with their tech department, you will probably have the thing solved.
That's what I do.
Make sure you update live site URL. For instance, generally, on local system you access web app as http://localhost:8080/myapp but, on server it changes to http://[www.]myapp.com. Again, this is just an instance. The point is, the live site must reflect correct URL from code (servlet/JSP/action/etc...) and configuration properties, if any.
Comment 'DirectoryIndex' property in .htaccess file if you do not have any index file.
Comment 'RewriteCond' property in .htaccess file if you do not have any rewrite requirement.
For sure, one of the reason - if client does not accept cookies and servlet does not encode URL.
i am building a web service on eclipse using Apache AXIS 2 Webservice runtime using Apache Tomcat server (apache-tomcat-7.0.23) while running it on tomcat server it sucessfully shows that the web service is running...
But while creating Webservice client to test the web service and using the wsdl url in the server definition (http://localhost:9090/Axis2WSTest/services/Converter?wsdl), this gives below mentioned error and not letting me to create Webservice client:
The service definition selected is invalid
Can you please suggest me the error and possible solution for it?
The problem could be that your wsdl needs http authentication. I was getting the same error in eclipse, but it was because the server I was connecting to needed authentication and was returning a 401 error, so eclipse was saying it wasn't a wsdl. Eclipse doesn't seem to have the functionality to prompt for authentication, I was able to generate a client in netbeans using the same wsdl url because netbeans knows to ask for authentication.
Generate client from http authenticated wsdl
I was searching for the whole day for an answer for this,generally localhost will be added in your bypass proxy list and hence you will not encounter an error.
Go to windows--> preference-->general--> network-connection and see whether localhost is listed in your proxybypass list.If you are trying to access a external wsdl link and you under
some corporate network having proxy firewall you have to set http proxy/https proxy.
Is this how you are trying to generate client stub ?? If yes, just simply create a java project in eclipse, click on it, then press Ctrl+N, select web service client and enter your wsdl url. (make sure you have made sure you can access the wsdl url, by simply giving it in a browser).
Try replacing localhost with the actual IP address. I was facing the same problem and it worked for me this way
I had exactly same situation. For me the following worked:
I got the lead from rdp's response - "Try replacing localhost with the actual IP address. I was facing the same problem and it worked for me this way"
Using IP didn't work for me. What worked for me:
Instead of - http://servername/SomeWebService/Service.asmx?WSDL
putting FQDN for servername. For example -
http://servername.my.company.com/SomeWebService/Service.asmx?WSDL
I had the same issue and I was able to generate the stubs using soapUI. Please follow the this post. Which contains GENERATING CLIENT JAVA CODE FOR WSDL USING SOAP UI – AXIS2 WSDL2JAVA. Before that please download apache axis2 binary from here and extract it.
Is there a way to retrieve the absolute path of url (http://localhost:8080/myApp) in java. The scenario is, i need to connect to csv file located in tomcat server. The statement works well if I enter the absolute path, but is there a solution to retrieve url's path using getAbsolutePath().Sorry if I'm wrong.
Connection conn = DriverManager(getConnection("jdbc:relique:csv:/home/apache-tomcat-6.0.26/webapps/myApp/"))
Thanks in advance.
You can use ServletContext.getRealPath(), which does exactly what you want.
Note that it does not necessarily work in all situations. For example, if your Tomcat is configured to deploy the .war file without unpacking it, then this will return null.
I don't know much about JAVA.
May be getServletContext().getContextPath() is something you are looking for
EDIT:
Or may be getRealPath()
Tomcat is not a http server. All tomcat urls reference services, not files.
You'll have to implement another service that sends the csv file on request, if you want to get it through any http URL. URL's like http://localhost/myapp/input.csv require a http server like apache httpd.
(Hope I got your question correct...)
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}"/>