File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes a problem about ejb1.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "a problem about ejb1.2" Watch "a problem about ejb1.2" New topic
Author

a problem about ejb1.2

miao wang
Greenhorn

Joined: May 25, 2003
Posts: 7
i make a very simple ejb1.2 bean by jbuilder8.
when i test it, the following errors occour. please give me some guide.
in addition, the weblogic is 6.1 and the jdk is 1.3
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Assertion violated ]
at weblogic.utils.Debug.assert(Debug.java:74)
at weblogic.ejb20.internal.EntityEJBObject.setPrimaryKey(EntityEJBObject.java:61)
at weblogic.ejb20.internal.EntityEJBHome.allocateEO(EntityEJBHome.java:147)
at weblogic.ejb20.manager.DBManager.create(DBManager.java:543)
at weblogic.ejb20.manager.DBManager.remoteCreate(DBManager.java:462)
at weblogic.ejb20.internal.EntityEJBHome.create(EntityEJBHome.java:190)
at testejb.Enterprise4Bean_st8cod_HomeImpl.create(Enterprise4Bean_st8cod_HomeImpl.java:114)
at testejb.Enterprise4Bean_st8cod_HomeImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:257)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
My guess would be that JBuilder is not properly generating the EJB's deployment descriptors, I problem many have had in the past. I would check there first. Feel free to post the DDs here if you want us to take a look.
miao wang
Greenhorn

Joined: May 25, 2003
Posts: 7
hi, thanks first.
but what is DDs? and which source file should i post here? home,remotehome,bean?
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
DDs are deployment descriptors. Every EJB is required (by the EJB Specification) to be packaged with a deployment descriptor named ejb-jar.xml. Furthermore, WebLogic (like other vendors) requires the presence of WebLogic-specific deployment descriptors named weblogic-ejb-jar.xml and weblogic-cmp-rdbms-jar.xml (CMP only).
If these descriptors are not correct then they could result in deployment errors or in your case runtime errors.
miao wang
Greenhorn

Joined: May 25, 2003
Posts: 7
hi, thanks first. i am a greenhorn indeed.
the ejb-jar.xml is showed below.
<?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>
<description>this is a test EJB module</description>
<display-name>testEJB</display-name>
<enterprise-beans>
<session>
<description>this is a simple ejb test of wang miao</description>
<ejb-name>Enterprise1</ejb-name>
<home>testejb.Enterprise1Home</home>
<remote>testejb.Enterprise1</remote>
<ejb-class>testejb.Enterprise1Bean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<description>the yearly interest rate</description>
<env-entry-name>interestRate</env-entry-name>
<env-entry-type>java.lang.Float</env-entry-type>
<env-entry-value>8.2</env-entry-value>
</env-entry>
</session>
<entity>
<description>this is a test entity bean which persistance is managed by the container</description>
<ejb-name>Enterprise4</ejb-name>
<home>testejb.Enterprise4Home</home>
<remote>testejb.Enterprise4</remote>
<ejb-class>testejb.Enterprise4Bean</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>customerName</field-name>
</cmp-field>
<cmp-field>
<field-name>phoneNumber</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>Enterprise1</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<description />
<ejb-name>Enterprise4</ejb-name>
<method-intf>Home</method-intf>
<method-name>create</method-name>
<method-params>
<method-param>java.lang.Integer</method-param>
<method-param>java.lang.String</method-param>
</method-params>
</method>
<method>
<description />
<ejb-name>Enterprise4</ejb-name>
<method-intf>Home</method-intf>
<method-name>create</method-name>
<method-params>
<method-param>java.lang.Integer</method-param>
</method-params>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
<ejb-client-jar>testEJBClient</ejb-client-jar>
</ejb-jar>

the weblogic-ejb-jar.xml is below:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN' 'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<description>this is a test EJB module</description>
<weblogic-enterprise-bean>
<ejb-name>Enterprise1</ejb-name>
<stateless-session-descriptor>
<pool>
<max-beans-in-free-pool>3</max-beans-in-free-pool>
<initial-beans-in-free-pool>1</initial-beans-in-free-pool>
</pool>
</stateless-session-descriptor>
<jndi-name>Enterprise1</jndi-name>
</weblogic-enterprise-bean>
<weblogic-enterprise-bean>
<ejb-name>Enterprise4</ejb-name>
<entity-descriptor>
<pool>
<max-beans-in-free-pool>3</max-beans-in-free-pool>
<initial-beans-in-free-pool>1</initial-beans-in-free-pool>
</pool>
<persistence>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>5.1.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-type>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>5.1.0</type-version>
</persistence-use>
</persistence>
</entity-descriptor>
<jndi-name>Enterprise4</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
miao wang
Greenhorn

Joined: May 25, 2003
Posts: 7
weblogic-rdbms-jar.xml is below:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-rdbms-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB 1.1 RDBMS Persistence//EN' 'http://www.bea.com/servers/wls600/dtd/weblogic-rdbms11-persistence-600.dtd'>
<weblogic-rdbms-jar>
<weblogic-rdbms-bean>
<ejb-name>Enterprise4</ejb-name>
<data-source-name>160</data-source-name>
<table-name>wm.wm_test</table-name>
<field-map>
<cmp-field>id</cmp-field>
<dbms-column>id</dbms-column>
</field-map>
<field-map>
<cmp-field>customerName</cmp-field>
<dbms-column>customerName</dbms-column>
</field-map>
<field-map>
<cmp-field>phoneNumber</cmp-field>
<dbms-column>phoneNumber</dbms-column>
</field-map>
<enable-tuned-updates>True</enable-tuned-updates>
</weblogic-rdbms-bean>
<create-default-dbms-tables>True</create-default-dbms-tables>
</weblogic-rdbms-jar>

the weblogic-setting-jar.xml is showed below.
<?xml version="1.0" encoding="UTF-8"?>
<archive-settings>
<props>
<prop>
<prop-name>create-default-dbms-tables</prop-name>
<prop-type>String</prop-type>
<prop-value>True</prop-value>
</prop>
<prop>
<prop-name>enable-tuned-updates</prop-name>
<prop-type>String</prop-type>
<prop-value>True</prop-value>
</prop>
</props>
</archive-settings>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: a problem about ejb1.2