熟悉ejbql的看过来,谢谢!

bluegirl
03-07-08 0 142

在jboss里部署我的ejb时,报错如下:
2003-07-08 09:41:10,795 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.ProtonAccount] Added findByPrimaryKey query command for home interface
2003-07-08 09:41:10,815 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.ProtonAccount.findByID] EJB-QL: SELECT OBJECT (s) FROM ProtonAccountBean AS s WHERE s.account_number LIKE ?1
2003-07-08 09:41:11,005 ERROR [org.jboss.ejb.EntityContainer] Starting failed: org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "ProtonAccountBean" at line 1, column 24.
Was expecting one of:
"IN" ...
<ABSTRACT_SCHEMA> ...
)
2003-07-08 09:41:11,005 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:jndiName=ejb/com/bank/ProtonAccountHome,service=EJB
org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "ProtonAccountBean" at line 1, column 24.
Was expecting one of:
"IN" ...
<ABSTRACT_SCHEMA> ...
)
ejb-jar.xml
如下:


<?xml version="1.0" encoding="UTF-8"?>
<!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>bothjboss</display-name>
<enterprise-beans>
<session >
<ejb-name>Ledger1</ejb-name>
<home>com.bank.Ledger1Home</home>
<remote>com.bank.Ledger1</remote>
<ejb-class>com.bank.Ledger1Bean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
</session>
<session >
<ejb-name>Transfer</ejb-name>
<home>com.bank.TransferHome</home>
<remote>com.bank.Transfer</remote>
<ejb-class>com.bank.TransferBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
<entity >
<ejb-name>ProtonAccount</ejb-name>
<home>com.bank.ProtonAccountHome</home> <remote>com.bank.ProtonAccount</remote>
<ejb-class>com.bank.ProtonAccountBean</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>
<abstract-schema-name>DB2</abstract-schema-name>
<cmp-field id=
"CMPAttribute_5">
<field-name>account_number</field-name>
</cmp-field>
<cmp-field id=
"CMPAttribute_6">
<field-name>customer_name</field-name>
</cmp-field>
<cmp-field id=
"CMPAttribute_7">
<field-name>balance</field-name>
</cmp-field>
<primkey-field>account_number</primkey-field>
<resource-ref>
<res-ref-name>jdbc/DB2DS</res-ref-name>
<jndi-name>DB2DS</jndi-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findByID</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT (s) FROM ProtonAccountBean AS s WHERE s.account_number LIKE ?1]]></ejb-ql>
</query>
<query>
<query-method>
<method-name>findAllAccounts</method-name>
<method-params/>
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT (s) FROM ProtonAccountBean AS s WHERE s.account_number IS NOT NULL ]]></ejb-ql>
</query>
</entity>
</enterprise-beans>
</ejb-jar>