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

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>

Related

Problem during deployment to Wildfly, with error "name is empty"

we are migrating from Jboss 4.2.2 to Wildfly. During deployment we are facing the following error.
Googling the error diidn't find anything. The error doesn't provide useful details.
my-server.jar defines several ejb3 beans.
Does anybody has an idea what might be wrong?
16:51:55,788 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.subunit."myapp.ear"."my-server.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."myapp.ear"."my-server.jar".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of subdeployment "my-server.jar" of deployment "myapp.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:189)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: name is empty
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:391)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
at org.jboss.as.ee.component.deployers.ResourceReferenceProcessor.getResourceRefEntries(ResourceReferenceProcessor.java:157)
at org.jboss.as.ee.component.deployers.ResourceReferenceProcessor.processDescriptorEntries(ResourceReferenceProcessor.java:74)
at org.jboss.as.ee.component.deployers.AbstractDeploymentDescriptorBindingsProcessor.deploy(AbstractDeploymentDescriptorBindingsProcessor.java:100)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182)
... 8 more
Try to delete every file and folder in wildfly --> standalone --> deployments and then run the standalone.bat file in wildfly --> bin.
Also, what made it work for us was to include the following dependency in the pom.xml file:
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.1</version>
</dependency>

JBoss Migration 5 EAP to 7 EAP Error with IllegalAnnotationsException XML Binding

I am currently working on JBoss migration from EAP 5.0.0 to EAP 7.1.0
My project structure is
AAA.ear
-- AAA-ejb.jar
-- AAA-soap.jar
-- /**-mapping.xml
-- lib
For now when I try to deploy AAA.ear with only AAA-ejb.jar dependency it doesn’t get any error.
But with both AAA-ejb.jar and AAA-soap.jar there is error log with the XML binding
2018-08-20 11:53:55,565 INFO [org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-2) Creating Service {http://www.abcd.co.com/wsdl/AImplementation/subscription/subscription-soap11http/v1}Subscription-SOAP11HTTP-v1 from WSDL: META-INF/wsdl/Subscription-SOAP11HTTP.wsdl
2018-08-20 11:53:55,672 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.subunit."AAA.ear"."AAA-soap.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."AAA.ear"."AAA-soap.jar".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of subdeployment "AAA-soap.jar" of deployment "AAA.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:375)
at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:79)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:255)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:543)
at org.jboss.wsf.stack.cxf.configuration.BusHolder.configure(BusHolder.java:235)
at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:97)
at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:59)
at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:73)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
... 5 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:329)
at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:426)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:528)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:263)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:103)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:168)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:460)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:338)
... 13 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 12 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://www.abcd.co.com/schema/bus/money/money/v1}InvestmentTypeType". Use #XmlType.name and #XmlType.namespace to assign different names to them.
this problem is related to the following location:
at com.co.abcd.subscriptionv1.schema.bus.money.money.InvestmentTypeType
at protected com.co.abcd.subscriptionv1.schema.bus.money.money.InvestmentTypeType com.co.abcd.subscriptionv1.schema.bus.subscription.subscription.SubscriptionByInvestmentTypeType.investmentType
at com.co.abcd.subscriptionv1.schema.bus.subscription.subscription.SubscriptionByInvestmentTypeType
at public com.co.abcd.subscriptionv1.schema.bus.subscription.subscription.SubscriptionByInvestmentTypeType com.co.abcd.subscriptionv1.schema.bus.subscription.subscription.ObjectFactory.createSubscriptionByInvestmentTypeType()
at com.co.abcd.subscriptionv1.schema.bus.subscription.subscription.ObjectFactory
this problem is related to the following location:
at com.co.abcd.schema.bus.money.money.v1.InvestmentTypeType
at protected com.co.abcd.schema.bus.money.money.v1.InvestmentTypeType com.co.abcd.schema.bus.account.account.v1.ValuationByMoneyType.investmentType
at com.co.abcd.schema.bus.account.account.v1.ValuationByMoneyType
at protected java.util.List com.co.abcd.schema.bus.account.account.v1.ValuationByMoneyListType.valuationByMoney
at com.co.abcd.schema.bus.account.account.v1.ValuationByMoneyListType
at protected com.co.abcd.schema.bus.account.account.v1.ValuationByMoneyListType com.co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceType.valuationByMoneyList
at com.co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceType
at protected java.util.List com.co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceListType.productHoldingInstance
at com.co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceListType
at public com.co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceListType com.co.abcd.schema.bus.account.account.v1.ObjectFactory.createProductHoldingInstanceListType()
at com.co.abcd.schema.bus.account.account.v1.ObjectFactory
.
.
.
My currently jboss-deployment-structure.xml in AAA.ear is
<jboss-deployment-structure>
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<dependencies>
<module name="org.hibernate" export="true"/>
<module name="org.jboss.as.system-jmx" export="true"/>
<module name="org.dom4j" export="true"/>
<module name="deployment.AAA.ear.AAA-ejb.jar" export="true"/>
<module name="deployment.AAA.ear.AAA-soap.jar" export="true"/>
</dependencies>
</deployment>
<sub-deployment name="AAA-ejb.jar">
</sub-deployment>
<sub-deployment name="AAA-soap.jar">
<dependencies>
<module name="deployment.AAA.ear.AAA-ejb.jar" />
</dependencies>
And I recognized that my project can deploy and run successfullly in Jboss 5 with JBoss Web Services Native 3.1.2 SP3.
Does this error occured because of the JBoss Web services is changed to JBossWS 5.1.9 ? If yes, what should I do.
Can anyone please advice? Thanks in advance
I solved the issue now with the https://developer.jboss.org/thread/274491
It happened that because the subscription-wsimport.jar (Jar stub for generate the WSDL) is not working on EAP 7 anymore .
So I try to re-generate the Stub with the new generator and deploy again. It has no error and WSDL Service is run successfully.

How to register a custom ProtocolMapper in Keycloak?

I'm struggling with registering a custom ProtocolMapper in Keycloak. I would like to add some data from my database on token request. So i followed the idea given in Keycloak add extra claims from database / external source.
I implemented the ProtocolMapper interface and added the file
META-INF/services/org.keycloak.protocol.ProtocolMapper
containing the reference to my class. So far so good and Keycloak recognizes the new implementation. I'm also able to configure it via the admin console.
To add some data to the token I think I must also add one/some of the interfaces
org.keycloak.protocol.oidc.mappers.UserInfoTokenMapper
org.keycloak.protocol.oidc.mappers.OIDCIDTokenMapper
org.keycloak.protocol.oidc.mappers.OIDCAccessTokenMapper
and implement the methods according to the interface(s).
The problem now is that as soon as I add the interface I get the following log message:
08:55:07,292 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.unit."keycloak-spi.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."keycloak-spi.jar".POST_MODULE
: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "keycloak-spi.jar"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: Failed to link at/lotterien/jam/keycloak/spi/JamAuthorizationInfoProtocolMapper (Module "deployment.keycloak-spi.jar" from Service Module Loader): org/keycloak/protocol/oidc/mappers/UserInfoTokenMapper
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77)
at org.jboss.modules.Module.loadModuleClass(Module.java:713)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
at java.util.ServiceLoader$1.next(Unknown Source)
at org.keycloak.provider.DefaultProviderLoader.load(DefaultProviderLoader.java:60)
at org.keycloak.provider.ProviderManager.load(ProviderManager.java:92)
at org.keycloak.services.DefaultKeycloakSessionFactory.loadFactories(DefaultKeycloakSessionFactory.java:214)
at org.keycloak.services.DefaultKeycloakSessionFactory.deploy(DefaultKeycloakSessionFactory.java:115)
at org.keycloak.provider.ProviderManagerRegistry.deploy(ProviderManagerRegistry.java:42)
at org.keycloak.subsystem.server.extension.KeycloakProviderDeploymentProcessor.deploy(KeycloakProviderDeploymentProcessor.java:55)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
... 5 more
Why does Keycloak not find its own interface? Shouldn't it be provided out of the box?
What do I miss to make it work?
Edit 1
I got a little bit further. I added a file
META-INF/jboss-deployment-structure.xml
with content
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.keycloak.keycloak-services"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
and now the exception is gone.
Unfortunately the method transformUserInfoToken() in my class is still not called on token request.
Can anyone put me in the right direction please?
It finally works. Even there are still open questions I could implement the needed functionality.
I had to implement the Interface
org.keycloak.protocol.oidc.mappers.OIDCAccessTokenMapper
(instead of org.keycloak.protocol.oidc.mappers.UserInfoTokenMapper)
Now my transformAccessToken() method is called on every request to URL http://<host>:<port>/auth/realms/testrealm/protocol/openid-connect/token
I think the problem came from my misunderstanding of the terms AccessToken, UserInfo and IDToken. I thought all three are part of the token generated. But it seems the OIDCAccessTokenMapper is the only way to get additional information into the access token.
The remaining open question for me is where the UserInfo and the IDToken would appear. Maybe somebody can give an answer for that.
I have a solution for MY specific problem. I had the same error - but already had a jboss-deployment-structure.xml with comparable contents. The reason it didn´t work for me was, that I had an EAR containing my implementation and libs as JARs. So the needed structure for jboss-deployment-structure.xml differed.
I post it here for others struggling with the same problem:
<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<dependencies>
<system export="true">
<paths>
<path name="com/sun/xml/internal/ws/spi"/>
</paths>
</system>
</dependencies>
</deployment>
<sub-deployment name="org.my.implementation-1.0-SNAPSHOT.jar">
<dependencies>
<module name="org.keycloak.keycloak-core"/>
<module name="org.keycloak.keycloak-server-spi"/>
<module name="org.keycloak.keycloak-server-spi-private"/>
<module name="org.keycloak.keycloak-services"/>
<module name="javax.ws.rs.api"/>
</dependencies>
</sub-deployment>
</jboss-deployment-structure>

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.

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.