The two problems preventing the Struts example (build 20001120) to work on
Orion (1.4.0) can be solved as follows:
1. javax.servlet.jsp.JspException: Missing resources attribute
org.apache.struts.action.MESSAGE error
The problem is caused by Orion not allowing access on resources (in this
case a resourcebundle property file) in the WEB-INF/classes folder. It seems
that the Servlet 2.2 spec. doesn't states clearly if this is allowed or not;
the Orion team decided to not allow access.
A simple solution is making the resources available through the (application
its) classpath.
By jarring the resources (e.g. the WEB-INF/classes folders) and putting this
jar in the WEB-INF/lib folder the resources can be found.
I would suggest the Stuts team to implement this solution for the struts
example as Orion is probably not going to change its behavior in this.
2. java.net.MalformedURLException: unknown protocol: jndi
The solution to this problem is given by Olli Pyry yesterday in the message
with subject: Strugs & Orion & JNDI
> From: Olli Pöyry[SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, November 21, 2000 9:51:08 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Strugs & Orion & JNDI
>
> The following error that occurs in ActionServlet's startup with the
newest
> Struts nightly build and Orion:
>
> register('-//Apache Software Foundation//DTD Struts Configuration
1.0//EN',
>
'jndi:/home/jblum/web/struts/WEB-INF/lib/struts.jar/org/apache/struts/resour
> ces/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
>
'jndi:/home/jblum/web/struts/WEB-INF/lib/struts.jar/org/apache/struts/resour
> ces/struts-config_1_0.dtd'
>
> seems be caused from the following line in ActionServlet.java (about
line
> 881):
>
> URL url = this.getClass().getResource(registrations[i+1]);
>
> when this is replaced with:
>
> URL url =
getServletContext().getResource(registrations[i+1]);
>
> the dtd is found and everything works.
> However you have to rebuild struts.jar - but that is easy ant.
>
> Hope this helps!
>
> Olli Pyry, Essaim Oy, Helsinki, Finland
As this requires changing the source, I kindly request that the Struts
development team could fix this also.
Ate Douma
-----Original Message-----
From: Kevin Wang [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 20, 2000 6:32 PM
To: '[EMAIL PROTECTED]'
Subject: RE: org.apache.struts.action.MESSAGE exception with orion 1.4
Struts 1.0 example (11/15 nightly) is not working on Orion (1.2.9) either.
It seems something is wrong with 'jndi' as it use jndi to resolve
'struts-config_1_0.dtd'.
Here is a common exception ...
java.net.MalformedURLException: unknown protocol: jndi
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:2768)
at
com.sun.xml.parser.Parser.externalParameterEntity(Parser.java:2504)
at com.sun.xml.parser.Parser.maybeDoctypeDecl(Parser.java:1137)
at com.sun.xml.parser.Parser.parseInternal(Parser.java:481)
at com.sun.xml.parser.Parser.parse(Parser.java:284)
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,
Compiled Code)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:393)
at javax.servlet.GenericServlet.init(GenericServlet.java)
at com.evermind.server.http.HttpApplication.vt(JAX)
at com.evermind.server.http.HttpApplication.vc(JAX)
at com.evermind.server.http.HttpApplication.tp(JAX, Compiled Code)
at com.evermind.server.http.d5.rx(JAX, Compiled Code)
at com.evermind.server.http.d5.rw(JAX, Compiled Code)
at com.evermind.util.f.run(JAX, Compiled Code)
-----Original Message-----
From: Denis Hanson [mailto:[EMAIL PROTECTED]]
Sent: Sunday, November 19, 2000 4:12 PM
To: [EMAIL PROTECTED]
Subject: org.apache.struts.action.MESSAGE exception with orion 1.4
Hi all,
I've encountered the ever-popular Missing resources attribute
org.apache.struts.action.MESSAGE error when trying to access the
struts-example application using Win NT, orionserver 1.4, jdk1.3 and struts
from 13Nov. I've searched through the struts message archives and tried all
the suggestions I could find, but still no luck. (I was able to deploy the
example on JRun 3.0, but not on orionserver.)
Any help will be greatly appreciated because I definitely want to use
orionserver instead of JRun.
Here's the error:
javax.servlet.jsp.JspException: Missing resources attribute
org.apache.struts.action.MESSAGE
at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:232)
at /index.jsp._jspService(/index.jsp.java:39) (JSP page line 8)
at com.orionserver.http.OrionHttpJspPage.service(JAX)
at com.evermind.server.http.HttpApplication.xa(JAX)
at com.evermind.server.http.JSPServlet.service(JAX)
at com.evermind.server.http.d3.so(JAX)
at com.evermind.server.http.d3.sm(JAX)
at com.evermind.server.http.ef.su(JAX)
at com.evermind.server.http.ef.dn(JAX)
at com.evermind.util.f.run(JAX)
Here's my application.xml entry:
<web-module id="strutsExample"
path="d:\struts\webapps\struts-example.war"/>
Here's my default-web-site.xml entry:
<web-app application="default" name="strutsExample"
root="/struts-example"/>
Orion is at d:\orion and struts is at d:\struts.
Thanks,
Denis Hanson