You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by johnxmas <jo...@free.fr> on 2008/07/08 15:24:32 UTC

Re: Re: JCA Connector and hidden-classes

David,

At last, my mail problems are over !

I tried the given solution by adding, in geronimo.bat,
set GERONIMO_OPTS=%GERONIMO_OPTS% "-DXorg.apache.geronimo.kernel.config.MPCLSearchOption=safe"

It did not solve the problem. Is my syntax correct ?

I tried almost everything, added commons-logging1.1 in the repository and a dependency in my
deployment plan, and so on...  Still same result: all I'm getting as LogFactory is loaded
from /D:/geronimo-tomcat6-jee5-2.0.2/lib/commons-logging-1.0.4.jar

I saw aJ Jira was opened for this issue (GERONIMO-4082), but it seems to be still unresolved

I m a bit lost, as I really do need to control my apps logging...

Jean-Noël



>I haven't had a chance to look into this yet but someone just reported  
>a problem that looks related on the dev list, an apparent bug in our  
>classloader -- hidden class filters are ignored by default for classes  
>in the system classloader.  Apparently a workaround for this is to  
>include this flag on the jvm command line:
>
>-DXorg.apache.geronimo.kernel.config.MPCLSearchOption=safe
>
>Please let us know if this fixes the problem.... I'll also try to look  
>at your sample soon.
>
>thanks
>david jencks
>On May 26, 2008, at 1:56 AM, johnxmas@free.fr wrote:
>
>>
>> David,
>>
>> Sorry for the delay, but I experienced a lot of network problems for  
>> quite a
>> long time.
>>
>> I'm joining a "mock" resource adapter you can use to reproduce the  
>> problem
>> (BTW, I'm using geronimo 2.0.2 with Tomcat 6). My deployment plan  
>> specifies
>> commons-logging and log4j as hidden-classes). When deploying the RAR
>> a method setHostName is called (see ra.xml). I added some code to  
>> see what I get
>> concerning logging. The following result is written on the console
>>
>> Geronimo Application Server started
>> MockAdapter setting hostName - Log factory is  
>> org.apache.commons.logging.LogFact
>> ory - loaded from
>> file:/D:/geronimo-tomcat6-jee5-2.0.2/lib/commons-logging-1.0.4.jar
>> MockAdapter setting hostName - Log is  
>> org.apache.geronimo.kernel.log.GeronimoLog
>> - loaded from
>> file:/D:/geronimo-tomcat6-jee5-2.0.2/lib/geronimo-kernel-2.0.2.jar
>>
>> which, of course, is not what I expected
>>
>> Hope the test case can help.  Let me know if you need the sources
>>
>> Thanks
>>
>> Jean-Noël
>>
>>
>>
>>
>>> What geronimo version are you using?  I hope it's not 1.0 :-) (I'd
>>> recommend 2.1)
>>>
>>> I'm not sure why this isn't working yet.  Is there any chance you
>>> could lend me your connector or a test case?  The environment element
>>> of the geronimo plan might be enough for me to come up with a test if
>>> this is not practical.
>>>
>>> thanks
>>> david jencks
>>>
>>> On Apr 23, 2008, at 12:19 AM, johnxmas wrote:
>>>
>>>> David,
>>>>
>>>> Thanks for your help
>>>>
>>>> I corrected the geronim-ra.xml according to your indications, but I
>>
>>>> still get the same problem
>>>> (load origin is got thru
>>>> LogFactory 
>>>> .class.getProtectionDomain().getCodeSource().getLocation())
>>>>
>>>> ---> LOG FACTORY is loaded from file:/D:/geronimo-1.0/lib/commons-
>>>> logging-1.0.4.jar
>>>>
>>>> Jean-Noël
>>>>
>>>>
>>>>> The filter element only takes one package, so you want
>>>>>
>>>>> <dep:hidden-classes>
>>>>>      <dep:filter>org.apache.commons.logging.</dep:filter>
>>>>>      <dep:filter>org.apache.log4.</dep:filter>
>>>>>   </dep:hidden-classes>
>>>>>
>>>>> Also its a good idea to include the "." just in case someone has a
>>>>> package org.apache.log4jakarta or something that you don't want to
>>>>> hide :-)
>>>>>
>>>>> Let us know if there are additional problems
>>>>>
>>>>> thanks
>>>>> david jencks
>>>>>
>>>>> On Apr 22, 2008, at 7:50 AM, johnxmas wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I created my own JCA connector. Wanting to use my own version of
>>>>>> commons-logging and log4j,
>>>>>> I have embedded in thre RAR the two corresponding jars and, in
>>>>>> geronimo-ra.xml, added the following
>>>>>> lines
>>>>>>
>>>>>> <dep:hidden-classes>
>>>>>>      <filter>org.apache.commons.logging,org.apache.log4</filter>
>>>>>>   </dep:hidden-classes>
>>>>>>
>>>>>> But, when I deploy the adapter (stand-alone deployment, not thru  
>>>>>> an
>>>>>> EAR), I do not
>>>>>> get the expected result. I traced the code, and discovered that in
>>>>>> fact the resources
>>>>>> are loaded from the parent
>>>>>>
>>>>>> ---> LOG FACTORY is loaded from file:/D:/geronimo-1.0/lib/commons-
>>>>>> logging-1.0.4.jar
>>>>>>
>>>>>> If any one has got an explaination....
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Jean-Noël
>> <MockAdapter.rar>

Re: JCA Connector and hidden-classes

Posted by Kevan Miller <ke...@gmail.com>.
On Jul 8, 2008, at 9:24 AM, johnxmas wrote:

> David,
>
> At last, my mail problems are over !

Heh. At first I thought this meant that your *problem* was fixed... Oh  
well... ;-)

>
>
> I tried the given solution by adding, in geronimo.bat,
> set GERONIMO_OPTS=%GERONIMO_OPTS% "- 
> DXorg.apache.geronimo.kernel.config.MPCLSearchOption=safe"
>
> It did not solve the problem. Is my syntax correct ?

That looks correct.

>
>
> I tried almost everything, added commons-logging1.1 in the  
> repository and a dependency in my
> deployment plan, and so on...  Still same result: all I'm getting as  
> LogFactory is loaded
> from /D:/geronimo-tomcat6-jee5-2.0.2/lib/commons-logging-1.0.4.jar
>
> I saw aJ Jira was opened for this issue (GERONIMO-4082), but it  
> seems to be still unresolved
>
> I m a bit lost, as I really do need to control my apps logging...

I see you sent a sample app that we can use for testing. Will have a  
look this afternoon.

--kevan


Re: JCA Connector and hidden-classes

Posted by Kevan Miller <ke...@gmail.com>.
On Jul 8, 2008, at 9:24 AM, johnxmas wrote:

> David,
>
> At last, my mail problems are over !
>
> I tried the given solution by adding, in geronimo.bat,
> set GERONIMO_OPTS=%GERONIMO_OPTS% "- 
> DXorg.apache.geronimo.kernel.config.MPCLSearchOption=safe"
>
> It did not solve the problem. Is my syntax correct ?
>
> I tried almost everything, added commons-logging1.1 in the  
> repository and a dependency in my
> deployment plan, and so on...  Still same result: all I'm getting as  
> LogFactory is loaded
> from /D:/geronimo-tomcat6-jee5-2.0.2/lib/commons-logging-1.0.4.jar
>
> I saw aJ Jira was opened for this issue (GERONIMO-4082), but it  
> seems to be still unresolved
>
> I m a bit lost, as I really do need to control my apps logging...

Hmm. The MPCLSearchOption is working for me. I set as follows:

set JAVA_OPTS=-DXorg.apache.geronimo.kernel.config.MPCLSearchOption=safe

I verified that this works on Windows (and Mac OS X). I had Jetty  
installed. Don't see how a Tomcat install could behave differently.

Here's the output during deploy:

MockAdapter setting hostName - Log factory is  
org.apache.commons.logging.LogFactory - loaded from file:/C:/geronimo- 
jetty6-jee5-2.0.2/repository/mock/jca/MockAdapter/1.0/ 
MockAdapter-1.0.rar/rar/commons-logging.jar

Doh... I bet the " " 's that you used are wrong... If you update your  
GERONIMO_OPTS setting in geronimo.bat and remove the quotation mark  
characters, I bet it works...

Still need to fix this properly...

--kevan