java - Eclipse XML Parser "Providers" conflicting with rt.jar -


please note: although there several questions on paste in similar exception & stack trace, question not dupe of of them, i'm trying understand classloading going awry.

hi, java 8/groovy 2.4.3/eclipse luna here. i'm using bigip icontrol java client (for controlling powerful load balancer programmatically) in turn uses apache axis 1.4. in use of axis 1.4 getting following stacktrace (from eclipse console):

caught: javax.xml.parsers.factoryconfigurationerror: provider javax.xml.parsers.documentbuilderfactory cannot found javax.xml.parsers.factoryconfigurationerror: provider javax.xml.parsers.documentbuilderfactory cannot found     @ org.apache.axis.utils.xmlutils.getdomfactory(xmlutils.java:221)     @ org.apache.axis.utils.xmlutils.<clinit>(xmlutils.java:83)     @ org.apache.axis.configuration.fileprovider.configureengine(fileprovider.java:179)     @ org.apache.axis.axisengine.init(axisengine.java:172)     @ org.apache.axis.axisengine.<init>(axisengine.java:156)     @ org.apache.axis.client.axisclient.<init>(axisclient.java:52)     @ org.apache.axis.client.service.getaxisclient(service.java:104)     @ org.apache.axis.client.service.<init>(service.java:113)     @ icontrol.locallbpoollocator.<init>(locallbpoollocator.java:21)     @ icontrol.interfaces.getlocallbpool(interfaces.java:351)     @ com.me.myapp.f5client.run(f5client.groovy:27) 

hmmm, let's have @ xmlutils.getdomfactory method:

private static documentbuilderfactory getdomfactory() {     documentbuilderfactory dbf;     try {         dbf = documentbuilderfactory.newinstance();         dbf.setnamespaceaware(true);     }     catch( exception e ) {         log.error(messages.getmessage("exception00"), e );         dbf = null;     }     return( dbf ); } 

ok, ln 221 call documentbuilderfactory.newinstance() let's have @ it:

public static documentbuilderfactory newinstance() {     return factoryfinder.find(         /* default property name according jaxp spec */         documentbuilderfactory.class, // "javax.xml.parsers.documentbuilderfactory"         /* fallback implementation class name */         "com.sun.org.apache.xerces.internal.jaxp.documentbuilderfactoryimpl"); } 

the plot thickens! let's take final @ factoryfinder.find:

static <t> t find(class<t> type, string fallbackclassname)         throws factoryconfigurationerror {     final string factoryid = type.getname();     dprint("find factoryid =" + factoryid);      // lots of nasty cruft omitted brevity...       // try jar service provider mechanism     t provider = findserviceprovider(type);     if (provider != null) {         return provider;     }     if (fallbackclassname == null) {         throw new factoryconfigurationerror(             "provider " + factoryid + " cannot found");      // <<-- ahh, here go     }      dprint("loaded fallback value: " + fallbackclassname);     return newinstance(type, fallbackclassname, null, true); } 

so if i'm interpreting right, it's throwing factoryconfigurationerror because can't find main "provider class" (whatever means) , no fallback has been specified. hasn't it?!? call factoryfinder.find included non-null "com.sun.org.apache.xerces.internal.jaxp.documentbuilderfactoryimpl" string argument. has me suspicious wonky classpath, , have rogue documentbuilderfactory (not 1 defined in rt.jar/javax/xml/parsers) somewhere in code passing null arg finder method.

but doesn't make sense either, because axis 1.4 doesn't appear (at least according maven repo) have dependencies...which means "provider" javax.xml.* rt.jar. unless, perhaps, eclipse mucking things somehow? i'm confused, please :-/


update

this eclipse issue. if package app executable jar , run command line don't exception.


Comments