0 Replies Latest reply on Oct 21, 2003 5:34 AM by jagga

    ejbql problem with jboss-4.0.0

    jagga Newbie

      Hi all,
      I am trying to deploy a cmp2.0 bean on jboss 4.0.0 , though the table gets created in database but it gives error and doesnt deploy the bean.
      My ejb.jar is as follows:

      <?xml version="1.0"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">
      <ejb-jar>
      <display-name>Product</display-name>
      <enterprise-beans>

      Product
      <ejb-name>Product</ejb-name>
      product.ProductHome
      product.Product1
      <ejb-class>product.ProductBean</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>ProductBean</abstract-schema-name>
      <cmp-field>

      <field-name>productID</field-name>

      </cmp-field>
      <cmp-field>

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

      <field-name>price</field-name>
      </cmp-field>
      <primkey-field>productID</primkey-field>

      <query-method>
      <method-name>findByPrimaryKey</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql><![CDATA[select object(a) from duct1 d where d.productid=?1]]></ejb-ql>


      <query-method>
      <method-name>findAll</method-name>
      <method-params>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[select object(o) from duct1 d]]></ejb-ql>




      </enterprise-beans>
      </ejb-jar>


      The exception which i am getting is :
      16:24:24,366 INFO [MainDeployer] Starting deployment of package: file:/D:/jboss
      4.0/jboss-4.0.0DR2/jboss-4.0.0DR2/server/default/deploy/product.jar
      16:24:31,187 INFO [EjbModule] Deploying Product
      16:24:31,337 INFO [EJBDeployer] DEPLOYED (create) GENERATED MBEANS
      16:24:31,377 INFO [EjbModule] Started jboss.j2ee:module=product.jar,service=Ejb
      Module
      16:24:31,387 INFO [TxInterceptorCMT] Setting TxSupport map for container: org.j
      boss.ejb.EntityContainer@d74dae
      16:24:31,697 INFO [EntityInstancePool] Started null
      16:24:32,429 INFO [Product] Table 'duct1' already exists
      16:24:32,429 ERROR [EntityContainer] Starting failed: org.jboss.deployment.Deplo
      ymentException: Error compiling ejbql; - nested throwable: (org.jboss.ejb.plugin
      s.cmp.ejbql.ParseException: Encountered "duct1" at line 1, column 23.
      Was expecting one of:
      "IN" ...
      <ABSTRACT_SCHEMA> ...
      )
      16:24:32,439 WARN [ServiceController] Problem starting service jboss.j2ee:jndiN
      ame=Product,service=EJB
      org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwa
      ble: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "duct1" at lin
      e 1, column 23.
      Was expecting one of:
      "IN" ...
      <ABSTRACT_SCHEMA> ...
      )
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.(JDBCEJBQLQuery.j
      ava:46)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createEJBQLQuery(JD
      BCCommandFactory.java:54)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.start(JDBCQueryManage......

      Please help.

      Thanks.