Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'ant run' failed for java sample code - requires JAXB 2.2 #41

Open
caiopavanelli opened this issue Feb 12, 2019 · 2 comments
Open

'ant run' failed for java sample code - requires JAXB 2.2 #41

caiopavanelli opened this issue Feb 12, 2019 · 2 comments
Labels
bug An existing feature in the sample is broken java specific to the java code samples

Comments

@caiopavanelli
Copy link

caiopavanelli commented Feb 12, 2019

Hi,

When running the Java sample 'ant run', it throws an exception telling it is loading JAXB 2.1, but requires JAXB 2.2.


C:\>java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

C:\>ant -version
Apache Ant(TM) version 1.10.5 compiled on July 10 2018

image

@jtsai01-bsc
Copy link

I have the same issue on JAXB 2.2 API jar. do you have the fix for this?

C:\Program Files\Tableau\REST API\java>ant -version
Apache Ant(TM) version 1.10.7 compiled on September 1 2019

See my ant run output below.
C:\Program Files\Tableau\REST API\java>ant run
Buildfile: C:\Program Files\Tableau\REST API\java\build.xml

compile:
[javac] C:\Program Files\Tableau\REST API\java\build.xml:32: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

jar:

run:
[java] Exception in thread "main" java.lang.LinkageError: JAXB 2.1 API jar is being loaded (from jar:file:/C:/Program%20Files/Tableau/REST%20API/java/lib/default/javaee-api.jar!/javax/xml/bind/annotation/XmlSchema.class), but this RI (from jar:file:/C:/Program%20Files/Tableau/REST%20API/java/lib/default/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) requires JAXB 2.2 API jar.
[java] at com.sun.xml.bind.v2.model.impl.ModelBuilder.(ModelBuilder.java:177)
[java] at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:473)
[java] at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:319)
[java] at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1170)
[java] at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:145)
[java] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.base/java.lang.reflect.Method.invoke(Method.java:567)
[java] at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
[java] at javax.xml.bind.ContextFinder.find(ContextFinder.java:366)
[java] at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
[java] at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
[java] at com.tableausoftware.documentation.api.rest.util.RestApiUtils.initialize(Unknown Source)
[java] at com.tableausoftware.documentation.api.rest.util.RestApiUtils.getInstance(Unknown Source)
[java] at com.tableausoftware.documentation.api.rest.Demo.(Unknown Source)
[java] Java Result: 1

BUILD SUCCESSFUL
Total time: 1 second

@jtsai01-bsc
Copy link

For this [java] Exception in thread "main" java.lang.LinkageError: JAXB 2.1 API jar is being loaded (from jar:file:/C:/Program%20Files/Tableau/REST%20API/java/lib/default/javaee-api.jar!/javax/xml/bind/annotation/XmlSchema.class), but this RI (from jar:file:/C:/Program%20Files/Tableau/REST%20API/java/lib/default/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) requires JAXB 2.2 API jar issue, I fix it by
a. download javaee-api-8.0.jar from https://jar-download.com/artifacts/javax/javaee-api/8.0/source-code
b. Copy javaee-api-8.0.jar into C:\Program Files\Tableau\REST API\java\lib\default\javaee-api.jar

Regards,
Jin-Chong

@jacalata jacalata added java specific to the java code samples new sample Request for a new sample, or new feature in existing sample labels Jan 28, 2022
@jacalata jacalata added bug An existing feature in the sample is broken and removed new sample Request for a new sample, or new feature in existing sample labels Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An existing feature in the sample is broken java specific to the java code samples
Projects
None yet
Development

No branches or pull requests

3 participants