If the files are placed in WEB-INF they won't be available to beans or
startup classes


                                                                                       
                                          
                    Dave Weis                                                          
                                          
                    <[EMAIL PROTECTED]>         To:     [EMAIL PROTECTED]   
                                          
                    Sent by:                           cc:                             
                                          
                    [EMAIL PROTECTED]        Subject:     Re: [castor-dev] 
castor properties file and servlets         
                    solver.com                                                         
                                          
                                                                                       
                                          
                                                                                       
                                          
                    04/18/2002 01:20 PM                                                
                                          
                    Please respond to                                                  
                                          
                    castor-dev                                                         
                                          
                                                                                       
                                          
                                                                                       
                                          




Shalaka Chaudhari wrote:
> Thanks a lot for your help, Dave. I will definitely try it out. But
> the way my application is designed, is that my servlet makes calls to
> other application classes to get the work done.
> As of now, my files are being read, it does not give me any
> error/exception when i set the configuration but when i invoke the
> jdo.getDatabase(), it throws an exception saying
>  "class decriptor not found" in the mapping file. The mapping file
> works fine if i run my application as standalone. Where do the classes
> need to be so that the mapping file can pick them up? I have them in
> my /servlets directory.Or is it some problem with setting up the JDO
> mapping? If i load the JDO config. on startup witll i just be able
> touse it in my class?

What you are doing will work fine with the servlet example. All it does
is load the JDO initally and set some static data inside the class that
all of the future JDO calls will use. That's why you set the
load-at-startup. I'm doing something similar to you.

Your classes will need to be in /WEB-INF/classes or in jar files in
/WEB-INF/lib. Make sure they are in the correct locations (package name
wise).

dave

> >From: Dave Weis
> >Reply-To: [EMAIL PROTECTED]
> >To: [EMAIL PROTECTED]
> >Subject: Re: [castor-dev] castor properties file and servlets
> >Date: Thu, 18 Apr 2002 07:32:31 -0500
> >
> >
> >Shalaka Chaudhari wrote:
> > > I am working on UNIX and I am using Apache JServ. I have
> > > written an HTTP client to make repetitive calls to the servlet on
> the
> > > server to stress test my application. When i run my application as
> a
> > > standalone, it works fine. When it runs as a servlet it does not
> seem
> > > to find the database.xml, mapping.xml files req. to set JDO
> config.
> > > and loadMapping.
> > > I tried putting them in different directories like : public_html,
> > > servlets, my home directory and also tried out different
> combinations
> > > of the classpath. It does not work!!!
> > > I do not know what to do? Where do I put these files and my
> > > application .xml file like Person.xml so that the servlet (running
> on
> > > Apache Jserv) can load and read from it.
> > > How should it be specified in the jdo.setConfiguration() and
> > > mapping.loadMapping() ?
> >
> >I couldn't figure this out either, so I wrote a servlet and set
> >load-on-startup that will get JDO configured. I put a copy of it at
> >http://www.sjdjweis.com/java/castor/
> >
> >That should steer you in the correct direction.
> >
> >dave
> >
> >
> > > >From: "Rajesh Kalluri manduca"
> > > >Reply-To: [EMAIL PROTECTED]
> > > >To: [EMAIL PROTECTED]
> > > >Subject: Re: [castor-dev] castor properties file and servlets
> > > >Date: Wed, 17 Apr 2002 14:20:23 -0400
> > > >
> > > >Hi Shalka,
> > > >
> > > >If you have your "server" application of the client server setup
> as
> > > WAR file
> > > >structure, place your castor.properties in WEB-INF/classes. What
> > > web/app
> > > >server are you using. And just of curiosity what kind of cleints
> are
> > > you
> > > >writing to talk to the servlets.
> > > >
> > > >Regards
> > > >Rajesh
> > > > -----Original Message-----
> > > > From: Shalaka Chaudhari [mailto:[EMAIL PROTECTED]]
> > > > Sent: Wednesday, April 17, 2002 12:54 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [castor-dev] castor properties file and servlets
> > > >
> > > >
> > > > Hi,
> > > > I am using Castor XML and JDO in a client server setup using
> > > >servlets. Can anyone pl. tell me as to where to put the
> > > castor.properteis
> > > >file so that the properties will be picked up by the servlet??

--
Dave Weis
businessolver, Inc.
[EMAIL PROTECTED]
http://www.businessolver.com/

-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
           unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to