You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Damien Barthe <ba...@hotmail.com> on 2007/08/22 10:59:06 UTC

Re: [v1.1.1] Classloader problem

Hello,
thanks for the tip.
I try to put the spring lib and the spring app into the /lib directory of
the EAR. I also try to "install" these JAR in Geronimo (it put the lib in
the "repository")...and unfortunately the 2 webapps continue to have a
different instance of the Service...
(NB : I use geronimo v1.1.1 . Perhaps it's not possible with this version. I
try with the v2 but I've some problem in the deployement of the EAR)

Damien Barthe.



djencks wrote:
> 
> The blog author assumes that all web apps in an ear share the same  
> classloader, which is not true in geronimo.
> 
> I think if you put your spring app in the ear at lib/spring-app.jar  
> then you will only get one copy.  If you are including spring in your  
> ear it should go there also, although you might try using the copy of  
> spring we include first.
> 
> hope this helps
> david jencks
> 
> On Aug 17, 2007, at 6:13 AM, Damien Barthe wrote:
> 
>>
>> Hi there,
>> in order to test a kind of tutorial from Spring Tips (
>> http://springtips.blogspot.com/2007/06/using-shared-parent- 
>> application-context.html
>> here ) I deploy the given EAR on Geronimo 1.1.1 and test it.
>> The tip demonstrate how to use shared Application Context between
>> applications. In the EAR there is 2 webApps (web1 & web2) and one  
>> "normal"
>> application using spring. The webapps uses a bean in the third  
>> application
>> and normaly they uses the same instance of it.
>> But in Geronimo the instance is different, and after investigation the
>> classloader seems to be different too.
>> So I try to deploy the same EAR in JBoss and it works as intented  
>> (both
>> webapps uses the same instance of the bean). Idem in Glassfish.
>> As I use Geronimo in my projects and want to keep it I've searched a
>> solution to avoid this problem. But I've found anything.
>> Does anyone have an idea? :-D
>>
>> Thx,
>> Barthe Damien.
>>
>> P.s : if you want precision or something else, tell me.
>> P.s2: if you want to test the EAR, download it
>> http://blog.interface21.com/main/wp-content/uploads/2007/06/ 
>> multiple-contexts-sample.zip
>> there
>>
>>
>> -- 
>> View this message in context: http://www.nabble.com/-v1.1.1.- 
>> Classloader-problem--tf4285594s134.html#a12199330
>> Sent from the Apache Geronimo - Users mailing list archive at  
>> Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-v1.1.1--Classloader-problem-tf4285594s134.html#a12270701
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: [v1.1.1] Classloader problem

Posted by Kevan Miller <ke...@gmail.com>.
On Aug 22, 2007, at 11:50 AM, David Jencks wrote:

>
> On Aug 22, 2007, at 1:59 AM, Damien Barthe wrote:
>
>>
>> Hello,
>> thanks for the tip.
>> I try to put the spring lib and the spring app into the /lib  
>> directory of
>> the EAR. I also try to "install" these JAR in Geronimo (it put the  
>> lib in
>> the "repository")...and unfortunately the 2 webapps continue to  
>> have a
>> different instance of the Service...
>> (NB : I use geronimo v1.1.1 . Perhaps it's not possible with this  
>> version. I
>> try with the v2 but I've some problem in the deployement of the EAR)
>
> The lib directory in ear definitely only works with geronimo 2.  If  
> you try with geronimo 2.0.1 what goes wrong?
> http://www.apache.org/dist/geronimo/2.0.1/

I gave the app a try on 2.0.1. It's running into a Spring conflict on  
Jetty. Something else is going on in Tomcat. I'll create a deployment  
plan for Jetty. May need to look a bit more at Tomcat...

--kevan

>
> If you need to stick with g 1.1.1 then I believe if you put the lib  
> jars in the repository and add them as dependencies in geronimo- 
> application.xml to the ear's environement (NOT both of the web-app  
> environments) the classes should be loaded in the ear classloader  
> and you should get only one copy of spring.



Re: [v1.1.1] Classloader problem

Posted by Kevan Miller <ke...@gmail.com>.
On Aug 24, 2007, at 3:56 AM, Damien Barthe wrote:

>
> Yeah, it works!
> many thanks mr jencks :-)
>
> For the problem with the v2 of Geronimo, Kevan Miller said what it  
> happens.
> We will try here further test to deploy the app on it.

Glad to hear you got 1.1.1 working, Damien.

There are a several of issues with this example on G 2.0.1.

First, you need to use a server configured with Axis2 as the Web  
Service provider (this is the default with our Tomcat-based assembly  
the Jetty-based assembly can be configured to use Axis2, also). I'm  
working on getting the CXF conflicts resolved.

Second, there appears to be a Spring bug which is causing deployment  
errors. Spring 2.0.4 doesn't have the bug, but 2.0.5 and all later  
2.0.x versions of Spring do. I've raised a Spring Jira --  http:// 
opensource.atlassian.com/projects/spring/browse/SPR-3799. If you  
download Spring 2.0.4 and replace the spring jars in the ear with those

Even after I get the app deployed, it's not working for me. Not sure  
if I've done something wrong... Will be looking at it some more this  
afternoon...

--kevan


Re: [v1.1.1] Classloader problem

Posted by Kevan Miller <ke...@gmail.com>.
On Aug 24, 2007, at 3:56 AM, Damien Barthe wrote:

>
> Yeah, it works!
> many thanks mr jencks :-)
>
> For the problem with the v2 of Geronimo, Kevan Miller said what it  
> happens.
> We will try here further test to deploy the app on it.

Hi Damien,
FYI. I have your scenario working with Geronimo 2.0.1. It requires a  
fix to Spring (http://opensource.atlassian.com/projects/spring/browse/ 
SPR-3799). So, at present, you need a spring-framework 2.0.7 nightly  
build. There's a possibility that we'll fix/work around the problem  
in XBean, so Spring 2.0.5-2.0.6 will work...

At the moment, only a server configured to use Axis2 (or no web  
services at all) will work (this is the default for our Tomcat-based  
assembly). We'll be fixing the CXF problem, shortly.

I moved the Spring and SampleJava jars into the lib directory of the  
EAR.

I was using the following in META-INF/geronimo-application.xml, but I  
don't think it's necessary:

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://geronimo.apache.org/xml/ns/j2ee/ 
application-1.2">
   <environment>
     <moduleId>
       <groupId>org.spring.example</groupId>
       <artifactId>MultipleContexts</artifactId>
       <version>1.0</version>
     </moduleId>
     <!--
          Don't load spring classes or spring resources from parent  
ClassLoaders.
       -->
     <hidden-classes>
       <filter>org.springframework.</filter>
       <filter>META-INF/spring</filter>
     </hidden-classes>
   </environment>
</application>

--kevan


Re: [v1.1.1] Classloader problem

Posted by Damien Barthe <ba...@hotmail.com>.
Yeah, it works!
many thanks mr jencks :-)

For the problem with the v2 of Geronimo, Kevan Miller said what it happens. 
We will try here further test to deploy the app on it.

Damien Barthe.




djencks wrote:
> 
> 
> On Aug 22, 2007, at 1:59 AM, Damien Barthe wrote:
> 
>>
>> Hello,
>> thanks for the tip.
>> I try to put the spring lib and the spring app into the /lib  
>> directory of
>> the EAR. I also try to "install" these JAR in Geronimo (it put the  
>> lib in
>> the "repository")...and unfortunately the 2 webapps continue to have a
>> different instance of the Service...
>> (NB : I use geronimo v1.1.1 . Perhaps it's not possible with this  
>> version. I
>> try with the v2 but I've some problem in the deployement of the EAR)
> 
> The lib directory in ear definitely only works with geronimo 2.  If  
> you try with geronimo 2.0.1 what goes wrong?
> http://www.apache.org/dist/geronimo/2.0.1/
> 
> If you need to stick with g 1.1.1 then I believe if you put the lib  
> jars in the repository and add them as dependencies in geronimo- 
> application.xml to the ear's environement (NOT both of the web-app  
> environments) the classes should be loaded in the ear classloader and  
> you should get only one copy of spring.
> 
> thanks
> david jencks
> 
>>
>> Damien Barthe.
>>
>>
>>
>> djencks wrote:
>>>
>>> The blog author assumes that all web apps in an ear share the same
>>> classloader, which is not true in geronimo.
>>>
>>> I think if you put your spring app in the ear at lib/spring-app.jar
>>> then you will only get one copy.  If you are including spring in your
>>> ear it should go there also, although you might try using the copy of
>>> spring we include first.
>>>
>>> hope this helps
>>> david jencks
>>>
>>> On Aug 17, 2007, at 6:13 AM, Damien Barthe wrote:
>>>
>>>>
>>>> Hi there,
>>>> in order to test a kind of tutorial from Spring Tips (
>>>> http://springtips.blogspot.com/2007/06/using-shared-parent-
>>>> application-context.html
>>>> here ) I deploy the given EAR on Geronimo 1.1.1 and test it.
>>>> The tip demonstrate how to use shared Application Context between
>>>> applications. In the EAR there is 2 webApps (web1 & web2) and one
>>>> "normal"
>>>> application using spring. The webapps uses a bean in the third
>>>> application
>>>> and normaly they uses the same instance of it.
>>>> But in Geronimo the instance is different, and after  
>>>> investigation the
>>>> classloader seems to be different too.
>>>> So I try to deploy the same EAR in JBoss and it works as intented
>>>> (both
>>>> webapps uses the same instance of the bean). Idem in Glassfish.
>>>> As I use Geronimo in my projects and want to keep it I've searched a
>>>> solution to avoid this problem. But I've found anything.
>>>> Does anyone have an idea? :-D
>>>>
>>>> Thx,
>>>> Barthe Damien.
>>>>
>>>> P.s : if you want precision or something else, tell me.
>>>> P.s2: if you want to test the EAR, download it
>>>> http://blog.interface21.com/main/wp-content/uploads/2007/06/
>>>> multiple-contexts-sample.zip
>>>> there
>>>>
>>>>
>>>> -- 
>>>> View this message in context: http://www.nabble.com/-v1.1.1.-
>>>> Classloader-problem--tf4285594s134.html#a12199330
>>>> Sent from the Apache Geronimo - Users mailing list archive at
>>>> Nabble.com.
>>>>
>>>
>>>
>>>
>>
>> -- 
>> View this message in context: http://www.nabble.com/-v1.1.1-- 
>> Classloader-problem-tf4285594s134.html#a12270701
>> Sent from the Apache Geronimo - Users mailing list archive at  
>> Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-v1.1.1--Classloader-problem-tf4285594s134.html#a12308145
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: [v1.1.1] Classloader problem

Posted by David Jencks <da...@yahoo.com>.
On Aug 22, 2007, at 1:59 AM, Damien Barthe wrote:

>
> Hello,
> thanks for the tip.
> I try to put the spring lib and the spring app into the /lib  
> directory of
> the EAR. I also try to "install" these JAR in Geronimo (it put the  
> lib in
> the "repository")...and unfortunately the 2 webapps continue to have a
> different instance of the Service...
> (NB : I use geronimo v1.1.1 . Perhaps it's not possible with this  
> version. I
> try with the v2 but I've some problem in the deployement of the EAR)

The lib directory in ear definitely only works with geronimo 2.  If  
you try with geronimo 2.0.1 what goes wrong?
http://www.apache.org/dist/geronimo/2.0.1/

If you need to stick with g 1.1.1 then I believe if you put the lib  
jars in the repository and add them as dependencies in geronimo- 
application.xml to the ear's environement (NOT both of the web-app  
environments) the classes should be loaded in the ear classloader and  
you should get only one copy of spring.

thanks
david jencks

>
> Damien Barthe.
>
>
>
> djencks wrote:
>>
>> The blog author assumes that all web apps in an ear share the same
>> classloader, which is not true in geronimo.
>>
>> I think if you put your spring app in the ear at lib/spring-app.jar
>> then you will only get one copy.  If you are including spring in your
>> ear it should go there also, although you might try using the copy of
>> spring we include first.
>>
>> hope this helps
>> david jencks
>>
>> On Aug 17, 2007, at 6:13 AM, Damien Barthe wrote:
>>
>>>
>>> Hi there,
>>> in order to test a kind of tutorial from Spring Tips (
>>> http://springtips.blogspot.com/2007/06/using-shared-parent-
>>> application-context.html
>>> here ) I deploy the given EAR on Geronimo 1.1.1 and test it.
>>> The tip demonstrate how to use shared Application Context between
>>> applications. In the EAR there is 2 webApps (web1 & web2) and one
>>> "normal"
>>> application using spring. The webapps uses a bean in the third
>>> application
>>> and normaly they uses the same instance of it.
>>> But in Geronimo the instance is different, and after  
>>> investigation the
>>> classloader seems to be different too.
>>> So I try to deploy the same EAR in JBoss and it works as intented
>>> (both
>>> webapps uses the same instance of the bean). Idem in Glassfish.
>>> As I use Geronimo in my projects and want to keep it I've searched a
>>> solution to avoid this problem. But I've found anything.
>>> Does anyone have an idea? :-D
>>>
>>> Thx,
>>> Barthe Damien.
>>>
>>> P.s : if you want precision or something else, tell me.
>>> P.s2: if you want to test the EAR, download it
>>> http://blog.interface21.com/main/wp-content/uploads/2007/06/
>>> multiple-contexts-sample.zip
>>> there
>>>
>>>
>>> -- 
>>> View this message in context: http://www.nabble.com/-v1.1.1.-
>>> Classloader-problem--tf4285594s134.html#a12199330
>>> Sent from the Apache Geronimo - Users mailing list archive at
>>> Nabble.com.
>>>
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/-v1.1.1-- 
> Classloader-problem-tf4285594s134.html#a12270701
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>