I am attempting to build the Sample project that comes with Apache CXF 3.1.2.
The sample project is named 'antbuild' and it's goal is to help illustrate how to build projects using ANT as opposed to using MAVEN.
I am using Java 8 (release 60)
I am using Apache CXF 3.1.2
I am using Ant 1.9.x
I will eventually be using Tomcat 7.x
(but first have to get the Apache CXF Sample to build successfully.)
I immediately ran into the "Cannot create a secure XMLInputFactory" error.
I found a this article: CXF web service client: "Cannot create a secure XMLInputFactory"
So I modified the sample project's build.xml so that I can pass in the Java Configuration Value to avoid the strict security of the XMLInputFactory issue. I added a second jvmarg:
<java failonerror="true" classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes">
<classpath> <path refid="cxf.classpath"/></classpath>
<jvmarg value="${cxf.endorsed.flag}"/>
<jvmarg value="-Dorg.apache.cxf.stax.allowInsecureParser=1"/>
<sysproperty key="java.util.logging.config.file" value="${basedir}/logging.properties"/>
...
However, now I am getting a NullPointerException in pretty much the same spot of the Sample Project's Build process.
Copy of the Error is Below:
C:\ApacheCXF\3.1.2\samples\antbuild>ant
Buildfile: build.xml
maybe.generate.code:
generate.code:
[echo] Generating code using wsdl2java...
[mkdir] Created dir: C:\ApacheCXF\3.1.2\samples\antbuild\build\classes
[mkdir] Created dir: C:\ApacheCXF\3.1.2\samples\antbuild\build\src
[java] Exception in thread "main" java.lang.NullPointerException
[java] at org.apache.cxf.staxutils.StaxUtils.createXMLInputFactory(StaxUtils.java:320)
[java] at org.apache.cxf.staxutils.StaxUtils.getXMLInputFactory(StaxUtils.java:272)
[java] at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1715)
[java] at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1115)
[java] at org.apache.cxf.tools.wsdlto.core.PluginLoader.getPlugin(PluginLoader.java:236)
[java] at org.apache.cxf.tools.wsdlto.core.PluginLoader.getPlugin(PluginLoader.java:194)
[java] at org.apache.cxf.tools.wsdlto.core.PluginLoader.loadPlugin(PluginLoader.java:122)
[java] at org.apache.cxf.tools.wsdlto.core.PluginLoader.loadPlugins(PluginLoader.java:102)
[java] at org.apache.cxf.tools.wsdlto.core.PluginLoader.init(PluginLoader.java:79)
[java] at org.apache.cxf.tools.wsdlto.core.PluginLoader.<init>(PluginLoader.java:73)
[java] at org.apache.cxf.tools.wsdlto.core.PluginLoader.newInstance(PluginLoader.java:106)
[java] at org.apache.cxf.tools.wsdlto.WSDLToJava.<init>(WSDLToJava.java:48)
[java] at **org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:181)**
BUILD FAILED
**C:\ApacheCXF\3.1.2\samples\antbuild\build.xml:128**: The following error occurred while executing this line:
C:\ApacheCXF\3.1.2\samples\antbuild\build.xml:125: The following error occurred while executing this line:
C:\ApacheCXF\3.1.2\samples\antbuild\build.xml:88: Java returned: 1
Any suggestions would be appreciated.
I dont have any Tomcats installed. I dont have any other JRE's nor JDK's installed. I cant find any other copies of the JAR files mentioned in the StackOverflow article on my computer, so I dont see how (if possible) there is a class path issue.