Cannot deploy using Apache Tomcat but deploying with Eclipse works - java

I'm trying to deploy my java app as a web service using Tomcat Apache. I put the .war file under the /webapps directory, run Apache, and when I try to access the url I get a 404 error.
I've created my app on Eclipse, and if I try to deploy it from Eclipse using a Tomcat server, it works, I can correctly access all my servlets.
What might I be missing / doing wrong?
Thank you,

You either have the wrong URL when you run outside Eclipse or the WAR file that you deploy is incorrect.
You should look at the Tomcat logs and console to see what messages it gives to explain what you did wrong.
Eclipse is just an IDE. Your code won't have access to it in production. Put aside that it works there and figure out what you did wrong with the package.

Related

Cant get tomcat to show webapp from deployed .war file

I followed a tutorial and am trying to learn to make my own web app. I am using Tomcat 8.0.47 and Spring MVC. Issue is I can go to localhost:8080 and see that the server is on but I cant see my basic webapp running when visiting localhost:8080/CrunchifySpringMVCTutorial page. I made a WAR file and dropped it into the /webapps/ folder inside tomcat folder and console shows that it deployed the war file. Any help is appreciated.
I am following this tutorial: http://crunchify.com/simplest-spring-mvc-hello-world-example-tutorial-spring-model-view-controller-tips/
rather than paste all the files I decided to link the guide. My set up is the same but cant figure out why it is not working. thanks.
Looks like the issue was that I needed to add the CATALINA_HOME system variable to properly setup my tomcat server

Tomcat couldn't see servlet

When I run my webapp with Netbeans it works perfectly, but I can't everytime for using this webapp open netbeans and run it. I download netbeans with apache tomcat, and with netbeans it works fine. But then when i need to run tomcat separately, i have problems. I run it, open webb app manager, deploy war file of my project. Then i try to run it, so i have first index.jsp page without problem, then it should do smth in servlet pages, this things doesn't work. So tomcat couldn't see servlet. I know that problem may be because I don't have web.xml file, it wouldn't generated automatically, because of mine is servlet 3.0 or smth, so i have this annotations #WebServlet(name = "zakaz", urlPatterns = {"/zakaz"}) but it still doesn't work. I can't understand why, do you have any ideas?
I get null pointer exception in Tomcat

War works fine on local standalone tomcat 7 (no eclipse), does not work when uploaded to ec2

I am able to get the spring blazeds examples and war (http://docs.spring.io/spring-flex/docs/1.5.2.RELEASE/reference/html/#pre-built-samples) working locally in tomcat 7 webapps directory (i initially had problems with this but now it works fine locally), however when I upload the same war file to amazon ec2, tomcats starts up fine and i can see the project's index page but none of the projects scripts are executing. According to the catalina.out log, the server started up successfully without any errors. Please help.
thanks,
tone
*Update
I am assuming that the problem resides in the blazeds portion of the project? Not sure if it is executing properly. i have enabled ports 8080 and 8400 in the security group.
Nevermind I found out the issue. i had to recompile the swf files that comes with the project to point to my ec2 instance url instead of localhost.

Deploy a .rar on cloudfoundry using eclipse plugin

I am currently using the cloudfoundry eclipse plugin to deploy my JSP/Servlet web application. My application is now using a Db (Sqlite). However I am having problem deploying the sqlitejdbc.rar to cloudfoundry (all i do to update the application is right click on my application under VMware Cloud-foundry server and select update. But that doesn't seem to work and i get an exception saying that it cant find the rar file.
In my local system i simply paste the sqlitejdb.rar to the lib directory of Tomcat and when i run the webapp locally it works
If you place the sqlitejdbc.rar file into your lib directory (inside your WEB-INF directory) that should get deployed as part of your application into cloudfoundry and become accessible.
You can also try to deploy your app using vmc push to see what errors you get from vmc.
I also recommend looking at the log files on cloudfoundry.com

Tomcat and web services

Hello I have a set of web services made in JAVA that are made using a Dynamic Web Project in Eclipse.
When i run an instance of Tomcat 6 in Eclipse and deploy the project on the server it works just fine, I am able to find the wsdl File and access it from a php script.
But when I export the Dynamic Web Proyect as a WAR file and deploy it on the webapps file inside the real Tomcat server, and start the server, I have no idea how to find the wsdl file or how to access it from my php scripts, its just not working.
Is there any thing i have to do to get this to work?
You should try to re-download Tomcat.
If you generate dynamic wsdl then . you can find it at URL something like
http://example.com/context/demo.wsdl
It will be easy to answer your questing if you post web.xml and other related xml config file.

Categories

Resources