I have old jaxb1 code that I am trying to run on JDK1.6(u 31).
It compiled fine. When I try to run I get the error -
Error constructing QTIResultsProcessingV12:Input is not a well formed document: Provider com.sun.xml.bind.ContextFactory_1_0_1 not found
So I tried to google and found that I have to place jaxb1_impl.jar in classpath.
I did not find this jar in jdk lib , so I downloaded JAXB RI 2.1.10 and put the jaxb1_impl.jar in classpath. Yet I get the same error.
Migrating jaxb1->jaxb2 is something not desired at this point as this is a short term solution.
Related
I want to use XLConnect package, however, I am facing unexpected issues.
library(XLConnect)
wb <- XLConnect::loadWorkbook("file.xlsx")
Error: NoClassDefFoundError (Java): org/apache/poi/openxml4j/exceptions/InvalidFormatException
Does anyone know what is happening?
There two possible causes to this issue that I know of:
Java dependency conflict
If you have installed a package that also relies on Apache POI, such as xlsx, incorrect classes will be loaded. If you restart your R session and avoid loading the conflicting package, this issue should be avoided.
Failed download of java dependencies
Once you have installed XLConnect (using version 1.0.4 currently on CRAN), check that the java directory under the package's installation[0] contains the following:
ls /your/library/path/XLConnect/java/
commons-codec-1.15.jar commons-compress.jar curvesapi-1.06.jar poi.jar poi-ooxml-schemas.jar XLConnect-1.0.3.jar
commons-collections4.jar commons-math3.jar ooxml-schemas.jar poi-ooxml.jar SparseBitSet.jar xmlbeans.jar
If one of these is missing, remove the package, restart your R session, and reinstall the package. Check for any errors that occur in that last step.
[0] to find your library path, run .libPaths() in your R session.
I am trying to get the Octave 5.1.0 + IO package xmlread() function to work. I have installed the IO package as well as the 2.12.0 version of Apache Xerces java libraries. Octave Forge claims that all you need to do is to load the IO package during runtime (pkg load IO) and include javaaddpath entries for two .jar files:
javaaddpath('pathToFile/xercesImpl.jar');
javaaddpath('pathToFile/xml-apis.jar');
I have done this, but I still get the following error:
error: xmlread: no xercesImpl.jar and/or xml-apis.jar > v2.11.0 in javaclasspath
error: called from
xmlread at line 72 column 7
I made sure to addpath the Xerces libary, but I get the same error no matter what. When I invoke the xmlread without a file (xmlread()), it seems to confirm the existence of the .jar files:
xerces:
- xercesImpl.jar OK
- xml-apis.jar OK
xerces version 2.9.1
The 2.9.1 might be the culprit (>2.11.0 needed?), but why does this get used when I point to more current versions? Any help is appreciated. Thanks!
My Tibco BW 6.3.2 project invokes some Java Code that works on my machine, but I'm having issues on the server.
At first, I got this error
<CausedBy> java.lang.ClassNotFoundException: com.sun.xml.bind.v2.model.annotation.AnnotationReader cannot be found
So Googled it and added jaxb-impl.jar and jaxb-core.jar(JAXB v2.2.11). Again, it worked on my machine without adding these to the classpath. But once I added them, I got this error on the server:
<CausedBy> java.lang.RuntimeException: Provider for class javax.xml.parsers.SAXParserFactory cannot be created
<CausedBy> java.util.ServiceConfigurationError: javax.xml.parsers.SAXParserFactory: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
Again, I Googled it and added xercesImpl.jar. But now I'm getting this on my machine & server :
<CausedBy> java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
After some google searching, I've determined there are 2 xerces jars in my project, but I can't find the second one. Any thoughts on how to do that? OR does anyone have a different solution?
Side note, the java code works perfectly fine in Eclipse without any of these libraries added to the class path. (All devices are using Sun JDK 1.8.0_92)
EDITED:
I removed all the jaxb libraries I added and defined them in the Module Descriptors -> Dependencies -> Imported Packages.
I'm trying to convert JSON to XML and vise versa. For that I'm using staxon jar. I'm using below code to do that.
Source source = new StAXSource( reader );
Result result = new StAXResult( writer );
TransformerFactory.newInstance().newTransformer().transform( source, result );
If you notice in this TransformerFactory.newInstance() returns com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl for transform. This implementation is working fine in standalone as well as in Weblogic. But in WAS I'm getting ClassNotFoundException while executing this method.
I found the root cause for this, i'm using Websphere 8.5.5.0 internally it is starting with SDK1.6 in WAS installed folder. Inside SDK jre lib rt.jar com.sun.org.apache.xalan package is not there ??
To solve this problem i tried following ways but not achieved..
1. Trying to start WAS in normal JDK1.6 not starting giving some class notfound exception.
2. Create my own jar with all missing packages and put it into my project, on that time it is considering but XMLDocument state not START like exception I'm getting
How can I over come this problem?? Thanks
I am facing problems with using xalan in eclipse plugin.
When I try to create factory instance by:
TransformerFactory tFactory = TransformerFactory.newInstance("org.apache.xalan.processor.TransformerFactoryImpl", null);
I get error:
javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
...
I have following libs in plugin classpath: xml-apis.jar, xercesImpl.jar, serializer.jar, xalan.jar
I even can't create class instance by:
c = Class.forName("org.apache.xalan.processor.TransformerFactoryImpl");
Object o = c.newInstance();
It returns ClassNotFoundException
But I can create instances of other classes from same jar and can run same code outside eclipse without problem.
Any idea?
Edit: TransformerFactory instantiating class (say "class1") is part of an external library added in the plugin classpath wheras the xalan.jar is also in plugin classpath. If I move this "class1" into plugin, it finds the provider and works fine.
Though I have seen this problem once, but I am not very sure how i solved it.
If you are using JDK 1.5 or above then try removing xml-apis.jar. It was needed for Java 1.4 to support XML.
Update 1
Ok. From your question I inferred that you are writing a eclipse plug-in. If yes, then have you added the above jars using plugin.xml->Runtime->classpath? If not try to do so. Eclipse plugin considers only its runtime->classpath entries
Update 2
To me it still appears as a classpath resolution issue. Though, its hard to say why its happening. For a try you can also check by changing the order of included jars in plugin.xml->Runtime->classpath.
Hope this will help.
PS: Since you are working on eclipse plug-in development therefore I would suggest you to go through this article Eclipse - a tale of two VMs and many classloaders.