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

Chatbot throws JAXB-API excetpion #77

Open
sajjadpz opened this issue Jul 12, 2018 · 7 comments
Open

Chatbot throws JAXB-API excetpion #77

sajjadpz opened this issue Jul 12, 2018 · 7 comments

Comments

@sajjadpz
Copy link
Contributor

I am running chatbot within IDE and it throws following exception

2018-07-12 13:20:18.019 ERROR [localhost-startStop-1] "chatbot" [com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl] c.s.j.s.i.w.WadlApplicationContextImpl - Implementation of JAXB-API has not been found on module path or classpath.
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:177)
	at javax.xml.bind.ContextFinder.find(ContextFinder.java:364)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:508)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:465)

A bit of research showed that it it is related to Java-9 modularity and a worked around has already been implemented in pom.xml

<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<!-- ~~~~~~~ support java 9 ~~~~~~~ -->
					<!-- https://blog.frankel.ch/migrating-to-java-9/1/ -->
					<jvmArguments>--add-modules java.xml.bind</jvmArguments>
				</configuration>
			</plugin>

which doesn't seem to work. May be someone can look into it who has more insight on this.
The application, however seems to work normally, its just an annoying error in the console 😄

@sajjadpz sajjadpz changed the title Chatbot throws JAXB-API execetpion Chatbot throws JAXB-API excetpion Jul 12, 2018
@prasanthhs
Copy link
Contributor

prasanthhs commented Jul 12, 2018

@sajjadpz Does adding jaxb explicitly as pom dependency solve your problem? This code is there inside chatbot micro service but is not part of the parent pom.

<groupId>javax.xml.bind</groupId>

<artifactId>jaxb-api</artifactId>

<version>2.3.0</version>

@sajjadpz
Copy link
Contributor Author

No it doesn't solve the issue.

@prasanthhs
Copy link
Contributor

That seems to be the only solution available for this issue on the internet. A set of related dependancies to add to pom.xml to avoid this problem.

@RicardoUsbeck
Copy link
Contributor

What is your JDK version? Update your JDK to 10 , it might be a java 8/9 problem

@Muzammil1234
Copy link
Collaborator

Muzammil1234 commented Jul 12, 2018

Try running by adding dependency at run time, something like this

java --add-modules=java.xml.bind -jar chatbot.jar, there must a way to add use this add module with spring-boot:run too, just search for it.

P.S: It's Guru here

@sajjadpz
Copy link
Contributor Author

@RicardoUsbeck - I have checked , jdk version is 10.

@sajjadpz
Copy link
Contributor Author

@guru5590 - it is already added in pom.xml of parent project. Which itself passes those parameters at run time.

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

No branches or pull requests

4 participants