On Aug 28, 2013, at 5:26 PM, Osvaldo Pina <[email protected]> wrote: > I'm having a trouble int StaxUtils static initializer with cxf 2.7.6 > running in the IBM jkd 1.6. When it tries to create the XMLOutputFactory > (XMLOutputFactory xof = XMLOutputFactory.newInstance()) a > NoClassDefFoundError is thrown. The reason is that the factory property > (javax.xml.stream.XMLOutputFactory) is set > to com.ctc.wstx.stax.WstxOutputFactory and this class is not avaliable > to javax.xml.stream.XMLOutputFactory classloader (the same applies to > javax.xml.stream.XMLInputFactory). > I'm thinking about changing the property to the IBM default value but I > would like to know if it is safe.
It's certainly not safe if your service accepts any sort of streaming XML. You really need to use woodstox for that case. The question is why ISN'T it found in the class loader? It should be using the context class loader which should be set properly in these cases. Is there a full stack trace so we can see if there is a context class loader or similar missing? That said, I just noticed the input factories are protected via a try/catch that would trap this. The output factories are not. :-( -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
