0 Replies Latest reply on Apr 9, 2008 5:33 AM by susanthadesilva

    Session/Entity Beans deployment

    susanthadesilva


      I am trying to develop a simple EJB application to print "HelloWorld". The print method, hello() is in Entity Bean class.Session Bean is talking to the Entity Bean I am using JUnit test case to look up Session Bean.

      All the Interfaces and Bean classes are in the directory EntityLab\src\lab\entity\ejb and Deployment Discripters are in EntityLab\src\config\META-INF. I am using Ant build script to build and bundle this project.

      When I try to deploy this I get the Error:

      Verification of Enterprise Beans failed
      Enterprise Beans are partially deployed
      org.jboss.deploymentInfo@ce3b86eb
      org.jboss.ejb.EJBDeployer@123a389

      Can anyone help me to fix this bug. My .XML files are as follows:

      EJB_JAR>XML

      <?xml version="1.0encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      <ejb-jar >

      <![CDATA[No Description.]]>
      <display-name>EJB Config</display-name>

      <enterprise-beans>



      <!-- Session Beans -->
      <!--
      To add session beans that you have deployment descriptor info for, add
      a file to your XDoclet merge directory called session-beans.xml that contains
      the markup for those beans.
      -->

      <![CDATA[]]>

      <ejb-name>HelloWorld</ejb-name>

      lab.session.ejb.HelloWorldHome
      lab.session.ejb.HelloWorld
      <ejb-class>lab.session.ejb.HelloWorldBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>




      <!-- Entity Beans -->
      <!--
      To add entity beans that you have deployment descriptor info for, add
      a file to your XDoclet merge directory called entity-beans.xml that contains
      the markup for those beans.
      -->

      Customer Entity Bean
      <ejb-name>Customer</ejb-name>
      <local-home>lab.entity.ejb.CustomerLocalHome</local-home>
      lab.entity.ejb.CustomerLocal
      <ejb-class>lab.entity.ejb.CustomerBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>Customer</abstract-schema-name>
      <cmp-field >
      <![CDATA[]]>
      <field-name>id</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[]]>
      <field-name>firstName</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[]]>
      <field-name>lastName</field-name>
      </cmp-field>
      <primkey-field>id</primkey-field>



      <!-- Message Driven Beans -->
      <!--
      To add message driven beans that you have deployment descriptor info for, add
      a file to your XDoclet merge directory called message-driven-beans.xml that contains
      the <message-driven></message-driven> markup for those beans.
      -->

      </enterprise-beans>

      <!-- Relationships -->

      <!-- Assembly Descriptor -->
      <assembly-descriptor >
      <!--
      To add additional assembly descriptor info here, add a file to your
      XDoclet merge directory called assembly-descriptor.xml that contains
      the <assembly-descriptor></assembly-descriptor> markup.
      -->

      <!-- finder permissions -->

      <method-permission >
      <![CDATA[description not supported yet by ejbdoclet]]>


      <![CDATA[]]>
      <ejb-name>HelloWorld</ejb-name>
      <method-intf>Home</method-intf>
      <method-name>create</method-name>
      <method-params>
      </method-params>

      </method-permission>

      <!-- finder permissions -->

      <!-- transactions -->

      <!-- finder transactions -->
      </assembly-descriptor>

      <ejb-client-jar>ejb-jar.jar</ejb-client-jar>

      </ejb-jar>

      JBOSS.XML

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">



      <unauthenticated-principal>nobody</unauthenticated-principal>

      <enterprise-beans>

      <!--
      To add beans that you have deployment descriptor info for, add
      a file to your XDoclet merge directory called jboss-beans.xml that contains
      the , and <message-driven></message-driven>
      markup for those beans.
      -->


      <ejb-name>HelloWorld</ejb-name>
      <jndi-name>ejb/HelloWorld</jndi-name>

      <method-attributes>
      </method-attributes>



      <ejb-name>Customer</ejb-name>
      <local-jndi-name>thede/LocalCustomer</local-jndi-name>

      <method-attributes>
      </method-attributes>



      </enterprise-beans>

      <resource-managers>
      </resource-managers>



      JBOSSCMP-JDBC.XML

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">

      <jbosscmp-jdbc>

      <preferred-relation-mapping>relation-table</preferred-relation-mapping>


      <enterprise-beans>


      <ejb-name>Customer</ejb-name>
      java:/DefaultDS
      <datasource-mapping>Hypersonic SQL</datasource-mapping>
      <create-table>true</create-table>
      <table-name>Customer</table-name>
      <cmp-field>
      <field-name>id</field-name>
      <column-name>id</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>firstName</field-name>
      <column-name>firstName</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>lastName</field-name>
      <column-name>lastName</column-name>
      </cmp-field>


      </enterprise-beans>

      </jbosscmp-jdbc>

      BUILD.XML

      <?xml version="1.0" encoding="UTF-8"?>


      <!--

      STANDARD DIRECTORY STRUCTURE

      project
      -bin
      -dist
      -lib
      -src
      -config
      -META-INF
      -(packages ...)
      -ejb
      -interfaces

      You must change the JAR property.

      -->

      <!-- CHANGE THIS TO THE NAME FOR YOUR EJB-JAR FILE -->


















      <!--
      XDOCLET LIBRARY
      Change this to point to your XDoclet install

      -->




      <!--
      J2EE LIBRARY
      Change this to point to your J2EE install

      -->




      <!--
      CLASSPATHS
      Only used for xdoclet at this stage
      -->









      <!--
      INIT
      -->




      <!--
      to create a directory, use the mkdir tag and the direcotry name or a property value
      -->





      <!--
      EJBDOCLET
      USes xdoclet to generate EJB
      -->









































      <!--
      EJB-JAR
      Creates a bank-ejb.jar file.

      Assumes the following:
      All ejb codes lives in a directory/package called ejb
      Interfaces (Remote, Local, Home) may be placed in a directory called interfaces

      Example:
      swinbank.account.ejb
      swinbank.account.ejb.interfaces

      Note that interfaces may also be placed in the ejb directory. Use
      of seperate interfaces directory is optional.

      Your XML deployment descriptors MUST live in a META-INF directory in
      your src.config directory.

      -->









      <!---->


      <!--



      -->




      <!--
      DEPLOY


      -->





      <!--
      MAIN
      This is the main target of our build
      DOES NOT CALL XDOCLET CODE GENERATION
      -->