• Post Reply Bookmark Topic Watch Topic
  • New Topic

error whith tomcat when i start it

 
Engin Okucu
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a web application.
webapps/requete/enregistrement.html
webapps/requete/WEB-INF/web.xml
webapps/requete/WEB-INF/classes/config.class
All work fine. But when i write in the web.xml this following code(in bold) :

<?xml version="1.0" encoding="ISO-8859-1"?>
<!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>

<welcome-file-list>
<welcome-file>enregistrement.html</welcome-
file>
</welcome-file-list>


<servlet>
<servlet-name>confirmation</servlet-name>
<servlet-class>conf</servlet-class>
</servlet>
</web-app>
I have this error :
PARSE error : at line 18column 11
org.xml.sax.SAXParserException : the content of element type must match"(icon?,display-name?,description?,distributable?,.....)"
Where did i make wrong ?
thanks.
 
Fabrizio Gianneschi
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It could be an error in the web.xml, I think.
You wrote:
<servlet-class>conf</servlet-class>
but the correct syntax has to be
servlet-class>config</servlet-class>
Regards,
 
Engin Okucu
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No i don't think it...i did try it but the same error.
When i add what it' s in bold above, i have error at starting tomcat,whithout this line in my web.xml i don't have problem to start.
Could you help me please to sovle it ?
 
Mario Rendon
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well i think that you got to get some extra code.
fist the problem acording to you code seems to be at line 18 ..

probably to your<web-app> tag need a parameter called ID makes no harm to add it
<web-app id="WebApp">
and you probably want to add your welcome-file-list AFTER your servlet definitions
my sugesstion
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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 id="WebApp">
<servlet>
<servlet-name>confirmation</servlet-name>
<servlet-class>conf</servlet-class>
</servlet>
<welcome-file-list>
<welcome-file>enregistrement.html</welcome-
file>
</welcome-file-list>

</web-app>
 
Engin Okucu
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mario,
I thank you very much. You're right.I did try it.
Now it works. I MUST add it AFTER my servlet definition(without ID) like it :
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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>confirmation</servlet-name>
<servlet-class>config</servlet-class>
</servlet>
<welcome-file-list>
<welcome-file>enregistrement.html</welcome-file>
</welcome-file-list>
</web-app>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!