These files I had when I began working with the OJB.  I compiled them and
put them in a jar and stuck them on the classpath - no problem.  I also put
the OJB distribution files on the classpath, as well as all the jars in the
lib (all of this using an Ant script). Querying and persisting worked fine.
Creating an Identity instance from scratch and passing it to getObjectById()
failed, indicating there were no implementors for the Identity interface.
If I queried the object first, got the object id, and then passed it to the
getObjectById() method, things worked fine.  Bringing the entire source into
my project fixed the problem.  I figure there must have been something
missing from the classpath.  

-----Original Message-----
From: Mahler Thomas [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 02, 2003 7:50 AM
To: 'OJB Users List'
Subject: RE: JDO - getObjectById()


Hi again Shawn,

> I was referring to the Apache classes in 
> org.apache.ojb.sql.jdori.sql.*.  I
> didn't find these in the OJB distrubution.  I had to get them 
> from CVS.

Those classes are under src/jdori

you have to use the ant target "with-jdori" to copy those java files into
the staging area for the preprocess and compile procedure.

cheers,
Thomas

> 
> -----Original Message-----
> From: Mahler Thomas [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2003 11:43 PM
> To: 'OJB Users List'
> Subject: RE: JDO - getObjectById()
> 
> 
> Hi Shawn,
> 
> > -----Original Message-----
> > From: Shawn Vincent [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, April 01, 2003 10:29 PM
> > To: 'OJB Users List'
> > Subject: RE: JDO - getObjectById()
> > 
> > 
> > I was able to get it to work by bringing in the soucre and 
> > compiling it in
> > with my project.  I suspect something wasn't on the classpath 
> > correctly.  I
> > also had to get the source for the JDO classes and compile 
> > them since I
> > haven't found them in the OJB distribution.  Is there a seperate
> > distribution for the JDO files that you know of?
> 
> Which JDO classes do you mean?
> The javax.jdo.* stuff? (jdo.jar)
> Or the JDO Reference Implementation ? (jdori.jar)
> 
> They are both shipped with the JDO reference implementation from SUN.
> Download and setup documented here:
> http://db.apache.org/ojb/tutorial4.html#Running%20the%20Tutori
> al%20Applicati
> on
> 
> cheers,
> Thomas
> 
> > 
> > Thanks for your willingness to help,
> > Shawn
> > 
> > 
> > Here is the code that was giving the problem:
> > 
> >     public void importFile(String pathName){
> >             exceptions = ExceptionList.getInstance();
> >             createReader(pathName);
> >             OjbStorePMF factory = new OjbStorePMF();
> >             PersistenceManager pm = factory.getPersistenceManager();
> >             
> >             pm.currentTransaction().begin();
> > 
> > 
> >             while(reader.nextLine()){
> >                     Pool newPool = getPool();
> >                     Identity oid = new Identity(newPool);
> >                             
> >                     logger.finest("Identity obtained: " + (oid !=
> > null));
> >                     
> >                     Pool existingPool = (Pool)pm.getObjectById(oid,
> > false);
> >                     logger.finest("Pool obtained: " + 
> > (existingPool !=
> > null));
> >                     if(existingPool != null){
> >                             logger.finest("Pool obtained: " +
> > existingPool.toString());
> >                     }
> >                     
> >                     if(existingPool == null){
> >                             newPool.setAddDate(new Date());
> >                             pm.makePersistent(newPool);
> >                     }
> >                     else {
> > 
> >     
> > existingPool.setPoolName(newPool.getPoolName());
> >                             existingPool.setModUser("import 
> > module");  
> >     
> > existingPool.setModDate(newPool.getModDate());
> >                     
> >                     }
> >                     
> >             }
> >             
> >             pm.currentTransaction().commit();
> > 
> >             
> >             pm.close();
> >     }
> > 
> >     protected Pool getPool(){
> >             Pool pool = new Pool();
> >             
> >             reader.nextField();
> >             pool.setPoolCode(reader.getField());
> >     
> >             reader.nextField();
> >             pool.setPoolName(reader.getField());
> >             
> >             pool.setModDate(new Date());
> > 
> >             return pool;    
> >     }
> > 
> > 
> > 
> > -----Original Message-----
> > From: Thomas Mahler [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, April 01, 2003 10:19 AM
> > To: OJB Users List
> > Subject: Re: JDO - getObjectById()
> > 
> > 
> > please post the code that produces the error, indicate where 
> > the problem 
> > occurs. Stacktrace would be nice.
> > 
> > Shawn Vincent wrote:
> > > I am trying to duplicate the JDO example for using 
> > getObjectById() to look
> > > up an object.  I try to create the Identity class, but I 
> > keep getting an
> > > exception that there are no implementors defined for the interface
> > > org.apache.ojb.broker.Identity.  Can anyone help me with this?
> > > 
> > > Thanks,
> > > Shawn Vincent
> > > Technical Architect
> > > Sogeti-USA
> > > 
> > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > > 
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to