Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

error in ejb-jar file

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I get the following error when I try to deploy a simple Stateless Sesseion EJB.
Exception:weblogic.management.ApplicationException: Prepare failed. Task Id = 7 Module: HelloWorld 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: 8 column: 22. The content of element type "enterprise-beans" is incomplete, it must match "(session|entity|message-driven)+"..

ejb-jar file is:
<?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>
<enterprise-beans>
<session>
<ejb-name>Hello</ejb-name>
<home>examples.ejb20.example1.HelloHome</home>
<remote>examples.ejb20.example1.Hello</remote>
<local-home>examples.ejb20.example1.HelloLocalHome</local-home>
<local>examples.ejb20.example1.HelloLocal</local>
<ejb-class>examples.ejb20.example1.HelloBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>

</session>
</enterprise-beans>

</ejb-jar>

Can anybody please tell me what is wrong?
Thanks
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
since you have the transaction-type as container, i would go ahead and add the container-transaction and see if this gets rid of the exception

<container-transaction>
<ejb-name>Hello</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
 
Legend has it that if you rub the right tiny ad, a genie comes out.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic