Reputation: 37
I have a Tomcat server and a Glassfish4 server. My Servlet launches perfectly fine with the Tomcat server BUT gives me an "HTTP Status 404" error for the Glassfish4 server. Here is all I have in the Tomcat ROOT directory:
WEB-INF
Here are the contents for the "web.xml" file...
<web-app>
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>/HelloWorld</url-pattern>
</servlet-mapping>
</web-app>
This is the output I get using the Tomcat server ( when I run --> localhost:8080/HelloWorld ):
For Glassfish4, I added the "WEB-INF" folder ( which is all I had in the Tomcat server ) into the "C:\glassfish4\glassfish\domains\domain1\docroot" folder ( ROOT equivalent of Tomcat server ) and used the same url ( localhost:8080/HelloWorld ). Which is when I got the 404 error.
I know the Glassfish4 server works because I put an ordinary index.html and it pulled it up just fine. I understand Glassfish4 is more than just a servlet container, maybe I am missing something?
Any answers will be appreciated. Please let me know if you need anything else.
Thanks.
Upvotes: 1
Views: 346
Reputation: 1537
For manuall deployment without IDE there are few examples in the official documentation:
Excerpt:
Use the asadmin deploy command. The general form for the command is:
as-install/bin/asadmin deploy war-nameTo deploy the hello.war sample, the command is:
as-install/bin/asadmin deploy sample-dir/hello.war
Upvotes: 1