Several issues with Modeshape 3.x + Jboss AS 7
michaelwesterngate Apr 6, 2012 4:33 AMHi!
I've checked out the ModeShape 3.x branch (today) and it has built just fine.
Then I've extracted the contents of modeshape-3.0-SNAPSHOT-jbossas-7-dist.zip and manually moved each file/folder to the appropriate folder in my jboss as 7.0.13.Final installation.
First I've discovered is that modeshape defines a security domain for the rest service called modeshape-rest or something which doesn't exist in jboss so he fails to deploy. I've changed it to the "other" security domain and now it deploys.
Next, when trying to access localhost/modeshape-rest and after http credentials I've got exceptions that slf4j LoggerFactory couldn't be found. So I've added an dependencies into the rest war's Manifest manually which now looks like this: Dependencies: javax.jcr, org.modeshape.jcr.api services, org.modeshape services, org.slf4j --> shouldn't the org.slf4j dependency be added during the maven build?
Now accessing the rest service url again brings up another error I cannot figure why it happens maybe you can help in getting modeshape 3.x running fine on AS 7 (did I probably forget something??). Here's the stack trace of the current error:
10:23:12,285 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/modeshape-rest].[Resteasy]] (http--127.0.0.1-8080-4) Servlet.service() for servlet Resteasy threw exception: org.jboss.resteasy.spi.UnhandledException: java.util.ServiceConfigurationError: javax.jcr.RepositoryFactory: Provider org.modeshape.jcr.JcrRepositoryFactory could not be instantiated: java.lang.NoClassDefFoundError: Could not initialize class org.modeshape.jcr.JcrRepositoryFactory
at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:340) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:540) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.2.Final.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_29]
Caused by: java.util.ServiceConfigurationError: javax.jcr.RepositoryFactory: Provider org.modeshape.jcr.JcrRepositoryFactory could not be instantiated: java.lang.NoClassDefFoundError: Could not initialize class org.modeshape.jcr.JcrRepositoryFactory
at java.util.ServiceLoader.fail(ServiceLoader.java:207) [classes.jar:1.6.0_29]
at java.util.ServiceLoader.access$100(ServiceLoader.java:164) [classes.jar:1.6.0_29]
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:353) [classes.jar:1.6.0_29]
at java.util.ServiceLoader$1.next(ServiceLoader.java:421) [classes.jar:1.6.0_29]
at org.modeshape.web.jcr.RepositoryManager.getJcrRepositoryNames(RepositoryManager.java:148) [modeshape-web-jcr-3.0-SNAPSHOT.jar:3.0-SNAPSHOT]
at org.modeshape.web.jcr.rest.ServerHandler.getRepositories(ServerHandler.java:42) [modeshape-web-jcr-rest-3.0-SNAPSHOT.jar:3.0-SNAPSHOT]
at org.modeshape.web.jcr.rest.JcrResources.getRepositories(JcrResources.java:169) [modeshape-web-jcr-rest-3.0-SNAPSHOT.jar:3.0-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [classes.jar:1.6.0_29]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [classes.jar:1.6.0_29]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [classes.jar:1.6.0_29]
at java.lang.reflect.Method.invoke(Method.java:597) [classes.jar:1.6.0_29]
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.2.Final.jar:]
... 20 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.modeshape.jcr.JcrRepositoryFactory
at java.lang.Class.forName0(Native Method) [classes.jar:1.6.0_29]
at java.lang.Class.forName(Class.java:247) [classes.jar:1.6.0_29]
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:345) [classes.jar:1.6.0_29]
... 33 more
thank you so much!
Alex