• Post Reply Bookmark Topic Watch Topic
  • New Topic

FAIL - Application at context path /pro1 could not be started  RSS feed

 
rewati raman
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there
I have created a simple app and i am not able to launch it. My directory heirarchy is something like this.
In webapp folder pro1 is there. in pro1 i have WEB-INF
in WEB-INF i have file web.xml and directory classes.
in classes i have file C1.class

my web.xml is:


<?xml version="1.0" encoding="ISO-8851-1" ?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com./xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-ap_2_4.xsd"
version="2.5">
<servlet>
<servlet-name>Test 1</servlet-name>
<servlet-class>C1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Test 1</servlet-name>
<url-pattern>/Serv1</url-pattern>
</servlet-mapping>
</web-app>

help needed
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read. You can edit your post by using the button.

Servlets must be in a non-default package.

 
rewati raman
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What dose that mean?
I am new to this and i am following a book to learn.
I didnt find anything on this.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It means that servlets must be in a named package, other than the default package with no name. If you're not familiar with basic Java terminology, I'd *strongly* recommend starting with Java basics before launching into frameworks that assume (and require) basic Java knowledge.
 
rewati raman
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do know the meaning of default-package.
I know its not recommended to put in default package.
I didn't understand your context at that time.
anyway my app is working.
there was a small problem in my web.xml.

I changed encoding="ISO-8851-1" to encoding="ISO-8859-1" and its working now.

anybody who is following Head first book should note it.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!