struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: Can't get it running.
Date Tue, 13 Jun 2000 19:33:51 GMT
Kevin Duffey wrote:

> Hi,
>
> > > I encountered the same problem. The reason was that I only set the
> > > struts.jar to classpath, struts.jar doesn't (at least in my case)
> > > include the org.apache.struts.example -package.
> > > So those files must be separately copied into the WEB-INF/classes
> > > -directory.
> > >
> >
> > Good point ... if you want the example application, then you need to
> > deploy the "struts-example.war" file into your servlet container.  If
> > you want to use those classes as the basis for your own application, you
> > need to have the contents of the WEB-INF/classes directory in the
> > example application available on your classpath (at compile time), and
> > available to your servlet container when you run.
>
> Not quite the same problem I am having. I took all references to the
> examples out of the web.xml and action.xml, so I only need the framework
> itself to work. I will supply my own action classes, and hopefully get the
> javabean (formClass) stuff working too. I have an urgency to get this
> working ASAP, so if anyone can shed light on getting Struts working with
> Orion, that would be great. I do know that Orion is fully J2EE compliant,
> and that anything put in /WEB-INF/classes is in the classpath as the servlet
> 2.2 spec says (and I think /WEB-INF/lib gets loaded as well). I have no
> problem calling into any of my code put in this dir, so I don't think thats
> the problem. The problem I seem to be having (sorry for reiterating) is the
> resource loading..it isn't loading any resources. Since my app will never be
> internationally needed, I wouldn't mind doing away with this, if possible.
> Do I need to put some resource in WEB-INF as well? I put the .tld and
> action.xml file there...is something else needed there? The struts.jar is in
> /lib, and it does load, otherwise the servlet wouldn't be called. Infact,
> the mapping must be working as well, since the servlet is being called when
> I submit my .do action/form.
>

The particular resource that Kevin is tripping on is
"org.apache.struts.action.ActionResources", which contains the internal messages
that can be created by the ActionServlet servlet -- not application messages.
It should be present in the "struts.jar" file, in entry
"org/apache/struts/action/ActionResources.properties".

Kevin, could you make sure that your struts.jar file contains this entry?  If it
does, then the classloader used by Orion is not loading resource bundles
correctly, and you should report that.  Internally, Struts is doing this call:

    ResourceBundle bundle =
ResourceBundle.getBundle("org.apache.struts.action.ActionResources");

which, using the standard JDK resource bundle capabilities, will load a
PropertyResourceBundle from the file identified above.  However, for this to
work, the class loader used by your servlet container must correctly implement
the ClassLoader.getResourceAsStream() method.

As a possible workaround (no idea whether it will work), you might also try
un-JARing the struts.jar file into your "WEB-INF/classes" directory, and see if
Orion will load the resources correctly from there.

>
> Thanks again.

Craig



Mime
View raw message