- This topic has 3 replies, 2 voices, and was last updated 21 years, 3 months ago by Scott Anderson.
-
AuthorPosts
-
blaplanteMemberHi all,
I have about exhausted my resources. I created a servlet with the myelipse wizard in my development project and I am not able to get it to run in either Tomcat or Weblogic.OS: winXP
Project type: web module project
servlet: development/webroot/web-inf/classes/com.netwebapps.templates
deployed to TC and WLS properly per above path.The web.xml under web-inf looks like this
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE web-app PUBLIC “-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN” “http://java.sun.com/dtd/web-app_2_3.dtd”>
<web-app>
<servlet>
<servlet-name>J2J</servlet-name>
<display-name>J2J</display-name>
<description>This is the description of my J2EE component</description>
<servlet-class>com.netwebapps.templates.J2J</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>J2J</servlet-name>
<url-pattern>/development</url-pattern>
</servlet-mapping>
</web-app>
Scott AndersonParticipantBryan,
I just tried building a simple servlet webapp and deploying it to Tomcat along the lines you stated and didn’t have any problems at all. From what you’ve done, I’m going to guess that the problem is that you’ve named both your project ‘development’ and specified your servlet mapping URL as ‘/development’. This means that you’re servlet will be available at http://localhost:8080/development/development. I believe what you wanted was it to be available at the root context under development. In my example, I created two servlets. One is called ‘J2J’, and the other is called ‘Root’. I’m deploying my project under the Tomcat context root of the project name, which is ‘Development’ in my case. Here’s the web.xml file:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <servlet> <servlet-name>J2J</servlet-name> <display-name>J2J</display-name> <description>This is the description of my J2EE component</description> <servlet-class>com.netwebapps.templates.J2J</servlet-class> </servlet> <servlet> <servlet-name>Root</servlet-name> <display-name>Root</display-name> <description>This is the description of my J2EE component</description> <servlet-class>com.netwebapps.templates.Root</servlet-class> </servlet> <!-- http://localhost:8080/Development/development --> <servlet-mapping> <servlet-name>J2J</servlet-name> <url-pattern>/development</url-pattern> </servlet-mapping> <!-- http://localhost:8080/Development/ --> <servlet-mapping> <servlet-name>Root</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> </web-app>
I think should get everything cleared up for you.
–Scott
MyEclipse Support
blaplanteMemberOh man! I feel silly now, cause I think I knew that. It’s like walking around looking for your glasses while your wearing them. Helps to have another pair of eyes.
Thanks
Bryan LaPlante
Scott AndersonParticipantBryan,
No problem at all. Sometimes someone “looking over your shoulder” is a necessity.
–Scott
MyEclipse Support -
AuthorPosts