I'm been hammering my head against a brick wall for some time now trying to
get Castor
to work with JBoss.
I've looked through all the postings on the subject at both castor and jboss
but to no avail.
I've looked at the examples on jboss, and from the rooms example that
someone kindly but up for public use - but couldn't get these to work (I get
the same error with these examples as with my own code).
I'm sure there must be some piece of configuration that hasn't been
mentioned that I need to do.
This is what I have done:

1. Added the following to jboss.jcml:
<mbean code="org.jboss.jdo.castor.CastorJDOImpl"
name="DefaultDomain:service=CastorJDO,name=castormercury">
      <attribute
name="Configuration">../../../../dev/projects/mercury/config/database.xml</a
ttribute>
      <attribute name="JndiName">castormercury</attribute>
      <attribute name="LockTimeout">10000</attribute>
      <attribute name="LoggingEnabled">true</attribute>
      <attribute name="CommonClassPath">false</attribute>
  </mbean>


2. Added the following inside my <session></session> tags for my stateless
session bean
<resource-ref>
        <description>Castor DataObjects factory</description>
        <res-ref-name>jdo/MercuryJDO</res-ref-name>
        <res-type>org.exolab.castor.jdo.DataObjects</res-type>
        <res-auth>Container</res-auth>
</resource-ref>

3. Added the following in jboss.xml inside the <jboss></jboss> tags:
<resource-managers>
        <resource-manager res-class="org.jboss.ejb.deployment.CastorJDOResource">
                <res-name>CastorMercuryJDO</res-name>
                <res-jndi-name>castormercury</res-jndi-name>
        </resource-manager>
</resource-managers>

4. Added the following in jboss.xml inside the <session></session> tags for
my bean
<resource-ref>
        <res-ref-name>jdo/MercuryJDO</res-ref-name>
        <resource-name>CastorMercuryJDO</resource-name>
</resource-ref>

5. my code does a lookup using the following:
DataObjects jdo = (DataObjects) ic.lookup("java:comp/env/jdo/MercuryJDO");

This fails with a jaxax.naming.NameNotFoundException saying that the name
"castormercury" has not been bound, note is *does not* say that the name
"MercuryJDO" has not been bound implying that the stuff in the .jcml file
has not been bound.

Anyway, I'm stumped coz I'm sure I've done everything it says in the
examples.(Though obviously something's missing!)

Any help greatly appreciated.

TIA



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to