geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Johannsen <cjo...@shaw.ca>
Subject cdejb deploy not working
Date Tue, 05 Oct 2004 05:36:25 GMT
It would appear to me that openejb is a bit buggy and readily throws 
exceptions rather than diagnostics when it is unhappy with or confused 
by a configuration.  So, I present the following to see if anyone else 
thinks openejb is messing up in this particular case.

I was trying to get Kevin Boone's cdejb project to work in Geronimo, 
mainly as an exercise to see if I could get the configuration right.  
It's an EJB demo that's been around for ages and has worked in many 
versions of JBoss (see http://www.kevinboone.com/webapptut.pdf).

When deploying cd.jar, I get the following exception from openejb:
[craigj@cr114970-c cdejb]$ make deploy
java -jar 
/home/craigj/geronimo/modules/assembly/target/geronimo-1.0-SNAPSHOT/bin/deployer.jar 
--install --module cd.jar
org.apache.geronimo.deployment.DeploymentException: Unable to initialize 
EJBContainer GBean: ejbName=CDBean
        at 
org.openejb.deployment.CMPEntityBuilder.createBean(CMPEntityBuilder.java:270)
        at 
org.openejb.deployment.CMPEntityBuilder.buildBeans(CMPEntityBuilder.java:104)
        at 
org.openejb.deployment.OpenEJBModuleBuilder.addGBeans(OpenEJBModuleBuilder.java:393)
        at 
org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:332)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:145)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:82)
        at org.apache.geronimo.kernel.Kernel.invoke(Kernel.java:231)
        at 
org.apache.geronimo.system.main.CommandLine.<init>(CommandLine.java:106)
        at 
org.apache.geronimo.system.main.CommandLine.main(CommandLine.java:64)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
        at 
org.openejb.entity.cmp.CMPInstanceContextFactory.<init>(CMPInstanceContextFactory.java:125)
        at 
org.openejb.entity.cmp.CMPContainerBuilder.buildIt(CMPContainerBuilder.java:260)
        at 
org.openejb.AbstractContainerBuilder.createConfiguration(AbstractContainerBuilder.java:332)
        at 
org.openejb.deployment.CMPEntityBuilder.createBean(CMPEntityBuilder.java:265)
        ... 8 more

Is there anything obviously wrong with the following ejb-jar.xml file?
<?xml version="1.0" encoding="US-ASCII"?>

<ejb-jar
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
    version="2.1">
  <display-name>MusicCDs</display-name>
  <enterprise-beans>

    <entity>
      <description>Models a music CD</description>
      <ejb-name>CDBean</ejb-name>
      <home>com.web_tomorrow.cd.CDHome</home>
      <remote>com.web_tomorrow.cd.CD</remote>
      <ejb-class>com.web_tomorrow.cd.CDBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      <reentrant>false</reentrant>
      <cmp-version>2.x</cmp-version>
      <!-- Get exception in CMPEntityBuilder if following omitted. -->
      <abstract-schema-name>BasicCmp</abstract-schema-name>
      <cmp-field><field-name>id</field-name></cmp-field>
      <cmp-field><field-name>title</field-name></cmp-field>
      <cmp-field><field-name>artist</field-name></cmp-field>
      <cmp-field><field-name>type</field-name></cmp-field>
      <cmp-field><field-name>notes</field-name></cmp-field>
      <primkey-field>id</primkey-field>
    </entity>

    <session>
      <description>Models a music CD collection</description>
      <ejb-name>CDCollectionBean</ejb-name>
      <home>com.web_tomorrow.cd.CDCollectionHome</home>
      <remote>com.web_tomorrow.cd.CDCollection</remote>
      <ejb-class>com.web_tomorrow.cd.CDCollectionBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <ejb-ref>
          <ejb-ref-name>ejb/CD</ejb-ref-name>
          <ejb-ref-type>Entity</ejb-ref-type>
          <home>com.web_tomorrow.cd.CDHome</home>
          <remote>com.web_tomorrow.cd.CD</remote>
          <ejb-link>CDBean</ejb-link>
      </ejb-ref>
    </session>

  </enterprise-beans>

  <assembly-descriptor>
    <container-transaction>
      <method>
        <ejb-name>CDBean</ejb-name>
        <method-name>*</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
  </assembly-descriptor>
</ejb-jar>

This might be caused by MethodHelper.getSuperIndex(enhancedClass, 
signature) returning -1, which probably means it didn't find some method.
================================================================
For reference, here is the openejb-jar.xml file:
<?xml version="1.0"?>

<openejb-jar
    xmlns="http://www.openejb.org/xml/ns/openejb-jar"
    configId="my/cdejb"
    parentId="org/apache/geronimo/DefaultDatabase">

    <cmp-connection-factory>DefaultDatasource</cmp-connection-factory>

    <enterprise-beans>
        <session>
            <ejb-name>CDCollectionBean</ejb-name>
            <jndi-name>cd/CDCollection</jndi-name>
        </session>
        <entity>
            <ejb-name>CDBean</ejb-name>
            <jndi-name>cd/CD</jndi-name>
        </entity>
    </enterprise-beans>
</openejb-jar>

Cheers,
Craig




Mime
View raw message