6
6e
Hi thanks for reading.
Im having some difficutly getting a servlet to run on my tomcat server.
I am able to run JSP files, but I am new with servlets.
I compiled a basic hello world file into a war file, and deployed it in
the webapps directory (it installed itself into web_apps\MyApp
directory. I manually moved it to the directory structure outlined in
many many tutorials.
After moving the files, I was able to get the servlet recognized, only
now I am getting an error stating "javax.servlet.ServletException:
Cannot allocate servlet instance for path /servlet/MyApp"
I checked the classpath, it includes the path to my jdk, ".", and
supporting Tomcat files.
I created a web.xml file, and placed it into that directory as well it
is written as follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>MyApp</servlet-name>
<servlet-class>MyApp</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>MyApp</servlet-name>
<url-pattern>/MyApp</url-pattern>
</servlet-mapping>
</web-app>
Any advice on things to check would be appreciated, I am stuck. I am
trying to work on this project for work and as time goes by I know that
this will become a much larger issue.
Thank you!
Im having some difficutly getting a servlet to run on my tomcat server.
I am able to run JSP files, but I am new with servlets.
I compiled a basic hello world file into a war file, and deployed it in
the webapps directory (it installed itself into web_apps\MyApp
directory. I manually moved it to the directory structure outlined in
many many tutorials.
After moving the files, I was able to get the servlet recognized, only
now I am getting an error stating "javax.servlet.ServletException:
Cannot allocate servlet instance for path /servlet/MyApp"
I checked the classpath, it includes the path to my jdk, ".", and
supporting Tomcat files.
I created a web.xml file, and placed it into that directory as well it
is written as follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>MyApp</servlet-name>
<servlet-class>MyApp</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>MyApp</servlet-name>
<url-pattern>/MyApp</url-pattern>
</servlet-mapping>
</web-app>
Any advice on things to check would be appreciated, I am stuck. I am
trying to work on this project for work and as time goes by I know that
this will become a much larger issue.
Thank you!