Hello fellow struts users !

I just want to share my experience with installing the struts example
webapps on the Orion application server.

1.  Locale problems

The struts example application generated exceptions due to the fact that I'm
running in the fr_FR default locale.  The first exception was caused by the
ActionResources.properties file not being found :

11/08/00 20:22 struts-example: Error preloading servlet
javax.servlet.UnavailableException: Cannot load internal resources from
'org.apache.struts.action.ActionResources'
 at
org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:541)
 at org.apache.struts.action.ActionServlet.init(ActionServlet.java:287)
 at javax.servlet.GenericServlet.init(GenericServlet.java)
 at com.evermind.server.http.HttpApplication.sw(JAX)
 at com.evermind.server.http.HttpApplication.si(JAX)
 at com.evermind.server.http.HttpApplication.sr(JAX)
 at com.evermind.server.http.HttpApplication.r6(JAX)
 at com.evermind.server.http.HttpApplication.<init>(JAX)
 at com.evermind.server.Application.q_(JAX)
 at com.evermind.server.http.dq.q_(JAX)
 at com.evermind.server.http.dp.j9(JAX)
 at com.evermind.server.http.dm.o9(JAX)
 at com.evermind.server.http.dm.o8(JAX)
 at com.evermind.util.e.run(JAX)

I solved the problem by putting a copy of the ActionResources.properties
file in
/WEB-INF/classes/org/apache/struts/action/ActionResources_fr.properties.

Wouldn't it be better to have a lookup that defaults to the
ActionResources.properties file no matter what the default locale is ?

2. Problems with finding the action.xml file

This is a know issue with orion for which the
getServletContext().getResourceAsStream(config); call doesn't go into
WEB-INF.  I modified the web.xml mapping for the taglib to point to
/action.xml and moved the file to /action.xml to fix this.

Wouldn't it be better to access this file as in the example Database servlet
?

    getServletContext().getRealPath("/") +  "/WEB-INF/database.xml"


3. Problèmes with the jaxp...

Another exception  seemed to be coming from the java xml api :

C:\orion>java -jar orion.jar
Orion/1.0.3 initialized
Digester.getParser:
org.xml.sax.SAXException: com.sun.xml.parser/P-078 fr_FR
        at com.sun.xml.parser.Parser.setLocale(Parser.java:172)
        at
com.sun.xml.parser.SAXParserFactoryImpl.newParser(SAXParserFactoryImp
l.java:103)
        at com.sun.xml.parser.SAXParserImpl.<init>(SAXParserImpl.java:40)
        at
com.sun.xml.parser.SAXParserFactoryImpl.newSAXParser(SAXParserFactory
Impl.java:84)
        at org.apache.struts.digester.Digester.getParser(Digester.java:288)
        at org.apache.struts.digester.Digester.parse(Digester.java:748)
        at
org.apache.struts.example.DatabaseServlet.load(DatabaseServlet.java:2
82)
        at
org.apache.struts.example.DatabaseServlet.init(DatabaseServlet.java:1
75)
        at javax.servlet.GenericServlet.init(GenericServlet.java)
        at com.evermind.server.http.HttpApplication.sw(JAX)
        at com.evermind.server.http.HttpApplication.si(JAX)
        at com.evermind.server.http.HttpApplication.sr(JAX)
        at com.evermind.server.http.HttpApplication.r6(JAX)
        at com.evermind.server.http.HttpApplication.<init>(JAX)
        at com.evermind.server.Application.q_(JAX)
        at com.evermind.server.http.dq.q_(JAX)
        at com.evermind.server.http.dp.j9(JAX)
        at com.evermind.server.http.dm.o9(JAX)
        at com.evermind.server.http.dm.o8(JAX)
        at com.evermind.util.e.run(JAX)
Digester.getParser:
org.xml.sax.SAXException: com.sun.xml.parser/P-078 fr_FR
        at com.sun.xml.parser.Parser.setLocale(Parser.java:172)
        at
com.sun.xml.parser.SAXParserFactoryImpl.newParser(SAXParserFactoryImp
l.java:103)
        at com.sun.xml.parser.SAXParserImpl.<init>(SAXParserImpl.java:40)
        at
com.sun.xml.parser.SAXParserFactoryImpl.newSAXParser(SAXParserFactory
Impl.java:84)
        at org.apache.struts.digester.Digester.getParser(Digester.java:288)
        at org.apache.struts.digester.Digester.parse(Digester.java:748)
        at
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java
:619)
        at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:291)
        at javax.servlet.GenericServlet.init(GenericServlet.java)
        at com.evermind.server.http.HttpApplication.sw(JAX)
        at com.evermind.server.http.HttpApplication.si(JAX)
        at com.evermind.server.http.HttpApplication.sr(JAX)
        at com.evermind.server.http.HttpApplication.r6(JAX)
        at com.evermind.server.http.HttpApplication.<init>(JAX)
        at com.evermind.server.Application.q_(JAX)
        at com.evermind.server.http.dq.q_(JAX)
        at com.evermind.server.http.dp.j9(JAX)
        at com.evermind.server.http.dm.o9(JAX)
        at com.evermind.server.http.dm.o8(JAX)
        at com.evermind.util.e.run(JAX)

To solve this I run orion in the following manner (on jdk1.2.2)

    java -Duser.language=en -Duser.region=US -jar orion.jar

On jdk1.3, I placed a copy of
org/apache/struts/taglib/LocalStrings.properties in
LocalStrings_fr.properties.

I don't really know what's going on here, maybe a bug in the parser ?

I hope this information is useful to the struts community...

Cheers,
--
Luis Arias
Elysia - http://www.elysia.com
1, rue de Stockholm
75008 PARIS
FRANCE
+33 1 44 70 70 90
+33 1 44 70 72 09 fax
+33 6 14 20 87 93 mobile




Reply via email to