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

javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath. #26896

Closed
KouShenhai opened this issue Jul 10, 2023 · 6 comments · Fixed by #29211 or #29384

Comments

@KouShenhai
Copy link

Bug Report

javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.
	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:278)
	at javax.xml.bind.ContextFinder.find(ContextFinder.java:421)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:721)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:662)
	at org.apache.shardingsphere.mode.repository.standalone.jdbc.sql.JDBCRepositorySQLLoader.loadFromJar(JDBCRepositorySQLLoader.java:114)
	at org.apache.shardingsphere.mode.repository.standalone.jdbc.sql.JDBCRepositorySQLLoader.load(JDBCRepositorySQLLoader.java:72)
	at org.apache.shardingsphere.mode.repository.standalone.jdbc.JDBCRepository.init(JDBCRepository.java:59)
	at org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPILoader.findService(TypedSPILoader.java:86)
	at org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPILoader.findService(TypedSPILoader.java:70)
	at org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPILoader.getService(TypedSPILoader.java:127) 

Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)

Which version of ShardingSphere did you use?

ShardingSphere 5.4.0 + JDK 17

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-JDBC

@xiaogang-github
Copy link

我也出现了这个问题,请问你是怎么处理的

@linghengqian
Copy link
Member

linghengqian commented Jul 11, 2023

  • Can you provide an example?

  • One issue that must be noted is that JDK 9 starts removing java.xml.bind packages. For JAXB's API, you can use glassfish or a third-party vendor's javax implementation of JAXB. I'm assuming you're using Maven, which is adding a specific version of the dependency to pom.xml.

<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <version>2.3.8</version>
</dependency>

@KouShenhai
Copy link
Author

  • Can you provide an example?
  • One issue that must be noted is that JDK 9 starts removing java.xml.bind packages. For JAXB's API, you can use glassfish or a third-party vendor's javax implementation of JAXB. I'm assuming you're using Maven, which is adding a specific version of the dependency to pom.xml.
<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <version>2.3.8</version>
</dependency>

Thank you very much for answering my question. The following dependencies have been introduced, but an error has been reported. It may be due to a higher version of JDK, but I hope the official website can quickly transition to Jakarta EE

<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <version>2.3.8</version>
</dependency>

@KouShenhai
Copy link
Author

我也出现了这个问题,请问你是怎么处理的

只能等官网过渡到Jakarta EE

@RaigorJiang
Copy link
Contributor

RaigorJiang commented Jul 18, 2023

Duplicated with #26041.

@RaigorJiang RaigorJiang closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2023
@linghengqian
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants