Jump to content

[Solved] Why My War Won't Work On Your Server


lani1234

Recommended Posts

I created the most minimal project to narrow down the problem of deploying my war on your server. It works on my machine, so I don't understand why deploying it on your server would make it stop working. The main jsp page is trying to access a Servlet and the Servlet is not being found. Any ideas why? Have other people been having this problem? I'm not sure what to change since I have it working on my computer.

Link to comment
Share on other sites

When you type in a username and password and hit submit, the form is submitted to a Servlet called LoginServlet to handle the "login". The servlet will then search for the username and password in a MySQL database, and send a message to another jsp page to display the results. The servlet should be reached whether the username and password are in the database or not but it is giving a 404 error /LoginServlet not found. I haven't gotten as far as checking if the database is being accessed because it's not getting to the servlet.

 

 

More details: The error I am getting when I click submit looks like this:

 

Not Found

 

The requested URL /LoginServlet was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/0.9.8e-fips-rhel5 mod_mono/2.6.3 mod_jk/1.2.35 FrontPage/5.0.2.2635 mod_bwlimited/1.4 mod_auth_passthrough/2.1 mod_wsgi/3.4 Python/2.7.4 Server at lani1234.heliohost.org Port 80

Link to comment
Share on other sites

Any ideas why it isn't working? I am working on somewhat of a deadline. I would really appreciate any input you might have.

 

It seems that it would have to do with the mappings. Do they have to be reconfigured some how to work when deployed on the heliohost server versus my local tomat?

Link to comment
Share on other sites

Can you please help me to figure out why this isn't working on your server? Does anyone else running a java web application have this problem using JSP's and Servlets? I don't understand why it would work on other servers and not yours. Do you have error logs somewhere? This is the error that I get when you click the submit button from the main page:

 

Not Found

 

The requested URL /LoginServlet was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/0.9.8e-fips-rhel5 mod_mono/2.6.3 mod_jk/1.2.35 FrontPage/5.0.2.2635 mod_bwlimited/1.4 mod_auth_passthrough/2.1 mod_wsgi/3.4 Python/2.7.4 Server at lani1234.heliohost.org Port 80

Link to comment
Share on other sites

No, as far as I know no one has had this problem before, and there are many working .war servlets on the server. The user with the username infopar has had a lot of issues with his applications too, but since he's Italian it seems like we may have had some communication issues both him understanding us and him explaining what it was he was doing to fix the issues he was having. I even asked him to try to help Heliohost as a whole http://www.helionet.org/index/topic/15488-problem-with-struts/page__view__findpost__p__91223 by posting what changes he made to get things working, but it seems he was only interested in getting his .war working not helping future users.

Link to comment
Share on other sites

I am looking for anything that would explain why I am getting the error that says "The requested URL /LoginServlet was not found on this server."

If it works on my machine and on another server, why doesn't it work on your server? Something is blocking the application from reaching the servlet. Another possibility is that access to the database is being blocked. So any error logs that say anything about the servlet path or about database access would be helpful. Thank you

Link to comment
Share on other sites

Ok, I played around with your servlet a bit and I may have some ideas for you. If you go to

 

http://lani1234.heliohost.org/TestingWarFileOnHelioNEW

 

it displays the username and password boxes correctly, but when you click submit it goes to something like

 

http://lani1234.heliohost.org/LoginServlet?username=admin&password=pass

 

See how the TestingWarFileOnHelioNEW disappears? That's why it give you the 404. If we manually reenter the missing servlet name you get a useful error message at

 

http://lani1234.heliohost.org/TestingWarFileOnHelioNEW/LoginServlet?username=admin&password=pass

 

So, you have two errors to fix:

 

1. Make sure the servlet name doesn't disappear when switching between pages.

2. That "unsupported major.minor version 51.0" error means that you're compiling your classes for java 1.7 still when I already asked you to compile for 1.6 (50).

 

Hopefully that helps you a bit.

 

1.8 = 52
1.7 = 51
1.6 = 50
1.5 = 49
1.4 = 48
1.3 = 47
1.2 = 46
1.1 = 45

Link to comment
Share on other sites

Thank you so much, this is much more helpful. I am going to try to tackle one problem at a time. Because of the unsupported major/minor version error, I was able to discover that while I did change my project build path to use java 1.6, my IDE didn't automatically change the compiler version, so it was still compiling with 1.7. I have fixed that now and dropped a new war into my home directory.

 

For the issue where you're saying the servlet name disappears, I think that that is just because in my form with the submit button, I am using method=get as opposed to method=post. When you use method=get, you'll see the parameters in the URL. So let's start with debugging the java version first and see if that gets us somewhere.

 

I really appreciate your help looking in to this.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...