aspose file tools*
The moose likes BEA/Weblogic and the fly likes ejb-jar.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "ejb-jar.xml" Watch "ejb-jar.xml" New topic
Author

ejb-jar.xml

alec stewart stewart
Ranch Hand

Joined: Dec 23, 2003
Posts: 71
what is wrong with my ejb-jar.xml file i am using weblogic 8.1
while deploying following error is faced:
Exception:weblogic.management.ApplicationException: Prepare failed. Task Id = 0 Module: hello Error: [EJB:011024]The XML parser encountered an error in your deployment descriptor. Please ensure that your deployment descriptor corresponds to the format in the DTD. The error was: Error parsing file 'META-INF/ejb-jar.xml' at line: 12 column: 11. The content of element type "entity" is incomplete, it must match "(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ejb-class,persistence-type,prim-key-class,reentrant,cmp-field*,primkey-field?,env-entry*,ejb-ref*,security-role-ref*,resource-ref*)"..
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<description>this bean prints hello</description>
<enterprise-beans>
<entity>
<description>this is a test bean</description>
<ejb-name>HelloBean</ejb-name>
<home>foo.HelloHome</home>
<remote>foo.Hello</remote>
<ejb-class>foo.HelloBean</ejb-class>
</entity>
</enterprise-beans>
</ejb-jar>
can anyone give me a listing of a corrected file please............
[ February 23, 2004: Message edited by: alec stewart stewart ]
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
Hi Alex,
<?xml version="1.0"?>
<!DOCTYPE xxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>containerManaged</ejb-name>
<home>ejb.entity.cmp.account.AccountHome</home>
<remote>ejb.entity.cmp.account.Account</remote>
<ejb-class>ejb.entity.cmp.account.AccountBean</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>AccountBean</abstract-schema-name>
<cmp-field>
<field-name>accountId</field-name>
</cmp-field>
<cmp-field>
<field-name>balance</field-name>
</cmp-field>
<cmp-field>
<field-name>accountType</field-name>
</cmp-field>
<primkey-field>accountId</primkey-field>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>containerManaged</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
<ejb-client-jar>xxxxxx_Account.jar</ejb-client-jar>
</ejb-jar>
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
Hi Alex,
<?xml version="1.0"?>
<!DOCTYPE xxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>containerManaged</ejb-name>
<home>ejb.entity.cmp.account.AccountHome</home>
<remote>ejb.entity.cmp.account.Account</remote>
<ejb-class>ejb.entity.cmp.account.AccountBean</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>AccountBean</abstract-schema-name>
<cmp-field>
<field-name>accountId</field-name>
</cmp-field>
<cmp-field>
<field-name>balance</field-name>
</cmp-field>
<cmp-field>
<field-name>accountType</field-name>
</cmp-field>
<primkey-field>accountId</primkey-field>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>containerManaged</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
<ejb-client-jar>xxxxxx_Account.jar</ejb-client-jar>
</ejb-jar>
Jussi Taimiaho
Ranch Hand

Joined: Mar 01, 2004
Posts: 40
Originally posted by alec stewart stewart:
The error was: Error parsing file 'META-INF/ejb-jar.xml' at line: 12 column: 11. The content of element type "entity" is incomplete, it must match "(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ejb-class,persistence-type,prim-key-class,reentrant,cmp-field*,primkey-field?,env-entry*,ejb-ref*,security-role-ref*,resource-ref*)"..

Hi!
For future reference you could take a look @ http://www.w3.org/XML/1998/06/xmlspec-report.htm .
According to that, as already replied here your error says: "...,persistence-type,prim-key-class,reentrant..."
Those three elements are required: no question mark, no asterisk.

j
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ejb-jar.xml