Jersey 1.18.1 is unable to pick my restful service when deployed on Jboss 7.1.1 final - rest

I have a very confusing problem with me. I have a eclipse Restful service project which is being built by gradle. I can successfully build and run my application in Tomcat 7.0.54, from within Eclipse and by deploying the war directly in /webapps folder of Tomcat.
But when I deploy my same war in Jboss 7.1.1 Final, it gives me below error.
10:43:45,390 WARN [org.jboss.jaxrs] (MSC service thread 1-7) JBAS011204: resteasy.scan found and ignored in web.xml. This is not necessary, as Resteasy will use the container integration in the JAX-RS 1.1 specification in section 2.3.2
10:43:45,390 WARN [org.jboss.jaxrs] (MSC service thread 1-7) JBAS011204: resteasy.scan.providers found and ignored in web.xml. This is not necessary, as Resteasy will use the container integration in the JAX-RS 1.1 specification in section 2.3.2
10:43:45,391 WARN [org.jboss.jaxrs] (MSC service thread 1-7) JBAS011204: resteasy.scan.resources found and ignored in web.xml. This is not necessary, as Resteasy will use the container integration in the JAX-RS 1.1 specification in section 2.3.2
10:43:46,128 INFO [com.sun.jersey.api.core.PackagesResourceConfig] (MSC service thread 1-2) Scanning for root resource and provider classes in the packages:
com.xxx.xxx.xxx.xxx.impl
org.codehaus.jackson.jaxrs
10:43:46,534 INFO [com.sun.jersey.server.impl.application.WebApplicationImpl] (MSC service thread 1-2) Initiating Jersey application, version 'Jersey: ${project.version} ${buildNumber}'
10:43:47,372 SEVERE [com.sun.jersey.server.impl.application.RootResourceUriRules] (MSC service thread 1-2) The ResourceConfig instance does not contain any root resource classes.
10:43:47,373 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/xxxxxx]] (MSC service thread 1-2) StandardWrapper.Throwable: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
at com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:99) [jersey-server-1.18.1.jar:1.18.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1359) [jersey-server-1.18.1.jar:1.18.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180) [jersey-server-1.18.1.jar:1.18.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799) [jersey-server-1.18.1.jar:1.18.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795) [jersey-server-1.18.1.jar:1.18.1]
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193) [jersey-core-1.18.1.jar:1.18.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795) [jersey-server-1.18.1.jar:1.18.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:790) [jersey-server-1.18.1.jar:1.18.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:491) [jersey-servlet-1.18.1.jar:1.18.1]
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:321) [jersey-servlet-1.18.1.jar:1.18.1]
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605) [jersey-servlet-1.18.1.jar:1.18.1]
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207) [jersey-servlet-1.18.1.jar:1.18.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:376) [jersey-servlet-1.18.1.jar:1.18.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:559) [jersey-servlet-1.18.1.jar:1.18.1]
at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
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:1145) [rt.jar:1.7.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]
10:43:47,388 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/taxation]] (MSC service thread 1-2) Servlet /xxxxxxx threw load() exception: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
at com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:99) [jersey-server-1.18.1.jar:1.18.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1359) [jersey-server-1.18.1.jar:1.18.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180) [jersey-server-1.18.1.jar:1.18.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799) [jersey-server-1.18.1.jar:1.18.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795) [jersey-server-1.18.1.jar:1.18.1]
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193) [jersey-core-1.18.1.jar:1.18.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795) [jersey-server-1.18.1.jar:1.18.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:790) [jersey-server-1.18.1.jar:1.18.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:491) [jersey-servlet-1.18.1.jar:1.18.1]
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:321) [jersey-servlet-1.18.1.jar:1.18.1]
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605) [jersey-servlet-1.18.1.jar:1.18.1]
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207) [jersey-servlet-1.18.1.jar:1.18.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:376) [jersey-servlet-1.18.1.jar:1.18.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:559) [jersey-servlet-1.18.1.jar:1.18.1]
at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
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:1145) [rt.jar:1.7.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]
Moreover, when I unpack this war to a folder and deploy that folder inside Jboss, it works! It also works if I run my project in Jboss directly from Eclipse. However, if I export the project as a war (from eclipse) and deploy that war file into Jboss, it again gives me same problem.
When I drilled down into the the code of Jersey, I found that com.sun.jersey.core.spi.scanning.uri.FileSchemeScanner is not able to pick my class files from the war.
Please help us resolve this issue.

I found the solution, and would like to post it so someone else could benefit. The problem was there in our build script. We were using different version of Jersey libraries. For some of the libraries, version 1.18.1 was being used, while for some other version 1.18 was being used.
Once the version for all the libraries was updated to 1.18.1, it worked perfectly.

Related

Weblogic to JBoss EAP 6.4 Migration - Servlet loading threw java.lang.RuntimeException: NOT IMPLEMENTED

I am currently working in a Weblogic to JBoss migration project. The source codes build easily, but when try to deploy ear file, getting error message as follows:
23:20:35,706 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[xyz]] (ServerService Thread Pool -- 50) JBWEB000289: Servlet xyz-rest-api threw load() exception: java.lang.RuntimeException: NOT IMPLEMENTED
at org.jboss.util.file.ArchiveBrowser.getBrowser(Unknown Source) [jboss-archive-browsing-5.0.0alpha-200607201-119.jar:5.0.0.Alpha (build: CVSTag=HEAD date=200607201119)]
at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:610) [hibernate-entitymanager-3.2.1.ga.jar:]
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:341) [hibernate-entitymanager-3.2.1.ga.jar:]
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126) [hibernate-entitymanager-3.2.1.ga.jar:]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:290) [spring-orm-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310) [spring-orm-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571) [spring-beans-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509) [spring-beans-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521) [spring-beans-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) [spring-beans-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296) [spring-beans-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) [spring-beans-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293) [spring-beans-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [spring-beans-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117) [spring-context-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:922) [spring-context-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) [spring-context-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651) [spring-webmvc-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:602) [spring-webmvc-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665) [spring-webmvc-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:521) [spring-webmvc-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:462) [spring-webmvc-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) [spring-webmvc-3.2.7.RELEASE.jar:3.2.7.RELEASE]
at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2.jar:1.0.2.Final-redhat-2]
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1194) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1100) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3593) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3802) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) [rt.jar:1.6.0_45]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_45]
at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
23:20:36,167 DEBUG [org.apache.jasper.compiler] (ServerService Thread Pool -- 50) JBWEB005025: Parent class loader is: ModuleClassLoader for Module "deployment.XYZ-ear-1.0-SNAPSHOT-JBOSS.ear.XYZ-war-1.0-
It seems you're using an old Hibernate 3 in your application, which is not compatible with EAP 6.x. Use the Hibernate which is bundled within the EAP.
More, even if it was, your Hibernate library uses some alpha version of a library that I don't know: jboss-archive-browsing-5.0.0alpha-200607201-119.jar
Using alpha libraries in production is not a good idea in general.
Servlet xyz-rest-api threw load() exception: java.lang.RuntimeException: NOT IMPLEMENTED
at org.jboss.util.file.ArchiveBrowser.getBrowser(Unknown Source) [jboss-archive-browsing-5.0.0alpha-200607201-119.jar:5.0.0.Alpha (build: CVSTag=HEAD date=200607201119)]
...
Lastly, have a look at the JBoss Windup migration tool which might help you with these kind of issues. It primarily targets exactly your use case - WebLogic to JBoss EAP.latest migration

Deploy kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war on wildfly-8.1.0.Final

I deployed successfully kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war on jboss-as-7.1.1.Final, running with jdk1.7.0_10.
But this configuration ...
kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war
wildfly-8.1.0.Final
jdk1.7.0_10
.. fails to deploy with this error :
14:58:06,531 WARN [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016011: Warning while parsing vfs:/C:/java/too
ls/wildfly-8.1.0.Final-guvnor/bin/content/kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war/WEB-INF/beans.xml:
1 cvc-elt.1 : DÚclaration de l'ÚlÚment 'beans' introuvable.
14:58:07,500 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.module
.service."deployment.kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war".main: org.jboss.msc.service.StartExcep
tion in service jboss.module.service."deployment.kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war".main: JBAS
018759: Failed to load module: deployment.kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war:main
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [wildfly-server-8.1.0.Fi
nal.jar:8.1.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-ms
c-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.F
inal.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_10]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_10]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_10]
Caused by: org.jboss.modules.ModuleNotFoundException: org.jboss.netty:main
at org.jboss.modules.Module.addPaths(Module.java:1050) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.Module.link(Module.java:1406) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.Module.relinkIfNecessary(Module.java:1434) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:242) [jboss-modules.jar:1.3.3.Final]
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:70) [wildfly-server-8.1.0.Fi
nal.jar:8.1.0.Final]
... 5 more
The drools-wb documentation here :
http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/wb.Workbench.html#wb.Installation
jboss-as7: tailored for JBoss AS 7 (which is being renamed to WildFly
in version 8)
So the doc, let me think that this 6.0.1.Final release of the workbench should work well with wildfly. I might be wrong ?
I managed to figured out.
Thanks to this blog entry :
https://mswiderski.blogspot.ch/2014/06/lets-wildfly-with-jbpm6.html
So, obviously a kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war cannot be deployed to wildfly. But the documentation was confused.
Starting from version 6.1.0, there is a kie-drools-wb-distribution-wars-6.1.0.CR1-wildfly.war - I found it here :
http://central.maven.org/maven2/org/kie/kie-drools-wb-distribution-wars/6.1.0.CR1/
Finally, wildfly can be started with the default standalone.xml profile
(the standalone-full.xml profile is required for the kie-wb)
Hope that will be helpful for someone.

ServiceActivator for container managed clustering using jgroups : org.jboss.msc.service.ServiceActivator: Provider class not found error

I am trying to use a service activator for jgroups channel.
I have put a file called : org.jboss.msc.service.ServiceActivator
in META-INF/services/
the content of the file is something like com.blahblah.project.cluster.JGroupsServiceActivator
which is the actual location of existence of the JGroupsServiceActivator file.
My deployment is an ear package which has a jar and a war file within. However when I try to deploy my application, I keep getting the following error:
11:45:52,222 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.subunit."proj-ear.ear"."proj-ejb-0.61.1-SNAPSHOT.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."proj-ear.ear"."proj-ejb-0.61.1-SNAPSHOT.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "proj-ejb-0.61.1-SNAPSHOT.jar" of deployment "proj-ear.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
Caused by: java.util.ServiceConfigurationError: org.jboss.msc.service.ServiceActivator: Provider com.blahblah.proj.cluster.JGroupsServiceActivator not found
at java.util.ServiceLoader.fail(ServiceLoader.java:231) [rt.jar:1.7.0_25]
at java.util.ServiceLoader.access$300(ServiceLoader.java:181) [rt.jar:1.7.0_25]
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:365) [rt.jar:1.7.0_25]
at java.util.ServiceLoader$1.next(ServiceLoader.java:445) [rt.jar:1.7.0_25]
at org.jboss.as.server.deployment.service.ServiceActivatorProcessor.deploy(ServiceActivatorProcessor.java:60) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
... 5 more
11:45:52,419 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.subunit."proj-ear.ear"."proj-ejb-0.61.1-SNAPSHOT.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."proj-ear.ear"."proj-ejb-0.61.1-SNAPSHOT.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "proj-ejb-0.61.1-SNAPSHOT.jar" of deployment "proj-ear.ear"
It does not find the provider. Is there any idea why? Here JgroupsServiceActivator is my own class within the jar.
How can I make this file explicitly visible to jboss?
Try adding a dependency to org.jboss.as.server in the project manifest (war/META-INF/MANIFEST.MF).
it's similar to gcvt's answer but that's what solved the problem for me - adding dependency module 'org.jboss.as.server' to jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.jgroups"/>
<module name="org.jboss.as.naming"/>
<module name="org.jboss.as.clustering.jgroups"/>
<module name="org.infinispan"/>
<module name="org.jboss.as.server"/>
</dependencies>
</deployment>
</jboss-deployment-structure>

Embeddable EJBContainer and JBoss 7.1.1.Final

Has anyone been able to get EJBContainer.createEJBContainer() to work with JBoss 7.1.1.Final?
Running the following code as a JUnit test results in NullPointerException!
public class EJBContainerTest {
private static EJBContainer ejbContainer;
private static Context context;
#BeforeClass
public static void beforeClass() {
System.setProperty("jboss.home", "/home/usr1/jboss-as-7.1.1.Final");
ejbContainer = EJBContainer.createEJBContainer();
context = ejbContainer.getContext();
}
#Test
public void test() {
Assert.assertNotNull(context);
}
}
Stack trace:
java.lang.NullPointerException
at org.jboss.modules.Module.forClassLoader(Module.java:365)
at org.jboss.modules.Module.forClassLoader(Module.java:365)
at org.jboss.modules.Module.forClassLoader(Module.java:365)
at org.jboss.modules.Module.getContextModuleLoader(Module.java:421)
at org.jboss.as.embedded.ejb3.JBossStandaloneEJBContainerProvider.createEJBContainer(JBossStandaloneEJBContainerProvider.java:86)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:93)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:75)
at org.arquillian.example.EJBContainerTest.beforeClass(EJBContainerTest.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Adding System.setProperty("org.jboss.as.embedded.ejb3.BARREN", "true") to the code above fixes the NPE problem and embedded container starts successfully but fails to deploy classes with the following error:
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit.classes.STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit.classes.STRUCTURE: Failed to process phase STRUCTURE of deployment "classes"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119)
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$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to mount deployment content
at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:91)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)
... 5 more
Caused by: java.util.zip.ZipException: invalid CEN header (bad signature)
at java.util.zip.ZipFile.open(Native Method) [rt.jar:1.6.0_26]
at java.util.zip.ZipFile.<init>(ZipFile.java:127) [rt.jar:1.6.0_26]
at java.util.jar.JarFile.<init>(JarFile.java:135) [rt.jar:1.6.0_26]
at java.util.jar.JarFile.<init>(JarFile.java:99) [rt.jar:1.6.0_26]
at org.jboss.vfs.spi.JavaZipFileSystem.<init>(JavaZipFileSystem.java:97)
at org.jboss.vfs.spi.JavaZipFileSystem.<init>(JavaZipFileSystem.java:83)
at org.jboss.vfs.VFS.mountZip(VFS.java:408)
at org.jboss.vfs.VFS.mountZip(VFS.java:434)
at org.jboss.as.server.deployment.DeploymentMountProvider$Factory$ServerDeploymentRepositoryImpl.mountDeploymentContent(DeploymentMountProvider.java:95)
at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:87)
... 6 more
16:49:12,128 INFO [org.jboss.as.server] (pool-9-thread-1) JBAS015870: Deploy of deployment "classes" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.classes.STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.classes.STRUCTURE: Failed to process phase STRUCTURE of deployment \"classes\""}}
16:49:12,129 INFO [org.jboss.as.controller] (pool-9-thread-1) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit.classes.STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit.classes.STRUCTURE: Failed to process phase STRUCTURE of deployment "classes"
You have to set these files : default.persistence.properties , ejb3-interceptors-aop.xml , embedded-jboss-beans.xml , jboss-jms-beans.xml ,jndi.properties, login-config.xml , security-beans.xml and if you use testNG you add also testng.xml in the src/test/resources directory
in your class you have to add :
System.setProperty("org.jboss.as.embedded.ejb3.BARREN", "true");
System.setProperty("jboss.home", "/home/usr1/jboss-as-7.1.1.Final");
System.setProperty("jboss.home.dir", "/home/usr1/jboss-as-7.1.1.Final");
There is an old bug in the JBoss class org.jboss.vfs.VirtualJarFileInputStream.
It cannot write valid Local file headers of Zip files. So the deployment of classes which creates a tempory zip file cannot work in JBoss.

Orbeon deployment on JBoss AS 7

We are trying to deploy Orbeon Forms 3.9 on JBoss AS 7 and getting the following errors:
15:34:36,621 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/adg-xforms]] (MSC service thread 1-2) Exception sending context initialized event to listener instance of class org.orbeon.oxf.webapp.OrbeonServletContextListenerDelegate: org.orbeon.oxf.common.OXFException: no implementation of regexp was found.
at org.orbeon.oxf.webapp.OrbeonServletContextListenerDelegate.contextInitialized(OrbeonServletContextListenerDelegate.java:43) [orbeon.jar:]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
15:34:36,670 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error listenerStart
15:34:36,670 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/adg-xforms] startup failed due to previous errors
15:34:36,682 ERROR [stderr] (MSC service thread 1-2) Starting Orbeon Forms 3.8.0.201005141856 CE
15:34:36,693 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/adg-xforms]] (MSC service thread 1-2) Exception sending context destroyed event to listener instance of class org.orbeon.oxf.webapp.OrbeonServletContextListenerDelegate: org.orbeon.oxf.common.OXFException: Could not initialize class com.sun.msv.datatype.xsd.AnyURIType
at org.orbeon.oxf.webapp.OrbeonServletContextListenerDelegate.contextDestroyed(OrbeonServletContextListenerDelegate.java:52) [orbeon.jar:]
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3465) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3970) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3888) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
Do you support JBoss AS 7 or anyone tried deploying orbeon on this app server.
I just added xsdlib-20030225.jar to lib directory (It's just one I had to hand ;-O). This is a HACK, I don't know what it affects and don't know if there are any side effects...but it works so far ;-)
This was tested with JBoss AS 7.1.1.Final "Brontes".
Follow the following steps:
for Orbeon Forms PE
unzip orbeon.war
place your license.xml file under WEB-INF/resources/config/license.xml
re-zip orbeon.war
start a standalone server with bin/standalone.sh
drop orbeon.war into the JBoss standalone/deployments folder
(source)
The joy of class loaders. Some code in MSV tries to load com.sun.msv.datatype.xsd.AnyURIType, which shouldn't fail as this class is in WEB-INF/lib/msv-xsdlib-20070407_orbeon_20100309.jar. I suspect that because of the way the class loaders is structured in JBoss, Orbeon ends up using a version of MSV coming from JBoss which is unable to load AnyURIType which is a jar that only comes with Orbeon. But I might be wrong on this.
This type of application-server specific question can be rather time consuming to resolve. So I would recommend you to use Tomcat or to get Orbeon to resolve this for you under a Development Support subscription.