I'm trying to run a simple JAX-WS example I found on the web. So I wanted to setup Tomcat 7 under windows xp using Eclipse Helios 32 bit as the web server.
I remembered I had to have my app added as a resource to the Tomcat server, but nothing is coming up as a resource to add. I just have WS-Server and WS-Client projects for the app.
I've done this before, checked the server.xml and see http 1.1 port is 8080, but when I start up Tomcat under eclipse I'm getting a 404 error with this url: http://localhost:8080/, so Tomcat isn't really running properly.
What am I missing here?
Thanks!
If you're getting a 404 - that means the web server is running. This likely means you don't have anything mapped to the path specified (no servlets/default web page/etc).
Either make a servlet and add it to your web.xml or define a home page html file.
FYI, if you use the "Dynamic Web Project" setup; most of this is done for you. Here is a youtube video I always default to when I need to get a review on how to set up a quick tomcat instance in eclipse.
Related
I have a spring boot java web server running in AWS elastic beanstalk that was created 3 years ago. I am trying to recreate it now using current versions of tomcat, eclipse and the AWS plugin and can't get it to work. I do not want to use spring boot again in this server but will if I have to.
No matter what I try I can't access a servlet in the web project, and all servlet requests result in 404 not found errors. Requests for static HTML pages work properly.
I have searched for answers and found some tips for old versions of tomcat (name your war ROOT.war) and a suggestion that using web.xml instead of modern servlet annotations will help. None of these suggestions solved the problem and I have tried many combinations of different versions of Tomcat and various servlet mapping techniques with no luck.
To ask for help, I have listed the following steps. I am suggesting Tomcat v7 because it uses web.xml as my old server did. I would be happy to use v8.5 if possible, or change any other step, to get this basic Hello World sample running in elastic beanstalk.
Here are the steps:
create new Dynamic Web Project (TestProject) in eclipse
target runtime = Tomcat v7 (which still uses web.xml)
web module version = 2.5 (which does not use annotations)
accept all other defaults
added index.html (to prove war is deployed in elastic beanstalk)
simple content, containing just a Hello World
add new servlet (org.example.TestServlet)
accept all defaults including generated eclipse code stubs
test static content in eclipse
select project, right click menu, Debug As / Debug on Server
can view index.html in browser
test servlet in eclipse
select TestServlet, right click menu, Debug As / Debug on Server
can view output: "Served at: /TestProject"
url is: http://localhost:8080/TestProject/TestServlet
export TestProject.war to disk
optimize for Tomcat v7
setup elastic beanstalk
create new web server environment
select Tomcat Preconfigured platform (this is v8.5)
upload TestProject.war
test static content in elastic beanstalk
request in browser: http://my-env.ejppddd6xm.us-east-1.elasticbeanstalk.com
can view index.html in browser
test servlet in elastic beanstalk
request in http://my-env.ejppddd6xm.us-east-1.elasticbeanstalk.com/TestProject/TestServlet
get HTTP 404 not found error
No matter what I change, the servlet test always results in a 404 error. I can do the same test on my old server built 3 years ago and it works.
I have also tried an AWS Java Web Project using the AWS plugin, but it results in a corrupt project with a low-level Maven error. I have reported this to AWS.
Can anyone suggest a change in the above steps that will result in successful servlet test within elastic beanstalk?
I'm currently running my Java application on a GlassFish server on AWS-EB.
Since our front-end is already running on the Google Cloud Platform, I would like to migrate my back-end to GCP as well.
I tried the Jelastic interface but I was not happy with the speed results.
Now I'm looking to deploy my application on the App Engine but when I deploy my current .war file, I get the following error:
Error 404 - Not Found.
No context on this server matched or handled this request.
Contexts known to this server are:
/ ---> o.e.j.w.WebAppContext#7e0b0338{/,file:///var/lib/jetty/webapps/root/,UNAVAILABLE}{/root.war} [failed]
I guess I'm missing something, since GCP is using Jetty as a server.
I'm a bit lost and I hope you guys can point me in the right direction to make this migration successful.
It's suggested here that Jetty requires two configuration files (web.xml and applicationContext.xml).
As well as this, the original poster in the issue above stated that they solved their issue in this GitHub post by rebuilding their project before deploying.
I was developing an application using my localhost apache-tomcat webserver. And when I was deploying my application using intellij idea, I had no problems with URL's, to reach an app I used URL:
localhost:8080
But now I tried to deploy my application on remote server installed on Ubuntu 10.04.4 LTS, and I got a problem with base URL change. I created a .war artifact and copied it with additional libraries to webapps folder of remote tomcat. The name of my project is Spider. After starting tomcat on remote server, I can only reach my application using URL:
serverIpAddress:8080/Spider
But because I have a /Spider in my base URL all my links on the pages does not lead to appropriate controllers, and I have 404 error. For example working link is: serverIpAddress:8080/googleApi, but link leads to serverIpAddress:8080/Spider/googleApi.
How can I solve this problem? Thank you in advance, and sorry for my poor English.
Your problem is that you are using absolute links, which is very bad practice. If you will have some proxy or load balancer before your app it will not work also. So the solution is to use only relative paths in all view pages. Another thing which is not good is using case sensitive characters, I would personally use only small ones especially on Linux platform. If you really want your app available as root you can deploy it by overriding ROOT directory in tomcat weapp, but please be aware that it will destroy tomcat standard Management GUI
i am trying to implement SSL in my web project. I created the keystore and made the necessary changes in the server.xml of tomcat. the ssl connection works fine when i am testing it by running the apache homepage.
next, i tried to implement this in my web project. i made the necessary changes to the web.xml. now, when i run the app, i get an error saying that "requested resource() is not found".
when i change the tag from CONFIDENTIAL to NONE, the app works fine, but not when set to CONFIDENTIAL.
Please help me out. I wonder what am i missing !!
and made the necessary changes in the server.xml of tomcat.
If run your web app from Netbeans check the server.xml of the Tomcat server displayed in the Service panel, because Netbeans installs Tomcat and configure a "catalina base" different from "catalina home".
So you might have changed the "catalina home" server.xml but not the "catalina base" server.xml actually used by Netbeans.
I followed this tutorial -documentation about Liferay Web service.
I runned Lifaray on tomcat
If I use http://localhost:8080/api/axis/Portal_UserService?wsdl by browser I have a response.
When I create a webService Client on Eclipse and I put this url http://localhost:8080/api/axis/Portal_UserService?wsdl in the Service Definition...
but I have this error message:
No server can be found and WebServiceProject does not exist. Choose an existing project or use the preferences to configure a server runtime.
Why?
create dynamic web project and configure a server then add wsdl .
This does not mean that the server (e.g. Liferay) can't be found but notifies you that Eclipse doesn't know where to put/how to configure the resulting WebService: It needs a server runtime and a WebServiceProject - e.g. you can create a WebServiceClient inside a project - if no suitable project exists, eclipse will complain.
So: Everything is fine on the Liferay side. You'll need infrastructure in your IDE to be able to go forward with this operation
I could not find any solution to this, for some reason Eclipse didn't recognize a valid wsdl. I downloaded a trial version of IntelliJ IDEA 13 Ultimate and setup the Web Service Client through there. Everything worked properly.