Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

[OpenEJB] Can someone help me ??

843829Mar 21 2004 — edited Mar 22 2004
Hi , I write a SessionBean and an EntityBean(CMP), and I want to deploy them in OpenEJB-0.9.2,
but I have some trouble, the two Beans can be deployed without any problem, when server started,
I found the some thing in my openejb.log:

DEBUG: Instantiating assembler class org.openejb.alt.assembler.classic.Assembler
FATAL: Cannot find bean "EmployeeBean" referenced by bean "AgentEJB".
WARN : Jar not loaded. c:\ejb\entity\agent.jar. Cannot find bean "EmployeeBean" referenced by bean "AgentEJB".
DEBUG: Containers : 2
DEBUG: Type Container ID
DEBUG: ENTITY MySQL CMP Container
DEBUG: STATELESS My Stateless Session Container
DEBUG: Deployments : 1
DEBUG: Type Deployment ID
DEBUG: CMP_ENTITY EmployeeBean
DEBUG: SecurityService : org.openejb.ri.sp.PseudoSecurityService
DEBUG: TransactionManager: org.openejb.core.TransactionManagerWrapper
INFO : OpenEJB ready.

It seems that it can't find my EntityBean(EmployeeBean) , how can I fix this problem??
here is my deployment-descriptor:

for EmployeeBean :(ejb-jar.xml)
<?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>
<enterprise-beans>
<entity>
<ejb-name>EmployeeBean</ejb-name>
<home>tw.edu.entity.EmployeeHome</home>
<remote>tw.edu.entity.Employee</remote>
<ejb-class>tw.edu.entity.EmployeeBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-field>
<field-name>id</field-name>
</cmp-field>
<cmp-field>
<field-name>firstname</field-name>
</cmp-field>
<cmp-field>
<field-name>lastname</field-name>
</cmp-field>
<cmp-field>
<field-name>email</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<resource-ref>
<res-ref-name>jdbc/mysql</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>

</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>EmployeeBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
---------------------------------------------------------------------------------
for AgentBean: (ejb-jar.xml)
<?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>
<enterprise-beans>
<session>
<ejb-name>AgentEJB</ejb-name>
<home>tw.edu.agent.AgentHome</home>
<remote>tw.edu.agent.Agent</remote>
<ejb-class>tw.edu.agent.AgentBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-ref>
<ejb-ref-name>EmployeeHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>tw.edu.entity.EmployeeHome</home>
<remote>tw.edu.entity.Employee</remote>
</ejb-ref>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>AgentEJB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>

by the way, this is similar to the example from Enterprise JavaBeans, 3rd Edition
I follow the step from the book, the EmployBean works individually, but when deployed with SessionBean
,it cannot be find by the session bean.
who can help me??
Any help will be appreciated, thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 19 2004
Added on Mar 21 2004
3 comments
184 views