ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » WMB 6 and Java Logging

Post new topic  Reply to topic
 WMB 6 and Java Logging « View previous topic :: View next topic » 
Author Message
JayBee
PostPosted: Tue Feb 20, 2007 2:42 am    Post subject: WMB 6 and Java Logging Reply with quote

Newbie

Joined: 20 Feb 2007
Posts: 3

Hi,

I'm writing a pretty complex used defined node in Java and want to use Java Logging with a custom handler and formatter. With Broker 5 everything worked fine but now I'm migrating to Broker 6 and the new classloader hierarchy breaks it.

Basicly Java Logging and the predefined LogManager is using the System classloader to load handlers and formatters. Unfortunatly my user defined node is not in the scope of the system classloader. Is there a way to add something to the system classloader. Modifying the CLASSPATH doesn't help. Maybe it also helps to know how to set some system properties like -Djava.util.logging.manager=myOwnLogManager.

Btw. I'm running the Broker on Z/OS.

Thanks,

JayBee
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Feb 20, 2007 4:07 am    Post subject: Re: WMB 6 and Java Logging Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

JayBee wrote:
Hi,

I'm writing a pretty complex used defined node in Java and want to use Java Logging with a custom handler and formatter. With Broker 5 everything worked fine but now I'm migrating to Broker 6 and the new classloader hierarchy breaks it.

Basicly Java Logging and the predefined LogManager is using the System classloader to load handlers and formatters. Unfortunatly my user defined node is not in the scope of the system classloader. Is there a way to add something to the system classloader. Modifying the CLASSPATH doesn't help. Maybe it also helps to know how to set some system properties like -Djava.util.logging.manager=myOwnLogManager.

Btw. I'm running the Broker on Z/OS.

Thanks,

JayBee

Depending on the java version you may have to add the "lumberjack" (source forge) support pack (java 1.3 x).
If you need to use it you may have to add -Djava.util.logging.configfile=/path/logging.properties for the default logging properties.

This being said Broker 6 would need at least java 1.4 which should have the java.util.logging API as part of it's jvm. Depending on your logging method I would make sure to have the commons.jar on the classpath.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Tue Feb 20, 2007 4:48 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Maybe the comment at the end of the this page
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/as24996_.htm
will help?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JayBee
PostPosted: Tue Feb 20, 2007 8:02 am    Post subject: Re: WMB 6 and Java Logging Reply with quote

Newbie

Joined: 20 Feb 2007
Posts: 3

fjb_saper wrote:

Depending on the java version you may have to add the "lumberjack" (source forge) support pack (java 1.3 x).
If you need to use it you may have to add -Djava.util.logging.configfile=/path/logging.properties for the default logging properties.


Ok, the -D or any other VM parameters might be a solution, but where exactly can I specify any of these when running Broker 6 on Z/OS. Btw. I'm using JDK 1.4.2 and the included Java Logging.

fjb_saper wrote:

This being said Broker 6 would need at least java 1.4 which should have the java.util.logging API as part of it's jvm. Depending on your logging method I would make sure to have the commons.jar on the classpath.

Enjoy


Which commons.jar do you mean? Jakarta commons logging? Well I'm trying to use the Java Logging introduced with JDK 1.4 and actually it was working with Broker 5 but stopped working with Broker 6 because of the Classloader Hierarchy. The Java Logging implementation is somewhat stupid because it tries to load all handlers from the system classloader by calling ClassLoader.getSystemClassLoader().loadClass(xxx) instead of using the context classloader.

So the questions comes down to:

1. Is there a way to add a JAR to the system classpath of the broker
2. If there is no way to modify this, can I pass a system property to the JVM started by the broker to use a custom LogManager implementation and how do I set system properties from outside

Regards,

JayBee
Back to top
View user's profile Send private message
JayBee
PostPosted: Tue Feb 20, 2007 8:03 am    Post subject: Reply with quote

Newbie

Joined: 20 Feb 2007
Posts: 3

jefflowrey wrote:
Maybe the comment at the end of the this page
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/as24996_.htm
will help?


Thanks, but I tried this before. Java Logging doesn't use the context class loader for handlers. It always uses the system classloader.

Regards,

JayBee
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Feb 20, 2007 8:06 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can use mqsichangeproperties to pass -D options to the EG runtime. Search for examples here, I don't remember the exact details but I know I've commented on it.

You should be careful with it.

You can try to add classes to the System classloader by putting files in <runtime>/classes. But this should be done with extreme care, and that might not put them on the System classloader, either.

You should review the bottom part of the link I posted, where it discusses the inverse problem using JNDI - where the System classloader needs to be used instead of the Context classloader.

You should probably use MBService functions instead of Java logging.

You should consider opening a PMR.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » WMB 6 and Java Logging
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.