0 Replies Latest reply on Dec 26, 2002 5:26 PM by Collin

    CMP deployment descriptors generating errors

    Collin Novice

      I had posted about this earlier today, but thought this might help detail the problem better. Basically, I have an entity bean for which I am specifying an EJB-QL statement.

      If I specify and empty statement, everything deploys correctly, but I get a query not found error. That is expected. However, when I specify an EJB-QL statement, it all goes to pot, and I get very strange and inaccurate error messages (i.e. it reports other beans as failing when I did not change them). I suspect there is a piece of information I am missing.

      Here are the relevant pieces of the DD's:

      -----------------
      ejb-jar.xml
      -----------------


      <![CDATA[No Description.]]>

      <ejb-name>ContentBlock</ejb-name>

      <local-home>com.hannonhill.object.interfaces.ContentBlockLocalHome</local-home>
      com.hannonhill.object.interfaces.ContentBlockLocal

      <ejb-class>com.hannonhill.object.ejb.ContentBlockCMP</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      false
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>ContentBlockSchema</abstract-schema-name>
      <cmp-field >
      <![CDATA[Integer ID of the EntityBean.]]>
      <field-name>id</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[]]>
      <field-name>name</field-name>
      </cmp-field>
      <primkey-field>id</primkey-field>


      <query-method>
      <method-name>findByParentFolderIdAndName</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql><![CDATA[SELECT OBJECT(x) FROM ContentBlockSchema AS x WHERE x.parentFolderId = ?1 AND x.name = ?2]]></ejb-ql>




      -----------------
      jaws.xml
      -----------------

      <ejb-name>ContentBlock</ejb-name>

      <cmp-field>
      <field-name>id</field-name>
      <column-name>id</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>name</column-name>

      </cmp-field>


      findByParentFolderIdAndName
      <![CDATA[parentFolderId = {1} AND name = {2}]]>



      <table-name>CXML_BLOCK</table-name>
      <create-table>true</create-table>
      <row-locking></row-locking>




      -----------------
      jbosscmp-jdbc.xml
      -----------------


      <ejb-name>ContentBlock</ejb-name>
      <create-table>true</create-table>
      <table-name>CXML_BLOCK</table-name>

      <cmp-field>
      <field-name>id</field-name>
      <column-name>id</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>name</column-name>

      </cmp-field>
      <!--
      To define load groups for this entity, write a file named
      jbosscmp-jdbc-load-ContentBlockBean.xml and put it in
      your mergedir. Write it according to the following DTD slice:
      <!ELEMENT load-groups (load-group+)>
      <!ELEMENT load-group (load-group-name, description?, field-name+)>
      <!ELEMENT load-group-name (#PCDATA)>
      <!ELEMENT description (#PCDATA)>
      <!ELEMENT field-name (#PCDATA)>
      <!ELEMENT eager-load-group (#PCDATA)>
      <!ELEMENT lazy-load-groups (load-group-name+)>
      -->




      -----------------
      jboss.xml
      -----------------

      <ejb-name>ContentBlock</ejb-name>
      <local-jndi-name>ejb/ContentBlock</local-jndi-name>




      ---------------------------------------------

      Note that I still get the same error, whether or not I specify the jboss query (along with the ejb-ql query). This is the first exception I get, which I think makes no sense:

      17:36:10,953 WARN [ServiceController] Problem creating service jboss.j2ee:jndiName=ejb/object/Conte
      ntPageRegion,service=EJB
      java.lang.ClassNotFoundException: SELECT OBJECT(x) FROM ContentBlockSchema AS x WHERE x.parentFolder
      Id = ?1 AND x.name = ?2com.hannonhill.object.interfaces.ContentPageRegionLocalHome
      at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
      at org.jboss.ejb.Container.create(Container.java:542)
      at org.jboss.ejb.EntityContainer.create(EntityContainer.java:315)

      And is why I think that maybe it gets confused because I left out something.

      Thanks,
      Collin