users@glassfish.java.net

Re: GFv3 Eclipse EAR deployment

From: Hong Zhang <Hong.Zhang_at_Sun.COM>
Date: Fri, 22 Jan 2010 12:15:04 -0500

Hi, Fabrice

> I found a solution....
>
> I moved all the jar I use both in my war and my ejb to the lib folder.
> I moved all the over jat + ejb module + war module to the root folder
> of the ear.
> None of my modules have a class-path defined in there manifest.
>
> This is a solution but I think GF plugin have a problem generating EAR
> fot GF3.
> If i deploy the generated EAR to GF 2.1 it works out of the box...
> Thank for trying helping me Hong.
>
Glad to hear you had it working now. There are some changes in Glassfish
implementation from v2 to v3 (the ear libraries needs to be placed under
lib etc) which might explain the different behavior. But I think the
Eclipse v3 GF plug in has already taken care of it. I will let Ludo
comment more on it.

Thanks,

- Hong

> 2010/1/22 Fabrice BUQUET <fabrice.buquet_at_gmail.com
> <mailto:fabrice.buquet_at_gmail.com>>
>
> None have a class-path define...
>
>
> 2010/1/22 Hong Zhang <Hong.Zhang_at_sun.com <mailto:Hong.Zhang_at_sun.com>>
>
>
>> I use Eclipse GF plugin v1.0.51 which is the latest version.
>> The libraries are place in the root of the EAR.
>>
>> If I move these librarries in the lib folder, do I need to
>> updade the class-path from the EAR, EJB and WAR manifest ??
>>
> What's their current Manifest Class-Path values?
> The other thing you can try is to edit the Class-Path value of
> the war Manifest to reference the library which includes the
> missing class.
>
>>
>> 2010/1/22 Hong Zhang <Hong.Zhang_at_sun.com
>> <mailto:Hong.Zhang_at_sun.com>>
>>
>>
>>> All my jar are in the root directory of the EAR.
>>>
>>> I will try to move them in the lib folder...but I don't
>>> know how to do that, no such option in the Eclipse
>>> Export menu...
>>
>> I am not familiar with the Eclipse. Which version of the
>> Eclipse plug in are you using? I think the latest Eclipse
>> GF plug in should place the libraries in the ear lib
>> already?
>>
>> Can you manually repackage the ear and try?
>>
>>> 2010/1/22 Hong Zhang <Hong.Zhang_at_sun.com
>>> <mailto:Hong.Zhang_at_sun.com>>
>>>
>>>
>>>> ConfigurationException from common-configuration.
>>>>
>>>> The jar is in the EAR but maybe not well declared
>>>> in my class-path...
>>>> I use it both in my ejb and war modules.
>>>>
>>> Is the jar right now at the root of the ear file?
>>> Can you create a lib directory under the ear root
>>> and place the jar in that directory?
>>>
>>>> 2010/1/22 Hong Zhang <Hong.Zhang_at_sun.com
>>>> <mailto:Hong.Zhang_at_sun.com>>
>>>>
>>>>
>>>>> You were right, the war manifest contained a
>>>>> classpath reference to my ejb module.
>>>>>
>>>>> But when I remove this dependence I get
>>>>> a NoClassDefFoundError.
>>>>
>>>> What class is it complaining about? Is it a EJB
>>>> interface that the war references?
>>>>
>>>>>
>>>>> Maybe I need to change my Eclipse JEE module
>>>>> options but I don't know how....
>>>>>
>>>>> Can you help me please ?
>>>>>
>>>>> 2010/1/22 Hong Zhang <Hong.Zhang_at_sun.com
>>>>> <mailto:Hong.Zhang_at_sun.com>>
>>>>>
>>>>> Hi, Fabrice
>>>>>
>>>>>> The ear contains the ejb jar, the war and
>>>>>> other jars but this implementation is
>>>>>> only include once in all this stuff.
>>>>>> I just used the export feature in eclipse
>>>>>> and the problem appears even in projetcs
>>>>>> that I deployed in a GF2.1.
>>>>>
>>>>> I see. Can you check if the ejb jar was
>>>>> included in the war through Manifest, the
>>>>> NetBeans packaging used to have this
>>>>> problem. Please check the Class-Path entry
>>>>> of the war Manifest file to see if it
>>>>> includes the ejb jar..
>>>>>
>>>>> - Hong
>>>>>
>>>>>> All the EAR generated with Eclipse seen
>>>>>> not to be deployable in GF3...
>>>>>>
>>>>>> 2010/1/22 Hong Zhang <Hong.Zhang_at_sun.com
>>>>>> <mailto:Hong.Zhang_at_sun.com>>
>>>>>>
>>>>>> Hi, Fabrice
>>>>>>
>>>>>>
>>>>>> I use Eclipse (Galileo) with the
>>>>>> latest GF plugin and GFv3 to
>>>>>> develop an EAR application.
>>>>>> When I deploy my EAR inside
>>>>>> Eclipse with the publish command
>>>>>> everything works fine.
>>>>>> But when I use the Export->EAR
>>>>>> command from the file menu, I can
>>>>>> not deploy the generated EAR to
>>>>>> the same server, I got this error:
>>>>>>
>>>>>> java.lang.RuntimeException:
>>>>>> Cannot resolve reference Local
>>>>>> ejb-ref
>>>>>> name=org.buck.dms.ejb.ejb.SessionEjb/aclManagerEjb,Local
>>>>>> 3.x interface
>>>>>> =org.buck.dms.ejb.ejb.AclManagerEjbLocal,ejb-link=null,lookup=null,mappedName=,jndi-name=,refType=Session
>>>>>> because there are 2 ejbs in the
>>>>>> application with interface
>>>>>> org.buck.dms.ejb.ejb.AclManagerEjbLocal
>>>>>>
>>>>>> I'm sure there is only one
>>>>>> implementation of this interface.
>>>>>>
>>>>>>
>>>>>> But is the implementation class of
>>>>>> this interface packaged twice in this
>>>>>> ear? Can you tell us a little bit
>>>>>> more of the packaging?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> - Hong
>>>>>>
>>>>>>
>>>>>>
>>>>>> Can anyone help me please ?
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> BUQUET Fabrice
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail:
>>>>>> users-unsubscribe_at_glassfish.dev.java.net
>>>>>> <mailto:users-unsubscribe_at_glassfish.dev.java.net>
>>>>>> For additional commands, e-mail:
>>>>>> users-help_at_glassfish.dev.java.net
>>>>>> <mailto:users-help_at_glassfish.dev.java.net>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> BUQUET Fabrice
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> BUQUET Fabrice
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> BUQUET Fabrice
>>>
>>>
>>>
>>>
>>>
>>> --
>>> BUQUET Fabrice
>>
>>
>>
>>
>>
>> --
>> BUQUET Fabrice
>
>
>
>
>
> --
> BUQUET Fabrice
>
>
>
>
> --
> BUQUET Fabrice