You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Colin Sampaleanu <co...@Bspark.com> on 2000/10/04 15:40:55 UTC

RE: Problems with the example app - Digester can't parse the data base .xml file

I'm not sure what was going wrong for you, but tou definitely _do not_ need
to have the struts source in there for Struts to work with Resin. Our custom
app, as well as the sample app and test app work fine with struts.jar just
placed in the web app's lib directory...


> -----Original Message-----
> From: Malcolm Ferguson [mailto:malcolmf@nkaos.com]
> Sent: October 4, 2000 9:18 AM
> To: 'struts-user@jakarta.apache.org'
> Subject: RE: Problems with the example app - Digester can't parse the
> data base .xml file
> 
> 
> I finally resolved (albeit in an unsatisfying way) this so 
> I'm going to
> document it for future generations of archive searchers using Struts +
> Resin. 
> 
> 1. I removed the struts.jar file from all of resin's class 
> path locations
> (example/Web-inf/lib;resin/lib;etc). 
> 2. Then I copied the source files into example/Web-inf/classes 
> 3. I made a request for the application from a browser and 
> watched resin
> magically compile it all
> 4. POOF! It works! Just Like that...
> 
> So, I don't really know what the problem was, but hitting it 
> with the above
> hammer fixed it real good.
> 
> Tks for all help
> 
> Mac Ferguson
> 
>  
> > -----Original Message-----
> > From: Joel Schneider [mailto:jschneider@cariboulake.com]
> > Sent: Tuesday, October 03, 2000 6:19 PM
> > To: 'struts-user@jakarta.apache.org'
> > Subject: Re: Problems with the example app - Digester can't 
> parse the
> > database .xml file
> > 
> > 
> > A web-based mailing list archive is hosted at:
> > 
> >     http://archive.covalent.net/
> > 
> > In addition, the ezmlm program that serves this list 
> recognizes a few
> > archive inquiry commands.
> > 
> > As for your actual problem, perhaps it may have something to 
> > do with the
> > revision levels of your pre-requisite software packages 
> (JDK, servlet
> > container, XML parser, Xalan XSLT processor) -- ?  However, 
> > if it turns
> > out to be a bona fide bug in Struts 0.5, you may want to 
> report it to
> > the BugRat:
> > 
> >     http://znutar.cortexity.com:8888/
> > 
> > Joel
> > 
> > On Tue, 3 Oct 2000, Malcolm Ferguson wrote:
> > > I'm just getting started with struts, I'm using the 0.5 
> > milestone build with
> > > Resin + PWS on NT workstation. I'm trying to get the 
> > 'example' application
> > > working, my logs show an exception being thrown in the 
> > init() method of
> > > DatabaseServlet (which is called by a load-on-startup 
> > directive). After
> > > poking around a little I discovered that the call 
> > digester.parse(bis) on
> > > line 280 (of DatabaseServlet) is where the exception 
> > originates. I checked
> > > the number of available bytes from the input stream and 
> > they match the file
> > > size. Has anyone else run into this? If I don't have to 
> > switch from the
> > > binaries I'd rather not. 
> > > 
> > > Incidentally, is there an archive for this list?
> > > 
> > > Thanks
> > > ***********************************
> > > Mac Ferguson,
> > > Senior Developer,
> > > NKaos Interactive Media (http://www.nkaos.com),
> > > 579 Richmond Street West, Suite 400
> > > Toronto, ON
> > > M5V 1Y6
> > > (Phone) (416)504.8931 x316
> > > (Fax) (416)504.8472 
> > > ***********************************
> > > 
> > > 
> > 
> 

Re: Problems with the example app - Digester can't parse the database .xml file

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Colin Sampaleanu wrote:

> I'm not sure what was going wrong for you, but tou definitely _do not_ need
> to have the struts source in there for Struts to work with Resin. Our custom
> app, as well as the sample app and test app work fine with struts.jar just
> placed in the web app's lib directory...
>

This is the key issue.  I expanded on it a little in a previous email this
morning, but the bottom line is that -- on most current servlet containers --
Struts will work when it is installed in WEB-INF/lib, but will *not* work when
it is installed in the system class path provided by the container.

The technical issue is that when Struts tries to instantiate a user class (like
a form bean), it looks in the classloader it was loaded from -- but the form
beans and other stuff are in your webapp class loader, and therefore not
visible.

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