Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error 404 when trying to open my project in Tomcat
30-Nov-2016, 03:48 AM
Post: #1
error 404 when trying to open my project in Tomcat
Hello:

I'm brand new to this software. was trying to make sure all the settings where right. So I started a new project, left it empty. When you press "run test" you get a page that is basically an empty form that says "form details" and a "save" button

I am running a tomcat server as a service (on windows), which I can access at localhost/manager. I configured tomcat to listen to port 80 while I installed. I want to write an app for my intranet, and I don't want to have to use weird URL's with port numbers.

I set up the parameters for publishing, and when you press "publish" it publishes without errors.

I can see the .war file in the webapps directory, and I can see my project in the /manager screen. but when I click on it, I get a "status 404" error. I've tried to press the "reload" button in /manager, without errors.

Any ideas what to try?

Dan
Find all posts by this user
Quote this message in a reply
30-Nov-2016, 01:10 PM
Post: #2
RE: error 404 when trying to open my project in Tomcat
Hi Dan,

Welcome to the forum.
I'm sorry you are having trouble, but I am sure we can get this working for you.

If I understand correctly, you have a 'blank' project that is working fine in run test, but you are trying to make sure you can publish and deploy it to your target server.
It looks like you have successfully created and deployed the WAR file, but you can't seem to access the resulting application.

As there are no errors reported from Tomcat, my first thought would be to check the URL you are using to try and access the application. By default there is unlikely to be anything present to handle a request for the root of the application so this might be why you are getting the 404 error.
Can you try adding the action name to the end of the URL (eg http://localhost/<appname>/start.do or http://localhost/<appname>/startForm.do) to see if you then get a response?

If this works ok, then you should be able to solve your issue by adding an index.jsp file to the root of your project webapp with the following content:

JSP Code:
Line Numbers: ON/OFF - Expand: ON/OFF
<%
request.getRequestDispatcher("startForm.do").forward(request, response);
%>
JSP Code:
Line Numbers: ON/OFF - Expand: ON/OFF
  1. <%
  2. request.getRequestDispatcher("startForm.do").forward(request, response);
  3. %>

This should ensure that any requests to the root of the application (eg http://localhost/<appname>) get forwarded to the correct location. If required, you should change 'startForm' to the correct action name.

If you place this index.jsp file at <WebMaker install dir>/users/user1/<workspace name>/mvc/<project name>/webapp it should get included correctly when you publish the project again.

Hopefully this will resolve the problem.
If not, and you are unable to access the published application even when the correct action is added to the URL, we will need to look into the logs to try and debug further. In this case, if you can provide copies of the Tomcat log files, as well as the WebMaker log file from within the doc directory of the published web application, that would be great.

I hope this helps. Please let me know how you get on.

Regards,
Gerard
Find all posts by this user
Quote this message in a reply
30-Nov-2016, 05:41 PM (This post was last modified: 30-Nov-2016 05:41 PM by dullfig.)
Post: #3
RE: error 404 when trying to open my project in Tomcat
I can see part of the problem. The app is called QMS, but the qms root directory in the webapps directory is empty. there is a number of subdirectoryies, but no index.jsp file. in fact, there are no files in the root directory of the app.

does it make a difference that i am using the community version of WebMaker?
Find all posts by this user
Quote this message in a reply
30-Nov-2016, 05:58 PM
Post: #4
RE: error 404 when trying to open my project in Tomcat
Hi Dan,

The WebMaker version shouldn't make a difference for this.

There won't be an index.jsp file there initially so that is ok.

If you are able to access the form by adding the action name to the URL (eg http://localhost/qms/startForm.do) then you can just create a new index.jsp file, and give it the content from above.

Regards,
Gerard
Find all posts by this user
Quote this message in a reply
30-Nov-2016, 07:02 PM (This post was last modified: 30-Nov-2016 07:03 PM by dullfig.)
Post: #5
RE: error 404 when trying to open my project in Tomcat
ok, neither start.do or startForm.do worked. How do I know what *.do do I use? perhaps it's by another name?

to clarify, I used the complete URL http://grm/qms/start.do

also, the firewall is ok, I can access http://grm/manager
Find all posts by this user
Quote this message in a reply
01-Dec-2016, 01:04 PM
Post: #6
RE: error 404 when trying to open my project in Tomcat
Hi Dan,

The names of the *.do URLs are set by the action (line) names coming out of the pages on the Application Map. The exception being the start.do URL which is built in to always display the 'start' page.

If the app was running correctly and the wrong action URL was used, I would expect you to get an error page stating 'Unable to find mapping for URL...' instead of a 404 error anyway.

It looks to me like it has not deployed correctly, so we will need to look into the Tomcat logs to investigate this. Within your Tomcat installation directory there should be a logs sub directory containing a number of files. If you are able to send through any files that have recent content I can have a look at them to see if I can identify the issue.
It would also be worth checking if the WebMaker application itself has produced any logs by looking for a .../webapps/qms/doc/log.txt file.

Hopefully these logs will give us some pointers to resolve the issue.

Regards,
Gerard
Find all posts by this user
Quote this message in a reply
01-Dec-2016, 07:03 PM (This post was last modified: 01-Dec-2016 07:05 PM by dullfig.)
Post: #7
RE: error 404 when trying to open my project in Tomcat
well I'll be damned if this morning "start.do" works now!!!!

SO.... typing //grm/qms/start.do works. but plain //grm/qms doesn't. So I need to create some kind of index page?

oh wait, start.do only works from localhost, not remotely....

so there's some kind of permissions problem?
Find all posts by this user
Quote this message in a reply
02-Dec-2016, 01:50 PM
Post: #8
RE: error 404 when trying to open my project in Tomcat
Hi Dan,

That's good you have made some progress.

It looks like there are two issues to resolve.

The first is setting up the action to use by default if one hasn't been provided in the URL. You should be able to resolve this fairly easily by creating an index.jsp file as I mentioned previously.

The second issue is the access restrictions problem if not using localhost. I would guess this is likely to require some kind of configuration change either in Tomcat or your firewall.
If you are sure that the firewall is not blocking it, then I would concentrate on the Tomcat options.
I am not sure exactly what changes you may need to make, but hopefully you can find some helpful information online or in the Tomcat docs.

If you are still having issues, please let me know the versions of Tomcat and Windows you are using and I can try and look into it.

Regards,
Gerard
Find all posts by this user
Quote this message in a reply
02-Dec-2016, 05:35 PM
Post: #9
RE: error 404 when trying to open my project in Tomcat
very good. I'll look into the Tomcat configuration, and see what happens
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Tomcat 64 bit query kidder 2 787 10-Dec-2015 04:40 PM
Last Post: kidder
  Recreating WM Project from Published Application Kevin 2 1,443 29-Nov-2014 06:47 PM
Last Post: Kevin
  Remove published project from server ghensley_csuf 2 4,255 17-Dec-2012 08:55 PM
Last Post: ghensley_csuf
  Reason for error: Cannot map request to a valid application. Craig 0 1,876 09-Jul-2012 12:47 PM
Last Post: Craig
  Error - The submitted request did not contain a valid XML document. ghensley_csuf 5 3,755 13-Mar-2012 04:32 PM
Last Post: ghensley_csuf

Forum Jump:


User(s) browsing this thread: 1 Guest(s)