Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Weblogic refuses my web.xml - help ! ! !

2 views
Skip to first unread message

Francesco

unread,
Jul 18, 2001, 6:29:06 AM7/18/01
to

Hi all,
I'm trying to deploy on weblogic a war file that
I'm built with Tomcat. I get a parse exception when
it comes across servlets declaration:

Mon Jul 16 11:08:33 GMT+02:00 2001:<E> <HTTP> Error parsing descriptor in Web
aplication 'c:/weblogic/myserver/tomcat.war'
org.xml.sax.SAXParseException: Element "web-app" does not allow "servlet" here.
at com.sun.xml.parser.Parser.error(Parser.java:2775)
at com.sun.xml.parser.ValidatingParser$ChildrenValidator.consume(Valida
ingParser.java:310)
at com.sun.xml.parser.Parser.maybeElement(Parser.java:1280)
at com.sun.xml.parser.Parser.content(Parser.java:1498)
at com.sun.xml.parser.Parser.maybeElement(Parser.java:1399)
at com.sun.xml.parser.Parser.parseInternal(Parser.java:491)
at com.sun.xml.parser.Parser.parse(Parser.java:283)
at weblogic.xml.dom.SunDOMParser.getDocument(SunDOMParser.java:69)
at weblogic.xml.dom.DOMParser.getDocument(DOMParser.java:102)
at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoade.java:132)


My web.xml looks clean...here's a bit of it:

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 1.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>

<servlet>
<servlet-name>
controller
</servlet-name>
<servlet-class>
ServletController
</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>
controller
</servlet-name>
<url-pattern>
/Controller
</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>
shopper
</servlet-name>
<servlet-class>
ShopperServlet
</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>
shopper
</servlet-name>
<url-pattern>
/Shopper
</url-pattern>
</servlet-mapping>

</web-app>

Does anybody know how to solve this problem ?
Thanks a lot in advance.
Francesco

Filip Hanik

unread,
Jul 18, 2001, 1:36:02 PM7/18/01
to
try this one instead (define all <servlet> elements first, and then define
the <servlet-mapping> elements

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
1.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>

<servlet>
<servlet-name>
controller
</servlet-name>
<servlet-class>
ServletController
</servlet-class>
</servlet>

<servlet>

</web-app>
--
~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
fi...@filip.net
www.filip.net
"Francesco" <fmarc...@libero.it> wrote in message
news:3b55...@newsgroups.bea.com...

Francesco

unread,
Jul 19, 2001, 9:52:41 AM7/19/01
to

Hi Filip,
thanks for your answer, now this problem is solved
and jsp pages are loaded but servlets not.
I'm developing under "myserver" folder: could you give me
a hint about where should I put
1) "web.xml"
2) servlets classes ?

Thanks
Francesco

Filip Hanik

unread,
Jul 19, 2001, 1:30:01 PM7/19/01
to
you package it all into a WAR file (zip/jar format)
read about it in the spec
http://java.sun.com/products/servlet/download.html#specs

the format is

*--WEB-INF
web.xml
-----classes
-----lib

or take a look at some sample war files
Filip

--
~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
fi...@filip.net
www.filip.net
"Francesco" <fmarc...@libero.it> wrote in message

news:3b56d819$1...@newsgroups.bea.com...

cristian medeleanu

unread,
Sep 23, 2001, 10:07:35 PM9/23/01
to
You have to group all
<servlet>
....
</servlet>

elements together, before you specify mappings
<servlet-mapping>
...
</servlet-mapping>

0 new messages