[keycloak-dev] Keycloak WAR inside on an EAR file ?

Matthias Wessendorf matzew at apache.org
Tue Apr 1 05:23:23 EDT 2014


OK, atm I am producing a 'custom war', exactly like this project:
https://github.com/keycloak/keycloak/tree/master/server


HOWEVER, now I moved the jboss-deployment-structure.xml out of the KC.war,
into the EAR's META-INF.

Plus I had to change <deployment> to <sub-deployment
name="keycloak-auth-server.war">

Thanks Stian for help on IRC!

-M


On Mon, Mar 31, 2014 at 5:57 PM, Matthias Wessendorf <matzew at apache.org>wrote:

> NOTE: I am using Alpha-4 version
>
>
> On Mon, Mar 31, 2014 at 5:57 PM, Matthias Wessendorf <matzew at apache.org>wrote:
>
>> Hello,
>>
>> I tried to pull the auth-server.war file into an EAR. Once that is
>> deployed to the JBoss 7.1.1 (I did not try WildFly), I am getting this
>> error on the JAX-RS Application initialization:
>>
>> 17:55:00,113 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/auth]] (MSC service thread 1-14) StandardWrapper.Throwable: java.lang.RuntimeException: Failed to construct public org.keycloak.server.KeycloakServerApplication(javax.servlet.ServletContext) throws java.io.FileNotFoundException
>>     at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:144) [resteasy-jaxrs-2.3.2.Final.jar:]
>>     at org.jboss.resteasy.spi.ResteasyDeployment.createFromInjectorFactory(ResteasyDeployment.java:282) [resteasy-jaxrs-2.3.2.Final.jar:]
>>     at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:259) [resteasy-jaxrs-2.3.2.Final.jar:]
>>     at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:85) [resteasy-jaxrs-2.3.2.Final.jar:]
>>     at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) [resteasy-jaxrs-2.3.2.Final.jar:]
>>     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.13.Final.jar:]
>>     at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.13.Final.jar:]
>>     at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.13.Final.jar:]
>>     at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.13.Final.jar:]
>>     at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
>>     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
>>     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
>>     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09]
>>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09]
>>     at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]
>> Caused by: org.jboss.resteasy.spi.LoggableFailure: Unable to find contextual data of type: javax.servlet.ServletContext
>>     at org.jboss.resteasy.core.ContextParameterInjector$GenericDelegatingProxy.invoke(ContextParameterInjector.java:53) [resteasy-jaxrs-2.3.2.Final.jar:]
>>     at $Proxy39.getContextPath(Unknown Source)  at org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:37) [keycloak-services-1.0-alpha-4.jar:]
>>     at org.keycloak.server.KeycloakServerApplication.<init>(KeycloakServerApplication.java:41) [classes:]
>>     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_09]
>>     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_09]
>>     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_09]
>>     at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [rt.jar:1.7.0_09]
>>     at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:132) [resteasy-jaxrs-2.3.2.Final.jar:]
>>     ... 14 more
>>
>> 17:55:00,123 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/auth]] (MSC service thread 1-14) Servlet /auth threw load() exception: org.jboss.resteasy.spi.LoggableFailure: Unable to find contextual data of type: javax.servlet.ServletContext
>>     at org.jboss.resteasy.core.ContextParameterInjector$GenericDelegatingProxy.invoke(ContextParameterInjector.java:53) [resteasy-jaxrs-2.3.2.Final.jar:]
>>     at $Proxy39.getContextPath(Unknown Source)  at org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:37) [keycloak-services-1.0-alpha-4.jar:]
>>     at org.keycloak.server.KeycloakServerApplication.<init>(KeycloakServerApplication.java:41) [classes:]
>>     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_09]
>>     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_09]
>>     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_09]
>>     at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [rt.jar:1.7.0_09]
>>     at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:132) [resteasy-jaxrs-2.3.2.Final.jar:]
>>     at org.jboss.resteasy.spi.ResteasyDeployment.createFromInjectorFactory(ResteasyDeployment.java:282) [resteasy-jaxrs-2.3.2.Final.jar:]
>>     at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:259) [resteasy-jaxrs-2.3.2.Final.jar:]
>>     at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:85) [resteasy-jaxrs-2.3.2.Final.jar:]
>>     at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) [resteasy-jaxrs-2.3.2.Final.jar:]
>>     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.13.Final.jar:]
>>     at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.13.Final.jar:]
>>     at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.13.Final.jar:]
>>     at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.13.Final.jar:]
>>     at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
>>     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
>>     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
>>     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09]
>>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09]
>>     at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]
>>
>> I wonder if there is anything wrong here, w/ the
>> jboss-deployment-structure.xml file of the actual WAR file from Keycloak?
>>
>> --
>> Matthias Wessendorf
>>
>> blog: http://matthiaswessendorf.wordpress.com/
>> sessions: http://www.slideshare.net/mwessendorf
>> twitter: http://twitter.com/mwessendorf
>>
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-dev/attachments/20140401/baa6545c/attachment.html 


More information about the keycloak-dev mailing list