This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

My servlets are not accessible when i host my application  RSS feed

 
Josiah Orie
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, can anyone help! the problem am having is that when i host my web app to the online server, i keep getting a 404 error saying my servlet is not available. But on my local computer, it is working fine. i don't know if i need to reconfigure my web.xml file. if so, can anyone please help me with how to do so; or any other options available please.

The format structure:

All my servlets are in a folder called MODEL and my url patterns for all the servlets is named as follows eg servletName.do. which are passed in the action attribute of the form element. Offline, it works when i click the submit button but when online it doesn't.

Please HELPPPPPPP!
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the URL you're using for the local version? What is the URL you're using for the hosted version?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you get access to the online server logs?

It might help if you show us your web.xml deployment descriptor file.

Bill
 
Josiah Orie
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my web.xml that is working on my local system:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>AdminLoginServlet</servlet-name>
<servlet-class>MODEL.AdminLoginServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ControllerServlet</servlet-name>
<servlet-class>CONTROLLER.ControllerServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ValidationServlet</servlet-name>
<servlet-class>VALIDATION.ValidationServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>AdminServlet</servlet-name>
<servlet-class>MODEL.AdminServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>SubscriptionServlet</servlet-name>
<servlet-class>MODEL.SubscriptionServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ApplicantServlet</servlet-name>
<servlet-class>MODEL.ApplicantServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>EmployerServlet</servlet-name>
<servlet-class>MODEL.EmployerServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ApplicantNew_Servlet</servlet-name>
<servlet-class>MODEL.ApplicantNew_Servlet</servlet-class>
</servlet>
<servlet>
<servlet-name>TestServlet</servlet-name>
<servlet-class>MODEL.TestServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ApplicantLoginServlet</servlet-name>
<servlet-class>MODEL.ApplicantLoginServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ApplicantInfoServlet</servlet-name>
<servlet-class>MODEL.ApplicantInfoServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>CertificateServlet</servlet-name>
<servlet-class>MODEL.CertificateServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>QualificationServlet</servlet-name>
<servlet-class>MODEL.QualificationServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ExperienceServlet</servlet-name>
<servlet-class>MODEL.ExperienceServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ProjectServlet</servlet-name>
<servlet-class>MODEL.ProjectServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ProfessionServlet</servlet-name>
<servlet-class>MODEL.ProfessionServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>PortalSkillServlet</servlet-name>
<servlet-class>MODEL.PortalSkillServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>SkillServlet</servlet-name>
<servlet-class>MODEL.SkillServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>EmployerNew_Servlet</servlet-name>
<servlet-class>MODEL.EmployerNew_Servlet</servlet-class>
</servlet>
<servlet>
<servlet-name>EmployerLoginServlet</servlet-name>
<servlet-class>MODEL.EmployerLoginServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>SearchServlet</servlet-name>
<servlet-class>MODEL.SearchServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>SendMailServlet</servlet-name>
<servlet-class>MODEL.SendMailServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ApplicantViewServlet</servlet-name>
<servlet-class>MODEL.ApplicantViewServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>SendMessageServlet</servlet-name>
<servlet-class>MODEL.SendMessageServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>SubscriptionUpgradeServlet</servlet-name>
<servlet-class>MODEL.SubscriptionUpgradeServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ActivateServlet</servlet-name>
<servlet-class>MODEL.ActivateServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>MessageServlet</servlet-name>
<servlet-class>MODEL.MessageServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>Activate_SearchPaymentServlet</servlet-name>
<servlet-class>MODEL.Activate_SearchPaymentServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>PrivacyServlet</servlet-name>
<servlet-class>MODEL.PrivacyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AdminLoginServlet</servlet-name>
<url-pattern>/AdminLoginServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ControllerServlet</servlet-name>
<url-pattern>/ControllerServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ValidationServlet</servlet-name>
<url-pattern>/ValidationServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>AdminServlet</servlet-name>
<url-pattern>/AdminServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SubscriptionServlet</servlet-name>
<url-pattern>/SubscriptionServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ApplicantServlet</servlet-name>
<url-pattern>/ApplicantServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>EmployerServlet</servlet-name>
<url-pattern>/EmployerServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ApplicantNew_Servlet</servlet-name>
<url-pattern>/ApplicantNew_Servlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/TestServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ApplicantLoginServlet</servlet-name>
<url-pattern>/ApplicantLoginServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ApplicantInfoServlet</servlet-name>
<url-pattern>/ApplicantInfoServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>CertificateServlet</servlet-name>
<url-pattern>/CertificateServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>QualificationServlet</servlet-name>
<url-pattern>/QualificationServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ExperienceServlet</servlet-name>
<url-pattern>/ExperienceServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ProjectServlet</servlet-name>
<url-pattern>/ProjectServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ProfessionServlet</servlet-name>
<url-pattern>/ProfessionServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>PortalSkillServlet</servlet-name>
<url-pattern>/PortalSkillServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SkillServlet</servlet-name>
<url-pattern>/SkillServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>EmployerNew_Servlet</servlet-name>
<url-pattern>/EmployerNew_Servlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>EmployerLoginServlet</servlet-name>
<url-pattern>/EmployerLoginServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SearchServlet</servlet-name>
<url-pattern>/SearchServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SendMailServlet</servlet-name>
<url-pattern>/SendMailServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ApplicantViewServlet</servlet-name>
<url-pattern>/ApplicantViewServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SendMessageServlet</servlet-name>
<url-pattern>/SendMessageServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SubscriptionUpgradeServlet</servlet-name>
<url-pattern>/SubscriptionUpgradeServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ActivateServlet</servlet-name>
<url-pattern>/ActivateServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>MessageServlet</servlet-name>
<url-pattern>/MessageServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Activate_SearchPaymentServlet</servlet-name>
<url-pattern>/Activate_SearchPaymentServlet.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>PrivacyServlet</servlet-name>
<url-pattern>/PrivacyServlet.do</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

My form url is ControllerServlet.do but for sub folders/domain i specify www.domainname.com/ControllerServlet.do

 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
www.domainname.com/ControllerServlet.do

So this web app is set up as the ROOT web app on the hosted domain? I'm asking because on a local server you would typically set up a web app in its own context (subdirectory) - not ROOT.
 
Manjesh Patil
Ranch Hand
Posts: 42
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also , using UPPER cases for package name is discouraged. As a best practice use smaller cases for package names.
Example :



Do you see your application Context loaded messages in server.log?
 
Josiah Orie
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i get the Application context server.log in domain?
 
Manjesh Patil
Ranch Hand
Posts: 42
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Jboss say If your application name TestApp, then on deployment the server shows message like ...

14:18:42,752 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/TestApp

which application server do you use?

If you know where is your hosting server located , server's log locations you can debug it easily.
 
Josiah Orie
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the application server am using online is Apache tomcat
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!