reset password
Author Message
cysun
Posts: 2935
Posted 09:02 Apr 13, 2009 |

As mentioned in Homework 2, if you use Dynamic Web Project in Eclipse, deploying the application on CS3 takes two simple steps:

  • Transfer all the files under the WebContent folder to the www folder under your account on CS3.
  • Transfer all the files under the build/classes folder to the www/WEB-INF/classes folder under your account on CS3.

Note that subfolders must be preserved during file transfer.

After the application is deployed, you can access it at http://cs3.calstatela.edu:8080/<username>/ (assuming you have an index/welcome file), e.g. http://cs3.calstatela.edu:8080/cs520stu31/, or access a servlet directly at http://cs3.calstatela.edu:8080/<username>/<servlet_name>.

Sometimes you may encounter an error "HTTP Status 503 - The application is not currently available".  This error is usually caused by the web.xml file containing the declaration of a servlet that does not exist. For example, suppose you have the following in your web.xml:

<servlet>
    <servlet-name>HelloServlet</servlet-name>
    <servlet-class>cs520.servlet.HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>HelloServlet</servlet-name>
    <url-pattern>/HelloServlet</url-pattern>
</servlet-mapping>

If you don't have HelloServlet.class under WEB-INF/classes/cs520/servlet/, Tomcat will not be able to load your application, and you'll get the 503 error.

If Tomcat fails to load an application, it won't automatically try to reload it later - the application or Tomcat will have to be manually restarted. So if you encounter the 503 error, please first make sure all the servlets declared in web.xml exist, and then contact me so I can restart the application or the server.

Note that Eclipse does not automatically update web.xml when you delete or rename a servlet, and this could lead to the 503 error when you deploy your application on CS3. In other words, when you delete/rename a servlet, remember to manually delete/edit the <servlet> and <servlet-mapping> entries for the servlet in web.xml.

jberney
Posts: 5
Posted 01:30 Apr 16, 2009 |

I'm getting the 503 error. Here's my tomcat url: http://cs3.calstatela.edu:8080/cs520stu26/

I'm attaching the following screenshots:

  • webdotxml.png - The content of my web.xml file on the cs3 server
  • classes.png - The servlet class files (and locations)

I think I've done it right. It works locally through Eclipse. I'm guessing Tomcat just needs a restart, but thought I'd post this to check.

-Jonathan

Attachments:
Last edited by jberney at 01:39 Apr 16, 2009.
cysun
Posts: 2935
Posted 09:09 Apr 16, 2009 |
jberney wrote:

I'm getting the 503 error. Here's my tomcat url: http://cs3.calstatela.edu:8080/cs520stu26/

I'm attaching the following screenshots:

  • webdotxml.png - The content of my web.xml file on the cs3 server
  • classes.png - The servlet class files (and locations)

I think I've done it right. It works locally through Eclipse. I'm guessing Tomcat just needs a restart, but thought I'd post this to check.

-Jonathan

I restarted the server. The application seems to be working now.

abhijeet_ubale
Posts: 10
Posted 13:30 Apr 16, 2009 |
cysun wrote:

As mentioned in Homework 2, if you use Dynamic Web Project in Eclipse, deploying the application on CS3 takes two simple steps:

  • Transfer all the files under the WebContent folder to the www folder under your account on CS3.
  • Transfer all the files under the build/classes folder to the www/WEB-INF/classes folder under your account on CS3.

Note that subfolders must be preserved during file transfer.

After the application is deployed, you can access it at http://cs3.calstatela.edu:8080/<username>/ (assuming you have an index/welcome file), e.g. http://cs3.calstatela.edu:8080/cs520stu31/, or access a servlet directly at http://cs3.calstatela.edu:8080/<username>/<servlet_name>.

Sometimes you may encounter an error "HTTP Status 503 - The application is not currently available".  This error is usually caused by the web.xml file containing the declaration of a servlet that does not exist. For example, suppose you have the following in your web.xml:

<servlet>
    <servlet-name>HelloServlet</servlet-name>
    <servlet-class>cs520.servlet.HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>HelloServlet</servlet-name>
    <url-pattern>/HelloServlet</url-pattern>
</servlet-mapping>

If you don't have HelloServlet.class under WEB-INF/classes/cs520/servlet/, Tomcat will not be able to load your application, and you'll get the 503 error.

If Tomcat fails to load an application, it won't automatically try to reload it later - the application or Tomcat will have to be manually restarted. So if you encounter the 503 error, please first make sure all the servlets declared in web.xml exist, and then contact me so I can restart the application or the server.

Note that Eclipse does not automatically update web.xml when you delete or rename a servlet, and this could lead to the 503 error when you deploy your application on CS3. In other words, when you delete/rename a servlet, remember to manually delete/edit the <servlet> and <servlet-mapping> entries for the servlet in web.xml.


Prof. Sun,

Is there some sort of caching on the server. My .JSPs do not reflect the changes I have made. I tried refreshing the browser several times, and also deleting the .JSPs from the server and re-deploying. Can you pls. suggest? Thank you.

Regards,

Abhijeet

cysun
Posts: 2935
Posted 14:02 Apr 16, 2009 |
abhijeet_ubale wrote:


Prof. Sun,

Is there some sort of caching on the server. My .JSPs do not reflect the changes I have made. I tried refreshing the browser several times, and also deleting the .JSPs from the server and re-deploying. Can you pls. suggest? Thank you.

Regards,

Abhijeet

It sounds like IE browser cache. It's not a server problem unless you got some kind of error.

abhijeet_ubale
Posts: 10
Posted 14:44 Apr 16, 2009 |
cysun wrote:
abhijeet_ubale wrote:


Prof. Sun,

Is there some sort of caching on the server. My .JSPs do not reflect the changes I have made. I tried refreshing the browser several times, and also deleting the .JSPs from the server and re-deploying. Can you pls. suggest? Thank you.

Regards,

Abhijeet

It sounds like IE browser cache. It's not a server problem unless you got some kind of error.


I tried using the different browsers from different machines. But the same results. To check if my changes are taking effect, I change the <title> tag, but it reflects the same title everytime. Thank you.

PS: Changes to HTML files are reflected immediately by pressing F5.

Last edited by abhijeet_ubale at 14:49 Apr 16, 2009.
cysun
Posts: 2935
Posted 14:49 Apr 16, 2009 |
abhijeet_ubale wrote:

I tried using the different browsers from different machines. But the same results. To check if my changes are taking effect, I change the <title> tag, but it reflects the same title everytime. Thank you.

So what's the URL?

abhijeet_ubale
Posts: 10
Posted 15:01 Apr 16, 2009 |
cysun wrote:
abhijeet_ubale wrote:

I tried using the different browsers from different machines. But the same results. To check if my changes are taking effect, I change the <title> tag, but it reflects the same title everytime. Thank you.

So what's the URL?

URL: http://cs3.calstatela.edu:8080/cs520stu12/

Ok, I think I got it to work at last. Here's what I tried:
- I copied some totally irrelevant text into the JSP, and uploaded that to the CS3.
- Then copied the original JSP code back, and deployed it to CS3.

Regards,
Abhijeet