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 » JAXB support in WMB 6.1

Post new topic  Reply to topic
 JAXB support in WMB 6.1 « View previous topic :: View next topic » 
Author Message
4integration
PostPosted: Mon Nov 24, 2008 1:07 pm    Post subject: JAXB support in WMB 6.1 Reply with quote

Disciple

Joined: 04 Sep 2006
Posts: 197
Location: Gothenburg, Sweden

Hello,

I am trying to get JAXB to work in WMB 6.1 but have some problem.

If I rely on the JVM in WMB 6.1 I get
Code:
java.lang.NoClassDefFoundError: javax.xml.bind.JAXBException

so I tried to add the JARs "jaxb-api-2.1.ar" and "jaxb-impl-2.1.5.jar" and now get
Code:
Provider com.sun.xml.bind.v2.ContextFactory not found


I have searched WMB installation package and could find the JAXB API and impl in <install_root>\IBM\MQSI\6.1\webservices but it seems not to find it.

How should I approach this to use JAXB in WMB 6.1 ?
_________________
Best regards
4 Integration
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Nov 24, 2008 3:47 pm    Post subject: Re: JAXB support in WMB 6.1 Reply with quote

Grand High Poobah

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

4integration wrote:
Hello,

I am trying to get JAXB to work in WMB 6.1 but have some problem.

If I rely on the JVM in WMB 6.1 I get
Code:
java.lang.NoClassDefFoundError: javax.xml.bind.JAXBException

so I tried to add the JARs "jaxb-api-2.1.ar" and "jaxb-impl-2.1.5.jar" and now get
Code:
Provider com.sun.xml.bind.v2.ContextFactory not found


I have searched WMB installation package and could find the JAXB API and impl in <install_root>\IBM\MQSI\6.1\webservices but it seems not to find it.

How should I approach this to use JAXB in WMB 6.1 ?


What are you trying to do with JAXB that the broker can't do out of the box for you?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
4integration
PostPosted: Tue Nov 25, 2008 1:54 am    Post subject: Reply with quote

Disciple

Joined: 04 Sep 2006
Posts: 197
Location: Gothenburg, Sweden

Hello,

We have some configurations in XML files on the file system that we are loading via JAXB.

Those XML's are business rules how the messages will be routed etc and it will later be in a database but due to limited time we are using XML.
_________________
Best regards
4 Integration
Back to top
View user's profile Send private message
JLRowe
PostPosted: Tue Nov 25, 2008 5:24 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

You can either upgrade your JRE to java 1.6 which has JAXB built-in, or go to the JAXB website and download the jars you need and use with java 5.

The built-in version of JAXB lags behind the latest releases, but you can override the JRE JAXB through the JRE extension mechanism.

I don't understand why you think IBM would ship the JAXB jars in the message broker product directory? (unless of course they ship java 6, but jaxb is built-in to the JRE jars in that case)
Back to top
View user's profile Send private message Send e-mail
4integration
PostPosted: Tue Nov 25, 2008 5:28 am    Post subject: Reply with quote

Disciple

Joined: 04 Sep 2006
Posts: 197
Location: Gothenburg, Sweden

I think it's a classloader issue but have not yet found the solution.....
_________________
Best regards
4 Integration
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Nov 25, 2008 6:38 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I don't think that Broker 6.1 is supported for JRE 1.6 - but I haven't looked lately.

I don't think using JAXB in Message Broker is a good idea. Read the contents of the files, pass it to the XMLNSC parser, use normal Broker methods to access the data.

There are some classloader peculiarities in 6.1.0.2 that I've been hearing about.

You can try adding
Code:
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
to your JCN and see if that helps.
Back to top
View user's profile Send private message
4integration
PostPosted: Tue Nov 25, 2008 11:50 am    Post subject: Reply with quote

Disciple

Joined: 04 Sep 2006
Posts: 197
Location: Gothenburg, Sweden

I have the XML as String in a JCN, how can I utilize XMLNSC parser to get it parsed this way (programatic).

I know how when using MQInputNode etc to get the message parsed by WMB but not as this..
_________________
Best regards
4 Integration
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Nov 25, 2008 1:40 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.plugin.doc/com/ibm/broker/plugin/MbElement.html

createElementAsLastChildFromBitstream(byte[],java.lang.String,java.lang.String,java.lang.String,java.lang.String,int,int,int)
Back to top
View user's profile Send private message
4integration
PostPosted: Wed Nov 26, 2008 1:29 am    Post subject: Reply with quote

Disciple

Joined: 04 Sep 2006
Posts: 197
Location: Gothenburg, Sweden

Hello,

The JAXB related error was connected to the classloader and the solution was to use:
Code:
JAXBContext jaxbContext = JAXBContext.newInstance(MyClass.class.getPackage().getName(), MyClass.class.getClassLoader());

instead of

Code:
JAXBContext jaxbContext = JAXBContext.newInstance(MyClass.class.getPackage().getName());


Seems to work just fine

Reference: https://jaxb.dev.java.net/faq/jaxb10faq.html#classloader
_________________
Best regards
4 Integration
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 » JAXB support in WMB 6.1
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.