This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes Deploying Entity Bean 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 "Deploying Entity Bean" Watch "Deploying Entity Bean" New topic
Author

Deploying Entity Bean

Uma Lade
Greenhorn

Joined: Jun 27, 2003
Posts: 5
Hi Guys,

Im on the way of learning EJB and trying to deploy Entity beans. The app server is Weblogic 8.1.0.

Im getting the following error msg when Im trying to deploy the bean.

"Exception:weblogic.management.ApplicationException: Prepare failed. Task Id = 0 Module: CMPEntity 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/weblogic-ejb-jar.xml' at line: 12 column: 28. Element type "persistence-type" must be declared..

[Deployer:149033]preparing application CMPEntity on myserver
[Deployer:149033]failed application CMPEntity on myserver
[Deployer:149034]An exception occurred for task [Deployer:149026]Deploy application CMPEntity on myserver.: Exception:weblogic.management.ApplicationException: Prepare failed. Task Id = 0 Module: CMPEntity 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/weblogic-ejb-jar.xml' at line: 12 column: 28. Element type "persistence-type" must be declared.. ."

But my weblogic-ejb-jar.xml has the element <persistence-type>. The contents of my weblogic-ejb-jar.xml are given below.

<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN" "http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd">

<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>EntityCMP</ejb-name>
<entity-descriptor>
<entity-cache>
<max-beans-in-cache>1000</max-beans-in-cache>
</entity-cache>
<persistence>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>7.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>7.0</type-version>
</persistence-use>
</persistence>
</entity-descriptor>
<enable-call-by-reference>True</enable-call-by-reference>
<jndi-name>EntityCMPHome</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>


Could anyone pls help me resolving this.
Thanks in advance.

Uma


Thanks & Regards<br />Uma
johnone wilsonone
Greenhorn

Joined: Nov 16, 2004
Posts: 10
There are more appropiate forums that might be able to answer your question better.

But seems like your deployment consttructor is ill formed...
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Hi Uma,

I just installed Weblogic 8.1.0 on my laptop and it comes with several nice working EJB examples.
The container managed example has the following weblogic-ejb-jar.xml file:



As you can see, the example uses the <persistence-use> element and not the <persistence-type> one.

If you look at the http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd file, you'll notice that only persistence-use exists there.

Regards,
Dan


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Uma,

It seems that BEA deviates here from Sun dtds.

If you look at the http://java.sun.com/dtd/ejb-jar_2_0.dtd file, you'll only see the persistence-type element.

Same is true about the deployment descriptor example at the bottom of this page http://java.sun.com/developer/onlineTraining/EJBIntro/EJBIntro.html.

Regards,
Dan
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
This excellent tutorial by Sun http://java.sun.com/developer/onlineTraining/EJBIntro/EJBIntro.html says:

This is a good example of a fairly simple CMP entity bean. Notice that there is no database access logic in the bean. This is because the EJB vendor provides tools for mapping the fields in the CustomerBean to the database.


Since the mapping is, by definition, a vendor specific implementation, no wonder that BEA has its own XML structure to define the persistence.

Regards,
Dan
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
You might find more help on this issue in our BEA/Weblogic forum. I'm sliding this topic over there...


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deploying Entity Bean