geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <djen...@gluecode.com>
Subject Re: Deployment fail at persistent EJB
Date Tue, 12 Apr 2005 00:05:11 GMT

On Apr 11, 2005, at 4:39 PM, Katia Aresti Gonzalez wrote:

> Hi David!!!
>
> It helps, but i dont understand what you say about  persistence-type 
> has the wrong case (should be Container or Bean).

instead of <persistence-type>container</persistence-type>
it should be <persistence-type>Container</persistence-type>

>   Can i fix this xml problems with any tutorial or how to, or an 
> example of the ejb-jar.xml and openejb-jar.xml should be??

I think studying the ejb-jar-2_1.xsd schema is the only way to figure 
out what goes in the ejb-jar.xml document.  (there might be validating 
xml editors, but I've never seen one).  Similarly there is an 
openejb-jar.xsd schema for the vendor specific plan.  It looks to me as 
if you may have a plan for version 1 of openejb: this would be useless 
with openejb 2, the version integrated in geronimo.

> I understand what they are for, but im a bit loose between the 
> diferences that i should make in the original xml and the ones 
> geronimo needs. Have you got any example to let me or send me to my 
> personal email address, please? If not, is there any tutorial? When I 
> finish with this, i will start programming longer examples for my 
> proyect, i have only 2 weeks to do this, because i have to give the 
> documentation 12th of May :-). I will send it for you to have a look, 
> cause will be a user start into geronimo in spanish, and might be very 
> usefull for spanish comunity!!! 
>
> Ok, so... can you  or anybody help me again please??? ;-)
>
>  And the last question. To try de EJBs, ok... I just want to try then 
> into Geronimo with a client main(), just deploying a jar. Do i need a 
> application.xml? When i use the examples on a web application i know 
> it need web.xml and the application.xml. How can I see with a client 
> main that my EJBs work into Geronimo?

If you are deploying a single module (web or ejb, or application 
client, or resource adapter) you don't need an application.xml and you 
don't need to pack the module into an .ear.  If you are deploying 
several modules packed in an ear then you need an application.xml.

I don't understand if you want to write a j2ee application client that 
would be packed in an ear with the ejb jar or a standalone non-j2ee 
client that would be completely separate.  One advantage of the 
app-client is that you can use ejb-refs to "find" the ejbs in the rest 
of the app.  Otherwise you have to set up jndi properties yourself and 
be sure to add jndi-name elements to your openejb-jar plans.  The 
openejb itests are all non-j2ee clients.  I'm not aware of a publically 
available example of a j2ee app client.

thanks
david jencks

>
> Than you a lot for your help!!!!!
>
> Katia
>
>
>
>  
> >From: David Jencks <david_jencks@yahoo.com>
>  >Reply-To: user@geronimo.apache.org
>  >To: user@geronimo.apache.org
>  >Subject: Re: Deployment fail at persistent EJB
>  >Date: Mon, 11 Apr 2005 16:00:13 -0700
>  >
>  >A couple of obvious problems are that the reentrant element should
>  >be  after prim-key-class and all lowercase (false not False) and the
>  >  persistence-type has the wrong case (should be Container or Bean).
>  >
>  >I've found that looking at the errors reported by xmlbeans and  
>  >comparing with the schema has always led me to a valid xml document.
>  >
>  >hope this helps
>  >david jencks
>  >
>  >On Apr 11, 2005, at 3:39 PM, Katia Aresti Gonzalez wrote:
>  >
>  >>Hello!!!
>  >>
>  >>I was trying to deploy the persistent EJB. Im using the OpenEJB  
>  >>example off ships and titan... Its an easy example, just 2 entity
>  >>bean  and a session bean. The problem is that the deployment fails
>  >>and this  the error
>  >>that appears:
>  >>
>  >>i cant guess what is the problem. Im trying to deploy de jar, build
>  >>  with maven, and buils succesfull,
>  >>using the ejb-jar.xml and the openejb-jar.xml
>  >>
>  >>Anybody can help??? thank you!!!!
>  >>
>  >>Katia
>  >>
>  >>
>  >>C:\gero>start java -jar bin/server.jar
>  >>
>  >>C:\gero>java -jar bin/deployer.jar --user system --password manager
>  >>  deploy d:/cm
>  >>p/build/dist/prueba-ejbs.jar
>  >>Deployment failed
>  >>  Server reports: org.apache.geronimo.common.DeploymentException:
>  >>Error  parsing
>  >>ejb-jar.xml
>  >>        Error parsing ejb-jar.xml
>  >>        Invalid deployment descriptor: [error: Element not allowed:
>  >>  reentrant@ht
>  >>tp://java.sun.com/xml/ns/j2ee in element  
>  >>entity@http://java.sun.com/xml/ns/j2ee,
>  >>error: String 'container' is not a valid enumerated value for  
>  >>persistence-typeT
>  >>ype in namespace http://java.sun.com/xml/ns/j2ee, error: Element
>  >>not  allowed: cm
>  >>p-field@http://java.sun.com/xml/ns/j2ee in element  
>  >>entity@http://java.sun.com/xm
>  >>l/ns/j2ee, error: Element not allowed:  
>  >>cmp-field@http://java.sun.com/xml/ns/j2ee
>  >>in element entity@http://java.sun.com/xml/ns/j2ee, error: Element
>  >>not  allowed:
>  >>cmp-field@http://java.sun.com/xml/ns/j2ee in element  
>  >>entity@http://java.sun.com/
>  >>xml/ns/j2ee, error: Element not allowed:  
>  >>cmp-field@http://java.sun.com/xml/ns/j2
>  >>ee in element entity@http://java.sun.com/xml/ns/j2ee, error:
>  >>Element  not allowed
>  >>: cmp-field@http://java.sun.com/xml/ns/j2ee in element  
>  >>entity@http://java.sun.co
>  >>m/xml/ns/j2ee, error: Element not allowed:  
>  >>primkey-field@http://java.sun.com/xml
>  >>/ns/j2ee in element entity@http://java.sun.com/xml/ns/j2ee, error:  
>  >>Element not a
>  >>llowed: resource-ref@http://java.sun.com/xml/ns/j2ee in element  
>  >>entity@http://ja
>  >>va.sun.com/xml/ns/j2ee, error: Expected element(s) in element  
>  >>entity@http://java
>  >>.sun.com/xml/ns/j2ee, error: Element not allowed:  
>  >>reentrant@http://java.sun.com/
>  >>xml/ns/j2ee in element entity@http://java.sun.com/xml/ns/j2ee,
>  >>error:  String 'be
>  >>an' is not a valid enumerated value for persistence-typeType in  
>  >>namespace http:/
>  >>/java.sun.com/xml/ns/j2ee, error: Element not allowed:  
>  >>primkey-field@http://java
>  >>.sun.com/xml/ns/j2ee in element  
>  >>entity@http://java.sun.com/xml/ns/j2ee, error: E
>  >>lement not allowed: resource-ref@http://java.sun.com/xml/ns/j2ee in
>  >>  element enti
>  >>ty@http://java.sun.com/xml/ns/j2ee, error: Expected element(s) in  
>  >>element entity
>  >>@http://java.sun.com/xml/ns/j2ee]
>  >>Descriptor: <ejb-jar  
>  >>xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehttp://j
>  >>ava.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1"  
>  >>xmlns:xsi="http://www.w3.
>  >>org/2001/XMLSchema-instance"
>  >>xmlns="http://java.sun.com/xml/ns/j2ee">
>  >>  <enterprise-beans>
>  >>    <entity>
>  >>      <ejb-name>CabinEJB</ejb-name>
>  >>      <home>com.titan.cabin.CabinHomeRemote</home>
>  >>      <remote>com.titan.cabin.CabinRemote</remote>
>  >>      <ejb-class>com.titan.cabin.CabinBean</ejb-class>
>  >>      <reentrant>False</reentrant>
>  >>      <persistence-type>container</persistence-type>
>  >>      <prim-key-class>java.lang.Integer</prim-key-class>
>  >>      <cmp-field>
>  >>        <field-name>id</field-name>
>  >>      </cmp-field>
>  >>      <cmp-field>
>  >>        <field-name>name</field-name>
>  >>      </cmp-field>
>  >>      <cmp-field>
>  >>        <field-name>deckLevel</field-name>
>  >>      </cmp-field>
>  >>      <cmp-field>
>  >>        <field-name>shipId</field-name>
>  >>      </cmp-field>
>  >>      <cmp-field>
>  >>        <field-name>bedCount</field-name>
>  >>      </cmp-field>
>  >>      <primkey-field>id</primkey-field>
>  >>      <resource-ref>
>  >>        <res-ref-name>jdbc/titanDB</res-ref-name>
>  >>        <res-type>javax.sql.DataSource</res-type>
>  >>        <res-auth>Container</res-auth>
>  >>      </resource-ref>
>  >>    </entity>
>  >>    <entity>
>  >>      <description>This bean represents a cruise
>  >>ship.</description>
>  >>      <ejb-name>ShipEJB</ejb-name>
>  >>      <home>com.titan.ship.ShipHomeRemote</home>
>  >>      <remote>com.titan.ship.ShipRemote</remote>
>  >>      <ejb-class>com.titan.ship.ShipBean</ejb-class>
>  >>      <reentrant>False</reentrant>
>  >>      <persistence-type>bean</persistence-type>
>  >>      <prim-key-class>java.lang.Integer</prim-key-class>
>  >>      <primkey-field>id</primkey-field>
>  >>      <resource-ref>
>  >>        <description>DataSource for the Titan
>  >>database</description>
>  >>        <res-ref-name>jdbc/titanDB</res-ref-name>
>  >>        <res-type>javax.sql.DataSource</res-type>
>  >>        <res-auth>Container</res-auth>
>  >>      </resource-ref>
>  >>    </entity>
>  >>    <session>
>  >>      <ejb-name>TravelAgentEJB</ejb-name>
>  >>      <home>com.titan.travelagent.TravelAgentHomeRemote</home>
>  >>      <remote>com.titan.travelagent.TravelAgentRemote</remote>
>  >>      <ejb-class>com.titan.travelagent.TravelAgentBean</ejb-class>
>  >>      <session-type>Stateless</session-type>
>  >>      <transaction-type>Container</transaction-type>
>  >>      <ejb-ref>
>  >>        <ejb-ref-name>ejb/titan/CabinEJB</ejb-ref-name>
>  >>        <ejb-ref-type>Entity</ejb-ref-type>
>  >>        <home>com.titan.cabin.CabinHomeRemote</home>
>  >>        <remote>com.titan.cabin.CabinRemote</remote>
>  >>        <ejb-link>CabinEJB</ejb-link>
>  >>      </ejb-ref>
>  >>    </session>
>  >>  </enterprise-beans>
>  >>  <assembly-descriptor>
>  >>    <security-role>
>  >>      <description>This role represents everyone who is allowed
>  >>full  access
>  >>                to te CabinEJB.</description>
>  >>      <role-name>everyone</role-name>
>  >>    </security-role>
>  >>    <method-permission>
>  >>      <role-name>everyone</role-name>
>  >>      <method>
>  >>        <ejb-name>CabinEJB</ejb-name>
>  >>        <method-name>*</method-name>
>  >>      </method>
>  >>      <method>
>  >>        <ejb-name>TravelAgentEJB</ejb-name>
>  >>        <method-name>*</method-name>
>  >>      </method>
>  >>    </method-permission>
>  >>    <method-permission>
>  >>      <role-name>everyone</role-name>
>  >>      <method>
>  >>        <ejb-name>ShipEJB</ejb-name>
>  >>        <method-name>*</method-name>
>  >>      </method>
>  >>    </method-permission>
>  >>    <container-transaction>
>  >>      <method>
>  >>        <ejb-name>CabinEJB</ejb-name>
>  >>        <method-name>*</method-name>
>  >>      </method>
>  >>      <method>
>  >>        <ejb-name>ShipEJB</ejb-name>
>  >>        <method-name>*</method-name>
>  >>      </method>
>  >>      <method>
>  >>        <ejb-name>TravelAgentEJB</ejb-name>
>  >>        <method-name>*</method-name>
>  >>      </method>
>  >>      <trans-attribute>Required</trans-attribute>
>  >>    </container-transaction>
>  >>  </assembly-descriptor>
>  >></ejb-jar>
>  >>
>  >>/---------------open EJB jar.xml----------
>  >><?xml version="1.0"?>
>  >>
>  >><openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
>  >>    <ejb-deployment ejb-name="CabinEJB"
>  >>deployment-id="titan/CabinEJB"  container-id="Default CMP
>  >>Container">
>  >>        <resource-link res-ref-name="jdbc/titanDB" res-id="Default
>  >>JDBC  Database"/>
>  >>    </ejb-deployment>
>  >>    <ejb-deployment ejb-name="ShipEJB"
>  >>deployment-id="titan/ShipEJB"  container-id="Default BMP
>  >>Container">
>  >>        <resource-link res-ref-name="jdbc/titanDB" res-id="Default
>  >>JDBC  Database"/>
>  >>    </ejb-deployment>
>  >>    <ejb-deployment ejb-name="TravelAgentEJB"  
>  >>deployment-id="titan/TravelAgentEJB" container-id="Default
>  >>Stateless  Container"/>
>  >></openejb-jar>
>  >>
>  >>_________________________________________________________________
>  >>Acepta el reto MSN Premium: Correos más divertidos con fotos y
>  >>textos  increíbles en MSN Premium. Descárgalo y pruébalo 2 meses
>  >>gratis.  http://join.msn.com?
>  >>XAPID=1697&DI=1055&HL=Footer_mailsenviados_correosmasdivertidos
>  >>
>  >
>
>  Coches nuevos, coches de ocasión, coches de Km 0 Si piensas en 
> cambiar de coche, MSN Motor. 

Mime
View raw message