[keycloak-dev] Exception when using JAXB in keycloak

Stian Thorgersen sthorger at redhat.com
Mon Jun 13 02:59:43 EDT 2016


Is this in a custom provider (what SPI?)? If so you should deploy it as a
module (see docs for details) and also do a Google search for what
dependency is needed.

On 9 June 2016 at 22:46, Eric Son 3016 <desk3016 at live.com> wrote:

> 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
>
> _______________________________________________
> keycloak-dev mailing list
> keycloak-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-dev/attachments/20160613/6aa4a37c/attachment.html 


More information about the keycloak-dev mailing list