lani1234 Posted December 23, 2013 Author Posted December 23, 2013 I am wondering if now it is a database connection issue. When I go directly to the URL of the servlet: http://lani1234.heliohost.org/TestingWarFileOnHelioNEW2/LoginServletthe application behaves how it is supposed to, which is to redirect to another jsp that just displays a message about the user trying to log in. But when I try to connect through the main jsp page (that is index.jsp --> Servlet --> Result.jsp), I am still not getting through correctly.
Krydos Posted December 26, 2013 Posted December 26, 2013 Perhaps http://wiki.helionet.org/Java_Servlet#Edit_index.jsp_Source will help you?
lani1234 Posted December 26, 2013 Author Posted December 26, 2013 Thank you. I have created a hello world project like the one in this tutorial, using the link URL that you have shown. That very well may be the problem. My URL to connect to the servlet didn't include the project name previously. I have removed the part where I try to connect to the database just to make sure this works without the database. If this works, I will add the database connection back in and try it again. Uploaded new war file...
lani1234 Posted December 27, 2013 Author Posted December 27, 2013 The full URL to the servlet seems to have worked. That is "../nameOfProject/NameOfServlet"Now I am going to add a database connection back in, and a redirect to another resulting jsp from the servlet. For the redirect back to a jsp from the servlet, I thinkrequest.getRequestDispatcher("/result.jsp").forward(request, response); will work without the project name, but we will have to see. Uploaded new war file...
lani1234 Posted December 28, 2013 Author Posted December 28, 2013 I have success with the database connection now. I have one more test war file to upload and test. It is unclear to me if I need the full URL to a servlet inside an ajax call, but I would guess that I do. Once I know that my ajax is working correctly, I can rebuild the application that I was hoping to host in the first place. Thank you for helping to problem solve. I hope this thread will help others. They key was really in that complete URL to reach the servlet. I have never seen it done this way but I am glad to have figured out why the project would work on a few other servers but not on heliohost.
lani1234 Posted December 30, 2013 Author Posted December 30, 2013 My application needs to be able to change from one jsp page to another jsp page.The following 2 lines of code work within an ajax function on my machine: window.location.href = "redirectPage.jsp" and window.location.href = "../TestingHelioWarWithDB/redirectPage.jsp" But when my war file is deployed on your server, I get a 404 error: HTTP Status 404 - /TestingHelioWarWithDB/redirectPage.jsptype Status reportmessage /TestingHelioWarWithDB/redirectPage.jspdescription The requested resource is not available. Apache Tomcat/7.0.32 Are there any error logs specific to this issue that you can see??
Krydos Posted January 3, 2014 Posted January 3, 2014 catalina.2013-12-22.log:INFO: The start() method was called on component [standardEngine[Catalina].StandardHost[localhost].StandardContext[/lani1234_TestingWarFileOnHelioNEW2]] after start() had already been called. The second call will be ignored. catalina.out:INFO: The start() method was called on component [standardEngine[Catalina].StandardHost[localhost].StandardContext[/lani1234_TestingWarFileOnHelioNEW2]] after start() had already been called. The second call will be ignored. catalina.out:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: User lani1234_lani already has more than 'max_user_connections' active connections and a whole bunch of these catalina.out:SEVERE: The web application [/lani1234_TestingHelioWarWithDB] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
lani1234 Posted January 5, 2014 Author Posted January 5, 2014 In my project, in the Web Content folder, I have one folder with all my style sheets in it, and another folder with all my images in it. When you deploy my war file, I am getting a 404 file not found for me style sheets and images. I tried using the full URL: <link href="../CandCForHelio/css/styleLogin.css" rel="stylesheet" type="text/css" /><img src="../CandCForHelio/images/usernameText.png" class="label" /> Can you please explain how to make this work on your server? This isn't shown in your little servlet tutorial. Is there any way to make it so that we can deploy our own .war files? It is very frustrating to have to wait over 24 hours just to find out that it still doesn't work and it's a painfully slow process for debugging.
Krydos Posted January 10, 2014 Posted January 10, 2014 It wasn't that long ago that there wasn't any way at all for users to deploy war files. Scripts like this have to be tested thoroughly before they can be allowed to run fully automated. You have to remember that you're not the only user on the server, and if the deployment of your war causes high load or crashes the server it doesn't just effect you, but the thousands of other users too. Obviously the plan is to allow users to deploy their own wars eventually, but since only a couple of users have even wanted to deploy wars we are still developing the process for deployment.
Recommended Posts