2011/5/24 Mikołaj Rybiński <[email protected]>:
> ); specifically, SBMLWriter.write method. JSBML depends, among others,
> on Woodstox StAX implementation (woodstox-core-lgpl-4.0.9.jar). After
> pruning the problem (see attached workflow) I've reached a point where
> it turned out that from beanshell in Taverna a
> "com.sun.xml.internal.stream.XMLOutputFactoryImpl" implementation is
> used instead of the "javax.xml.stream.XMLOutputFactory" interface,
> instead of "com.ctc.wstx.stax.WstxOutputFactory". The latter is
> required as the JSBML code tries to set Woodstox-specific property.
> I've looked for a way to tell from the running code to use desired
> implementation. I've only found the following method:
>
>   System.setProperty("javax.xml.stream.XMLOutputFactory",
> "com.ctc.wstx.stax.WstxOutputFactory");
>
> but this results in
>
>   javax.xml.stream.FactoryFinder$ConfigurationError: Provider
> com.ctc.wstx.stax.WstxOutputFactory not found

This would only work if you put the JAR for WstxOutputFactory in the
system classpath of Taverna, as setting the system property is a
global change, and initialization of WstxOutputFactory  would happen
inside a Java class which doesn't know anything about your plugin's
class loaders.

Try dropping the JAR (and anything they depend on) into the lib/
folder of the Taverna distribution, alternatively in the Beanshell
Dependencies make sure the tickbox for the JAR is ticked, and that you
select "System classloader".


This might or might not break other uses of the XMLOutputFactory such
as Taverna's own serialisation of say workflows, so you would be on
your own..


You could instead try to see if you can get JSBML to use the the
WstxOutputFactory specifically instead of assuming the property has
been set. I guess the stack trace you get now that the implementation
is not found will hint you towards which part of JSBML you would need
to call differently or (in worst case) have to patch.

-- 
Stian Soiland-Reyes, myGrid team
School of Computer Science
The University of Manchester

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
taverna-users mailing list
[email protected]
[email protected]
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/about/contact-us/

Reply via email to