Reputation: 921
My program was previously used JDK 1.4 . Now I want to use 1.6 to compile it . It was successfully compile against the 1.4 but when I change JDK to 1.6 It gives following compilation error.
[javac] symbol : constructor StartTagInfo(java.lang.String,java.lang.String,java.lang.String,org.xml.sax.helpers.At
tributesImpl,com.abc.jaxb.ssdclm.impl.runtime.MSVValidator)
[javac] location: class com.sun.msv.util.StartTagInfo
[javac] StartTagInfo sti = new StartTagInfo(
But I have the jaxb-libs-jwsdp-1.6 jar in my class path which contains StartTagInfo class with above constructor. If anyone have an idea of this issue, please advice me. thanks.
Upvotes: 0
Views: 379
Reputation: 5537
I suspect that due to change in JDK version, there would be one of the support lib jar's version has become incompatable. Worst could be that it may be a native lib jar.
I am not providing a solution of current issue. But providing another approach. If you can not change your code with this approach, let me know ; we will try to find issue with existing java upgrade.
With Java 1.6, the JWSDP pack is not longer required. Java 1.6 version comes with inbuilt JAXB version and hence one can directly use it.
Java 1.6 version comes with “xjc” compiler to generate java objects from xml.
Usage: xjc [-options ...]
Below code snippet shows on how the xjc compiler of of 1.6 can be used in the ant script to generate the java objects form XML file.
The below ant target will compile the xsd files test1.xsd and test2.xsd and will create the java objects from xsd into folder output/java
<target name=”xsd2java” description=”Generate java model from XSD xml schema using XJC compiler.”>
<echo message=”Generating java files from XSD using XJC compiler…” />
<mkdir dir=”output/java”/>
<exec executable=”xjc”>
<arg value=”-d”/>
<arg value=”output/java”/>
<arg value=”test1.xsd”/>
<arg value=”test2.xsd”/>
</exec>
</target>
The below code snippet shows how to compile Java objects from dtd files.
<div><macrodef name=”dtd2java”>
<attribute name=”dtdDir”/>
<attribute name=”dtdFile”/>
<attribute name=”javaPackage”/>
<attribute name=”javaDir”/>
<sequential>
<mkdir dir=”output/java/@{javaDir}”/>
<exec executable=”xjc”>
<arg value=”-d”/>
<arg value=”${output.dir}/java”/>
<arg value=”-p”/>
<arg value=”@{javaPackage}”/>
<arg value=”${output.dir}/java/@{javaDir}”/>
<arg value=”-extension”/><arg value=”-dtd”/>
<arg value=”@{dtdDir}/@{dtdFile}”/>
</exec>
</sequential>
</macrodef>
<target name=”dtd2java” description=”Generate java model from DTD using XJC2 compiler.” >
<echo message=”Generating java files from DTD using XJC2 compiler…”/>
<dtd2java dtdDir=”test/dtd” dtdFile=”test1.dtd” javaPackage=”com.test1.dtd” javaDir=”com/test1/dtd”/>
<dtd2java dtdDir=”test/dtd” dtdFile=”test2.dtd” javaPackage=”com.test2.dtd” javaDir=”com/test2/dtd”/>
</target>
</div>
Upvotes: 1