for anyone using HEAD of OJB, to embed in JBoss 3.0.2, do the following:

in jboss-service.xml put the following:

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

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

then, when you want to use it: 

private Implementation getODMG()
            throws EJBException
    {
        if (m_odmg != null)
            return m_odmg;
        String pmname = "java:/SomeName";
        try
        {
            ODMGFactory factory = (ODMGFactory) JNDIService.lookup(pmname);
            m_odmg = factory.getInstance();
        }
        catch (Throwable re)
        {
            throw new EJBException("An Exception occured "
                                   + "when attempting to allocate an ODMG 
Implementation "
                                   + "connection: " + re);
        }
        return m_odmg;
    }

regards,
m

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

Reply via email to