[keycloak-dev] Exception when using JAXB in keycloak

Eric Son 3016 desk3016 at live.com
Thu Jun 9 16:46:35 EDT 2016


Hi, I was trying to use JAXB in the keycloak and I have got the ClassNotFoundException 

2016-06-09 20:19:40,514 INFO  [stdout] (default task-2) Failed to create marshalled xmlString: javax.xml.bind.JAXBException
2016-06-09 20:19:40,515 INFO  [stdout] (default task-2)  - with linked exception:
2016-06-09 20:19:40,515 INFO  [stdout] (default task-2) [java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory from [Module "deployment.keycloak-server.war:main" from Service Module Loader]]

when the code is doing
JAXBContext jaxbContext = JAXBContext.newInstance(Class A);

is it because of keycloak is using openJDK instead of oracle JDK? 

Since, on my eclipse, the project includes the JRE system library that has rt.jar containing com.sun.xml.internal.bind.v2.ContextFactory class 
and was able to compile the project with no issue but it only happens when keycloak war is deployed.

I borrow some idea from below link, (the same thing happens for com.sun.net.ssl.internal.ssl.provider with JRE system library's jsse.jar)
http://stackoverflow.com/questions/11289860/deploy-time-error-java-lang-noclassdeffounderror-com-sun-net-ssl-internal-ssl

basically, I created a jboss-deployment-structure.xml file into the WEB-INF/ and imported the system module dependency into module.xml under JBOSS_HOME\modules\system\layers\base\sun\jdk\main\ but it didn't help. 


Has anyone run into this issue? Any suggestion will be appreciated.

Thanks a lot!

Best Regards,

WJ
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-dev/attachments/20160609/f8286ea6/attachment.html 


More information about the keycloak-dev mailing list