Re: Re: JCA Connector and hidden-classes
>I'm not sure exactly what you are trying to do but have you looked at > >http://cwiki.apache.org/GMOxDOC21/configuring-application-specific-logging-with-log4j.html > >to see if it would help? > >thanks >david jencks > Alas, I'm using geronimo 2.0.2... I don't feel I'm trying to do something special. I'm deploying a Resource Adapter packaged in a rar file. I want this adapter to use the commons-logging.jar and log4j.jar (with their corresponding commons-logging.properties and log4j.xml) that are in the rar, in order to have total control on the log level Thanks Jean-Noël >On Jul 9, 2008, at 2:44 AM, johnxmas wrote: > >> Kevan, >> >> I corrected my geronimo.bat, by suppressing the quotes as you >> stated, and, >> yes, it succeeded: the commons-logging.jar used is the one from my >> application >> >> Thanks for that >> >> BUT, that is not a full success: as expected, the LogFactory gives >> me a Log4JLogger >> >> MockAdapter setting hostName - Log is >> org.apache.commons.logging.impl.Log4JLogger - loaded from file:/D:/ >> geronimo-tomcat6-jee5-2.0.2/repository/mock/jca/MockAdapter/1.0/ >> MockAdapter-1.0.rar/rar/commons-logging-1.1.jar >> >> Alas, the following line >> >> MockAdapter - embedded Log is org.apache.log4j.Logger - loaded from >> file:/D:/geronimo-tomcat6-jee5-2.0.2/lib/log4j-1.2.14.jar >> >> shows that my applications log4j.jar is not used. So, my local >> log4j.xml is ignored and I get a default "INFO" trace level instead >> of the ones I specified >> >> Jean-Noël >> >> >> >>> >>> On Jul 8, 2008, at 9:24 AM, johnxmas wrote: >>> David, >> >>> 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 >>> >>> >>>
Re: JCA Connector and hidden-classes
I'm not sure exactly what you are trying to do but have you looked at http://cwiki.apache.org/GMOxDOC21/configuring-application-specific-logging-with-log4j.html to see if it would help? thanks david jencks On Jul 9, 2008, at 2:44 AM, johnxmas wrote: Kevan, I corrected my geronimo.bat, by suppressing the quotes as you stated, and, yes, it succeeded: the commons-logging.jar used is the one from my application Thanks for that BUT, that is not a full success: as expected, the LogFactory gives me a Log4JLogger MockAdapter setting hostName - Log is org.apache.commons.logging.impl.Log4JLogger - loaded from file:/D:/ geronimo-tomcat6-jee5-2.0.2/repository/mock/jca/MockAdapter/1.0/ MockAdapter-1.0.rar/rar/commons-logging-1.1.jar Alas, the following line MockAdapter - embedded Log is org.apache.log4j.Logger - loaded from file:/D:/geronimo-tomcat6-jee5-2.0.2/lib/log4j-1.2.14.jar shows that my applications log4j.jar is not used. So, my local log4j.xml is ignored and I get a default "INFO" trace level instead of the ones I specified Jean-Noël On Jul 8, 2008, at 9:24 AM, johnxmas wrote: David, 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
Re: Re: JCA Connector and hidden-classes
Kevan, I corrected my geronimo.bat, by suppressing the quotes as you stated, and, yes, it succeeded: the commons-logging.jar used is the one from my application Thanks for that BUT, that is not a full success: as expected, the LogFactory gives me a Log4JLogger MockAdapter setting hostName - Log is org.apache.commons.logging.impl.Log4JLogger - loaded from file:/D:/geronimo-tomcat6-jee5-2.0.2/repository/mock/jca/MockAdapter/1.0/MockAdapter-1.0.rar/rar/commons-logging-1.1.jar Alas, the following line MockAdapter - embedded Log is org.apache.log4j.Logger - loaded from file:/D:/geronimo-tomcat6-jee5-2.0.2/lib/log4j-1.2.14.jar shows that my applications log4j.jar is not used. So, my local log4j.xml is ignored and I get a default "INFO" trace level instead of the ones I specified Jean-Noël > >On Jul 8, 2008, at 9:24 AM, johnxmas wrote: > >> David, >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 > > >
Re: JCA Connector and hidden-classes
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
Re: JCA Connector and hidden-classes
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: 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, [EMAIL PROTECTED] 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 > > > org.apache.commons.logging. > org.apache.log4. > > > 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 >> >> >> org.apache.commons.logging,org.apache.log4 >> >> >> 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 >>
Re: JCA Connector and hidden-classes
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 org.apache.commons.logging. org.apache.log4. 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 org.apache.commons.logging,org.apache.log4 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
Re: Re: JCA Connector and hidden-classes
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 > > >org.apache.commons.logging. >org.apache.log4. > > >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 >> >> >>org.apache.commons.logging,org.apache.log4 >> >> >> 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
Re: JCA Connector and hidden-classes
The filter element only takes one package, so you want org.apache.commons.logging. org.apache.log4. 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 org.apache.commons.logging,org.apache.log4 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