Tomcat and web services - java

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.

Related

Cannot deploy using Apache Tomcat but deploying with Eclipse works

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.

java.io.filenotfoundexception jboss project localhost

I've been working on web project written in jsp and running on jboss. I have problem after deployment of project. I'm getting an error after hitting localhost:8080/Myapp : java.io.filenotfoundexception Null/easyfile.properties <Can't find easyfile.properties>. I have this file in conf folder in my app directory. For sure I need to properly point to this file or place it somewhere in jboss installation folder but unfortunately I'm new to Java and 've been working with PHP but I've been assigned to client who has home site written as one jsp site with some xml. I need to change their frontend a little bit but I'm trying to set up my local environment without success.
Any help would be great.
Regards Adam

Website directory structure different from eclipse

I am coding a website using java servlets and am using eclipse and tomcat. When I test it using localhost, it works fine. But when I am deploying it on my actual website, the directory structure is messed up and the files are not called properly.
My eclipse directory structure on localhost is
Project Name
.src/packageName/java files
.WebContent/HTML files.
When I make a call from the html files, I use the relative location and tomcat automatically knows to look in the src/packageName folder. For example, from the /WebContent/login.html page makes a onClick call as follows,
. This will automatically trigger the java file in /src/packageName/welcome
When I am deploying it in my actual website, the WebContent/login.html is throwing an error WebContent/welcome file is not found. How do I tell my website to search in /src/packageName folder?
Hmm...have you been sure to package the application as a war for deployment.

How to run a JSP website in localhost ? What is the environment to set up?

I am a PHP programmer.But i have a website code which was developed in jsp technology..
I dont know the environment of jsp engine. I wan to run my website in my localhost using Tomcat server..Please help me to do that...
You first need to install and download Tomcat. Of course you need to have a Java runtime in your machine. The website should have been given to you as a WAR file. To install it, simply copy the WAR file in the webapps folder of Tomcat. If you only have a bunch of JSP files, put them in the ROOT folder of Tomcat.

Web Services in Unix. What should be the directory structure

I earlier got to create a simple RESTful webservice on my localhost using Eclipse IDE, Tomcat, and JAX-RS libraries.
I am now trying to move the same on to a different unix server which has Tomcat installed. I am not knowing how to get started as in what is equivalent to creating a "Dynamic Web Project" that I do in Eclipse. Do I need to just create a directory myself with all the sub-directories as created by Eclipse? Should this directory be placed in webapps folder in Tomcat container. Should META-INF and WEB-INF also be created by myself?
Where should I put my Java classes?
Can somebody please clarify this or direct me to any documentation about the same.
You need to package your application in a WAR file.
The Sun Java EE 6 Tutorial has a chapter deciated to packaging.
It's pretty easy to export a web application as a war in Eclipse.
Dynamic Web Project (right click) => Export => Web =>war file =>war export dialog
Creation of web application archive - WAR is the solution for your problem,
but take care about all libraries that you need there.
You can easily extract (unzip) WAR file content
and check your project structure and libraries needed
and they will be in WAR's WEB-INF/lib.
Make sure that both Tomcats are set same way,
make sure your code is all OS friendly (users, file paths, permissions)
Always write some test simple code that will run up on app start,
and check all dependencies and libs, system clock, outside world network communication, so you can trace it in web app console or logger easily.
regards

Categories

Resources