Hi,

I had the same problems. Finally it worked like this:

o OJB.Properties and repository.xml in the jboss/bin/ directory

  ODMGFactory factory = (ODMGFactory)
initialCtx.lookup(java:/MyConnection);
  ojb =  factory.getInstance();
  db = ojb.newDatabase();
  db.open("repository.xml", Database.OPEN_READ_WRITE);

Where java:/MyConnection points to an MBean entry in the
jboss-service.xml. If you add the following lines at the end, you should
even have direct access to the PersistenceBroker.

<mbean code="org.jboss.ojb.pb.PBFactory"
name="DefaultDomain:service=PBAPI,name=ojb/PBAPI">
        <attribute name="JndiName">ojb/PBAPI</attribute>
    </mbean>
    
    <mbean code="org.jboss.ojb.odmg.ODMGFactory"
name="DefaultDomain:service=ODMG,name=MyConnection">
        <attribute name="JndiName">MyConnection</attribute>
    </mbean>

If you did, you can access the PB like this:

PBFactory factory = (PBFactory) initialCtx.lookup("java:/ojb/PBAPI");
pBroker =
factory.getInstance().createPersistenceBroker("repository.xml");

If you are still having Problems take a look at:
http://archives.apache.org/eyebrowse/ReadMsg?[EMAIL PROTECTED]
pache.org&msgId=469717

Regards
Thimo

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

Reply via email to