You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by mi...@gentlemansclub.de on 2006/07/13 13:18:08 UTC

what does a ejb-jar.xml looks like?

hello,

i have the task to add an ear-file to geronimo 1.1.

if i copy the ear-file into the deploy-folder and start the server via 'startup.bat' the server starts as known.

but when it is started it tries to deploy the ear in the deploy-folder.

and then occurs a wonderful error-message like: "Error: Unable to distribute my.ear: Error parsing ejb-jar.xml"

now my questions:
1) what does this ejb-jar.xml looks like? is there a standard-configuration of it? if yes, where could i find it?
2) where is this ebj-jar.xml to save to?

regards from germany... mika
-- 


Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl

Re: Re: Re: Re: what does a ejb-jar.xml looks like?

Posted by mika <mi...@gentlemansclub.de>.
Well,

first I found out, that in the <Geronimo>\repository\org\apache\geronimo\spec-folder a list of supported specifications are. There i found the geronimo-ejb_2.1_spec and geronimo-j2ee_1.4_spec folders. I hope this helps you...

now my application.xml:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'>

<application>
  <display-name>MyApp</display-name>
  <description>MyApp Server</description>
  <module>
    <ejb>myserver.jar</ejb>
  </module>
  <module>
    <web>
      <web-uri>myserver.war</web-uri>
      <context-root>/myapp</context-root>
    </web>
  </module>
  <module>
    <web>
      <web-uri>mysample.war</web-uri>
      <context-root>/sample</context-root>
    </web>
  </module>
  <module>
    <web>
      <web-uri>wsci.war</web-uri>
      <context-root>/service</context-root>
    </web>
  </module>
</application>

(There are also these WAR's in the EAR and some other JAR's which needn't be wrote in there... because in the other two JAR's are only some classes, as i understood)

I've used this ear-file in some other application-servers and I thought, that I can use it unchanged in Geronimo, too. But this is a wrong assumption, as i know now ;-).

I think that there must be done some changes...

The beginning of the ejb-jar.xml looks like following:

<?xml version="1.0" encoding="UTF-8"?>
<!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>
<!-- ... -->
</ejb-jar>

Do I have to change it too? Or is it enough to create a geronimo-ejb-jar.xml ?

Thanks,
 mika

> To start with, why don't you take a look at this:
> 
> http://chariotsolutions.com/geronimo/ejb.html#id2604520
> 
> There should be a DOCTYPE or xmlns at the very beginning of your
> ejb-jar.xml, and by comparing the values in the DOCTYPE or xmlns to
> the samples at that link, you should be able to figure out what
> version of EJB you are using.  I'm not sure Geronimo supports "EJB
> 1.0" but that's very, very old, so I think you may find you're using
> "EJB 1.1" at a minimum.  If you don't see the DOCTYPE or xmlns listed
> in your file, or they don't match anything at that link, can you post
> the first few lines of your ejb-jar.xml including the DOCTYPE or xmlns
> here?
> 
> Also, can you post your application.xml?  That would let us confirm
> the version of the EAR packaging it's using, and make sure it's
> listing the right values for your EAR.  As I understand it you have 3
> WARs, 1 EJB JAR, and 2 regular JARs in the EAR, so we want to make
> sure you have the right entries in application.xml for the EAR.
> 
> Thanks,
>      Aaron
> 
> On 7/14/06, mika <mi...@gentlemansclub.de> wrote:
> > Hi Aaron,
> >
> > first i thank you for your advices.
> >
> > Now my answears:
> > I don't know exactly what EJB's are. I only know that they are
> Enterprise Java Beans. But what they are doing is a little black cloud in my mind.
> >
> > My EAR consists of three JAR's, three WAR's and an application.xml as
> well as a principle.xml.
> >
> > In one of the JAR's is an ejb-jar.xml. This file consists, as you wrote,
> of the Beans decided to deploy.
> > This JAR is the only which has to be deployed. The other two are some
> additional informations... some classes more or less.
> >
> > The versions of J2EE and EJB depends on what geronimo 1.1 requires. I
> think, that they are not higher than J2EE 1.2 and EJB 1 (i asked my boss, and
> this is what he is supposing).
> >
> > In association with this and my thinking of solve this problem I suggest
> that I have to set an URL to the ejb-jar.xml in the contained JAR-file of
> the EAR.
> > Is this the right approach?
> > If you could tell me the way of setting the ejb-jar.xml-path so, that
> geronimo doesn't make this error, I would thank you very much!
> >
> > PS: assume that the ejb-jar.xml is contained in the META-INF-directory
> of MyJAR.jar, which is contained in MyEAR.ear. This is only for better
> understanding :-).
> >
> > Thanks a lot, mika
> >
> > > Well, it sounds like the EAR contains an EJB JAR, or at least, the
> > > META-INF/application.xml for the EAR is *saying* that it contains an
> > > EJB JAR.
> > >
> > > That EJB JAR should be a JAR file in the EAR, that contains a file
> > > META-INF/ejb-jar.xml file.
> > >
> > > The format of the ejb-jar.xml file is controlled by the EJB
> > > specification.  It's a bit different depending on which revision of
> > > J2EE and EJB you're targeting.  But there are DTDs or XML Schemas that
> > > dictate the format for each version.
> > >
> > > As far as what the content of the ejb-jar.xml file is supposed to be,
> > > that depends on what the EJB JAR contains -- there should be entries
> > > in ejb-jar.xml for each EJB you want to deploy, for example, in the
> > > format dictated by the DTD or Schema.
> > >
> > > So from here, I have a few questions for you:
> > >  - Do you know what EJBs are and how to use them?
> > >  - Do you think your EAR contains an EJB JAR?
> > >  - Would it help you if I gave you the URLs for the ejb-jar.xml DTDs
> or
> > > Schemas?
> > >  - If so, do you know which EJB or J2EE spec version you're targeting?
> > >
> > > Thanks,
> > >     Aaron
> > --
> >
> >
> > Echte DSL-Flatrate dauerhaft für 0,- Euro*!
> > "Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl
> >

-- 


Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl

Re: Re: Re: what does a ejb-jar.xml looks like?

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
To start with, why don't you take a look at this:

http://chariotsolutions.com/geronimo/ejb.html#id2604520

There should be a DOCTYPE or xmlns at the very beginning of your
ejb-jar.xml, and by comparing the values in the DOCTYPE or xmlns to
the samples at that link, you should be able to figure out what
version of EJB you are using.  I'm not sure Geronimo supports "EJB
1.0" but that's very, very old, so I think you may find you're using
"EJB 1.1" at a minimum.  If you don't see the DOCTYPE or xmlns listed
in your file, or they don't match anything at that link, can you post
the first few lines of your ejb-jar.xml including the DOCTYPE or xmlns
here?

Also, can you post your application.xml?  That would let us confirm
the version of the EAR packaging it's using, and make sure it's
listing the right values for your EAR.  As I understand it you have 3
WARs, 1 EJB JAR, and 2 regular JARs in the EAR, so we want to make
sure you have the right entries in application.xml for the EAR.

Thanks,
     Aaron

On 7/14/06, mika <mi...@gentlemansclub.de> wrote:
> Hi Aaron,
>
> first i thank you for your advices.
>
> Now my answears:
> I don't know exactly what EJB's are. I only know that they are Enterprise Java Beans. But what they are doing is a little black cloud in my mind.
>
> My EAR consists of three JAR's, three WAR's and an application.xml as well as a principle.xml.
>
> In one of the JAR's is an ejb-jar.xml. This file consists, as you wrote, of the Beans decided to deploy.
> This JAR is the only which has to be deployed. The other two are some additional informations... some classes more or less.
>
> The versions of J2EE and EJB depends on what geronimo 1.1 requires. I think, that they are not higher than J2EE 1.2 and EJB 1 (i asked my boss, and this is what he is supposing).
>
> In association with this and my thinking of solve this problem I suggest that I have to set an URL to the ejb-jar.xml in the contained JAR-file of the EAR.
> Is this the right approach?
> If you could tell me the way of setting the ejb-jar.xml-path so, that geronimo doesn't make this error, I would thank you very much!
>
> PS: assume that the ejb-jar.xml is contained in the META-INF-directory of MyJAR.jar, which is contained in MyEAR.ear. This is only for better understanding :-).
>
> Thanks a lot, mika
>
> > Well, it sounds like the EAR contains an EJB JAR, or at least, the
> > META-INF/application.xml for the EAR is *saying* that it contains an
> > EJB JAR.
> >
> > That EJB JAR should be a JAR file in the EAR, that contains a file
> > META-INF/ejb-jar.xml file.
> >
> > The format of the ejb-jar.xml file is controlled by the EJB
> > specification.  It's a bit different depending on which revision of
> > J2EE and EJB you're targeting.  But there are DTDs or XML Schemas that
> > dictate the format for each version.
> >
> > As far as what the content of the ejb-jar.xml file is supposed to be,
> > that depends on what the EJB JAR contains -- there should be entries
> > in ejb-jar.xml for each EJB you want to deploy, for example, in the
> > format dictated by the DTD or Schema.
> >
> > So from here, I have a few questions for you:
> >  - Do you know what EJBs are and how to use them?
> >  - Do you think your EAR contains an EJB JAR?
> >  - Would it help you if I gave you the URLs for the ejb-jar.xml DTDs or
> > Schemas?
> >  - If so, do you know which EJB or J2EE spec version you're targeting?
> >
> > Thanks,
> >     Aaron
> --
>
>
> Echte DSL-Flatrate dauerhaft für 0,- Euro*!
> "Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl
>

Re: Re: what does a ejb-jar.xml looks like?

Posted by mika <mi...@gentlemansclub.de>.
Hi Aaron,

first i thank you for your advices.

Now my answears:
I don't know exactly what EJB's are. I only know that they are Enterprise Java Beans. But what they are doing is a little black cloud in my mind.

My EAR consists of three JAR's, three WAR's and an application.xml as well as a principle.xml.

In one of the JAR's is an ejb-jar.xml. This file consists, as you wrote, of the Beans decided to deploy.
This JAR is the only which has to be deployed. The other two are some additional informations... some classes more or less.

The versions of J2EE and EJB depends on what geronimo 1.1 requires. I think, that they are not higher than J2EE 1.2 and EJB 1 (i asked my boss, and this is what he is supposing).

In association with this and my thinking of solve this problem I suggest that I have to set an URL to the ejb-jar.xml in the contained JAR-file of the EAR.
Is this the right approach?
If you could tell me the way of setting the ejb-jar.xml-path so, that geronimo doesn't make this error, I would thank you very much!

PS: assume that the ejb-jar.xml is contained in the META-INF-directory of MyJAR.jar, which is contained in MyEAR.ear. This is only for better understanding :-).

Thanks a lot, mika

> Well, it sounds like the EAR contains an EJB JAR, or at least, the
> META-INF/application.xml for the EAR is *saying* that it contains an
> EJB JAR.
> 
> That EJB JAR should be a JAR file in the EAR, that contains a file
> META-INF/ejb-jar.xml file.
> 
> The format of the ejb-jar.xml file is controlled by the EJB
> specification.  It's a bit different depending on which revision of
> J2EE and EJB you're targeting.  But there are DTDs or XML Schemas that
> dictate the format for each version.
> 
> As far as what the content of the ejb-jar.xml file is supposed to be,
> that depends on what the EJB JAR contains -- there should be entries
> in ejb-jar.xml for each EJB you want to deploy, for example, in the
> format dictated by the DTD or Schema.
> 
> So from here, I have a few questions for you:
>  - Do you know what EJBs are and how to use them?
>  - Do you think your EAR contains an EJB JAR?
>  - Would it help you if I gave you the URLs for the ejb-jar.xml DTDs or
> Schemas?
>  - If so, do you know which EJB or J2EE spec version you're targeting?
> 
> Thanks,
>     Aaron
-- 


Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl

Re: build.xml example

Posted by Rafael Barrera Oro <ra...@akyasociados.com.ar>.
The most important thing to me is to be able to deploy Jars and Wars 
into Geronimo, but starting and stoping it could be useful for me 
though. What i have now is a simple Jar with a simple SessionBean.

Donald Woods wrote:
> Rafael, are you wanting to use Ant to run the Geronimo build, 
> start/stop Geronimo, deploy apps into Geronimo, ...?
>
> I have a working sample of the first (starting Geronimo build from Ant).
>
>
> -Donald
>
>
> Aaron Mulder wrote:
>> What kind of application are you working on?  (e.g. WAR, EAR, EJBs,
>> etc.)  I can probably sketch some steps that your build should take,
>> though I don't have a specific Ant/Geronimo example (I've used Maven
>> for all my Geronimo-related builds).
>>
>> Thanks,
>>    Aaron
>>
>> On 7/13/06, Rafael Barrera Oro <ra...@akyasociados.com.ar> wrote:
>>
>>> Im sorry, but i 've been unable to find out what a build.xml example 
>>> for
>>> using ant with geronimo looks like, so i ask you guys.
>>>
>>> As usual, thanks in advance
>>>
>>> Rafael
>>>
>>
>>


Re: build.xml example

Posted by Donald Woods <dr...@yahoo.com>.
Rafael, are you wanting to use Ant to run the Geronimo build, start/stop 
Geronimo, deploy apps into Geronimo, ...?

I have a working sample of the first (starting Geronimo build from Ant).


-Donald


Aaron Mulder wrote:
> What kind of application are you working on?  (e.g. WAR, EAR, EJBs,
> etc.)  I can probably sketch some steps that your build should take,
> though I don't have a specific Ant/Geronimo example (I've used Maven
> for all my Geronimo-related builds).
> 
> Thanks,
>    Aaron
> 
> On 7/13/06, Rafael Barrera Oro <ra...@akyasociados.com.ar> wrote:
> 
>> Im sorry, but i 've been unable to find out what a build.xml example for
>> using ant with geronimo looks like, so i ask you guys.
>>
>> As usual, thanks in advance
>>
>> Rafael
>>
> 
> 

Re: build.xml example

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
What kind of application are you working on?  (e.g. WAR, EAR, EJBs,
etc.)  I can probably sketch some steps that your build should take,
though I don't have a specific Ant/Geronimo example (I've used Maven
for all my Geronimo-related builds).

Thanks,
    Aaron

On 7/13/06, Rafael Barrera Oro <ra...@akyasociados.com.ar> wrote:
> Im sorry, but i 've been unable to find out what a build.xml example for
> using ant with geronimo looks like, so i ask you guys.
>
> As usual, thanks in advance
>
> Rafael
>

build.xml example

Posted by Rafael Barrera Oro <ra...@akyasociados.com.ar>.
Im sorry, but i 've been unable to find out what a build.xml example for 
using ant with geronimo looks like, so i ask you guys.

As usual, thanks in advance

Rafael

Re: what does a ejb-jar.xml looks like?

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
Well, it sounds like the EAR contains an EJB JAR, or at least, the
META-INF/application.xml for the EAR is *saying* that it contains an
EJB JAR.

That EJB JAR should be a JAR file in the EAR, that contains a file
META-INF/ejb-jar.xml file.

The format of the ejb-jar.xml file is controlled by the EJB
specification.  It's a bit different depending on which revision of
J2EE and EJB you're targeting.  But there are DTDs or XML Schemas that
dictate the format for each version.

As far as what the content of the ejb-jar.xml file is supposed to be,
that depends on what the EJB JAR contains -- there should be entries
in ejb-jar.xml for each EJB you want to deploy, for example, in the
format dictated by the DTD or Schema.

So from here, I have a few questions for you:
 - Do you know what EJBs are and how to use them?
 - Do you think your EAR contains an EJB JAR?
 - Would it help you if I gave you the URLs for the ejb-jar.xml DTDs or Schemas?
 - If so, do you know which EJB or J2EE spec version you're targeting?

Thanks,
    Aaron

On 7/13/06, mika.works@gentlemansclub.de <mi...@gentlemansclub.de> wrote:
> hello,
>
> i have the task to add an ear-file to geronimo 1.1.
>
> if i copy the ear-file into the deploy-folder and start the server via 'startup.bat' the server starts as known.
>
> but when it is started it tries to deploy the ear in the deploy-folder.
>
> and then occurs a wonderful error-message like: "Error: Unable to distribute my.ear: Error parsing ejb-jar.xml"
>
> now my questions:
> 1) what does this ejb-jar.xml looks like? is there a standard-configuration of it? if yes, where could i find it?
> 2) where is this ebj-jar.xml to save to?
>
> regards from germany... mika
> --
>
>
> Echte DSL-Flatrate dauerhaft für 0,- Euro*!
> "Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl
>