You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Irene Hernandez <ih...@cysive.com> on 2000/09/20 22:18:39 UTC
problem with struts-config_1_0.dtd
Hi
I have downloaded the latest struts 9/20 and I'm getting the following error
when parsing struts-config.xml:
Wed Sep 20 13:06:11 PDT 2000:<I> <WebAppServletContext-lomm> action:
Initializin
g configuration from resource path /WEB-INF/struts-config.xml
register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN',
'zip
:./myserver/lib/struts.jar#org/apache/struts/resources/struts-config_1_0.dtd
'
resolveEntity('-//Apache Software Foundation//DTD Struts Configuration
1.0//EN',
'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd')
Resolving to alternate DTD
'zip:./myserver/lib/struts.jar#org/apache/struts/res
ources/struts-config_1_0.dtd'
Wed Sep 20 13:06:11 PDT 2000:<E> <WebAppServletContext-lomm> Root cause of
Servl
etException
org.xml.sax.SAXException: error in opening zip file
at
org.apache.struts.digester.Digester.resolveEntity(Digester.java:619)
at
com.sun.xml.parser.ExternalEntity.getInputSource(ExternalEntity.java:
46)
at com.sun.xml.parser.Parser.pushReader(Parser.java:2748)
at
com.sun.xml.parser.Parser.externalParameterEntity(Parser.java:2500)
at com.sun.xml.parser.Parser.maybeDoctypeDecl(Parser.java:1136)
at com.sun.xml.parser.Parser.parseInternal(Parser.java:480)
at com.sun.xml.parser.Parser.parse(Parser.java:283)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:77)
at org.apache.struts.digester.Digester.parse(Digester.java:754)
at
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java
:847)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:324)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:474)
at
weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
Impl.java:433)
at
weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:422)
at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:187)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:118)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:760)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:707)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
ContextManager.java:251)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
a:369)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:269)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
It seems that there's something wrong with the dtd because when trying to
see it with the browser I got this error:
Cannot have a DTD declaration outside of a DTD. Line 26, Position 12
<!ENTITY % BeanName "CDATA">
-----------^
Irene Hernandez
RE: problem with struts-config_1_0.dtd
Posted by Irene Hernandez <ih...@cysive.com>.
>
> Could you do me a favor and try something?
>
> In the Struts example application, take the "struts.jar" file from
> "struts-example/WEB-INF/lib/struts.jar" and expand it into
> "struts-example/WEB-INF/classes", and then remove it from the lib
> directory.
> Then, try to run the app again.
>
> What we're trying to do is determine whether the classloader
> works correctly for
> un-JAR'd resources versus ones in a JAR file.
>
Craig
I tried that but it doesn't work, the ClassCastException again.
I don't think struts can be used as a webapp with Weblogic, I got it working
but having struts classes together with the rest of server classes, so
everything is loaded with the same class loader... Of course I can't have
multiple struts webapps this way, but I don't need that right now and at
least I can use the framework while I hope for a fully J2EE compliant
Weblogic server some time in the near future :-)
Also I fixed the problem with the dtd, I just had to place it somewhere in
the classpath so Weblogic can find it, same for all the properties files. So
I ended up with a struts-resources.jar in the classpath.
Thanks
Irene Hernandez
Re: problem with struts-config_1_0.dtd
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Irene Hernandez wrote:
> Hi
>
> I have downloaded the latest struts 9/20 and I'm getting the following error
> when parsing struts-config.xml:
>
> Wed Sep 20 13:06:11 PDT 2000:<I> <WebAppServletContext-lomm> action:
> Initializin
> g configuration from resource path /WEB-INF/struts-config.xml
> register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN',
> 'zip
> :./myserver/lib/struts.jar#org/apache/struts/resources/struts-config_1_0.dtd
>
The second argument here is the URL that WebLogic's classloader returns to a
Class.getResource() call. It's the responsibility of their implementation to be
able to actually retrieve such a resource, and I've heard other reports that
this doesn't work well in their app server.
> '
> resolveEntity('-//Apache Software Foundation//DTD Struts Configuration
> 1.0//EN',
> 'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd')
> Resolving to alternate DTD
> 'zip:./myserver/lib/struts.jar#org/apache/struts/res
> ources/struts-config_1_0.dtd'
> Wed Sep 20 13:06:11 PDT 2000:<E> <WebAppServletContext-lomm> Root cause of
> Servl
> etException
> org.xml.sax.SAXException: error in opening zip file
> at
> org.apache.struts.digester.Digester.resolveEntity(Digester.java:619)
> at
> com.sun.xml.parser.ExternalEntity.getInputSource(ExternalEntity.java:
> 46)
> at com.sun.xml.parser.Parser.pushReader(Parser.java:2748)
> at
> com.sun.xml.parser.Parser.externalParameterEntity(Parser.java:2500)
> at com.sun.xml.parser.Parser.maybeDoctypeDecl(Parser.java:1136)
> at com.sun.xml.parser.Parser.parseInternal(Parser.java:480)
> at com.sun.xml.parser.Parser.parse(Parser.java:283)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:77)
> at org.apache.struts.digester.Digester.parse(Digester.java:754)
> at
> org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java
> :847)
> at
> org.apache.struts.action.ActionServlet.init(ActionServlet.java:324)
> at javax.servlet.GenericServlet.init(GenericServlet.java:258)
> at
> weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
> pl.java:474)
> at
> weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
> Impl.java:433)
> at
> weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
> mpl.java:422)
> at
> weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
> java:187)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:118)
> at
> weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
> textImpl.java:760)
> at
> weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
> textImpl.java:707)
> at
> weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
> ContextManager.java:251)
> at
> weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
> a:369)
> at
> weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:269)
>
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
>
> It seems that there's something wrong with the dtd because when trying to
> see it with the browser I got this error:
>
> Cannot have a DTD declaration outside of a DTD. Line 26, Position 12
>
> <!ENTITY % BeanName "CDATA">
> -----------^
Could you do me a favor and try something?
In the Struts example application, take the "struts.jar" file from
"struts-example/WEB-INF/lib/struts.jar" and expand it into
"struts-example/WEB-INF/classes", and then remove it from the lib directory.
Then, try to run the app again.
What we're trying to do is determine whether the classloader works correctly for
un-JAR'd resources versus ones in a JAR file.
>
> Irene Hernandez
Craig McClanahan
====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00): Sun Technical Briefing
Session T06 (24-Oct 14h00-15h00): Migrating Apache JServ
Applications to Tomcat