Deployment failed due to a keycloak-admin-client dependency - jboss

I've a REST application writen in Java EE (JAX-RS 2.1/Resteasy, EJB, CDI, ...) which has to able to create a keycloak user in the Keycloak 2.5.5. To run my application I use a WildFly 10.1.0 server.
To create the keycloak user I'd like to use an Administration REST API publicated by the Keycloak. Because of that I've added a following dependency to my build.gradle:
compile group: 'org.keycloak', name: 'keycloak-admin-client', version: '3.3.0.Final'
After that (only adding dependency) when I deploy my application on the WildFly, I reveice an error due to:
java.lang.RuntimeException: RESTEASY003190: Could not find constructor for class: org.keycloak.admin.client.resource.RealmsResource
Sometimes due to:
java.lang.RuntimeException: RESTEASY003190: Could not find constructor for class: org.keycloak.admin.client.resource.ServerInfoResource
Here is full stacktrace regarding the first error:
08:14:14,505 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 86) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./myapp: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./myapp: java.lang.RuntimeException: RESTEASY003190: Could not find constructor for class: org.keycloak.admin.client.resource.RealmsResource
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.RuntimeException: RESTEASY003190: Could not find constructor for class: org.keycloak.admin.client.resource.RealmsResource
at org.jboss.resteasy.spi.metadata.ResourceBuilder.constructor(ResourceBuilder.java:692)
at org.jboss.resteasy.plugins.server.resourcefactory.POJOResourceFactory.registered(POJOResourceFactory.java:42)
at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:208)
at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:194)
at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:180)
at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:157)
at org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:76)
at org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:409)
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:250)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:113)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:250)
at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:133)
at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:546)
at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:517)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:559)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
... 6 more
08:14:14,511 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "myapp.war")]) - failure description: {
"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./myapp" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./myapp: java.lang.RuntimeException: RESTEASY003190: Could not find constructor for class: org.keycloak.admin.client.resource.RealmsResource
Caused by: java.lang.RuntimeException: RESTEASY003190: Could not find constructor for class: org.keycloak.admin.client.resource.RealmsResource"},
"WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.deployment.default-server.default-host./myapp"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
EDIT:
It could be important, there are dependencies regarding the JAX-RS/Resteasy in a build.gradle:
compile( 'javax:javaee-api:7.0') {
exclude group: 'javax.ws.rs', module: 'javax.ws.rs-api'
}
compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.1'
compile group: 'org.jboss.resteasy', name: 'resteasy-servlet-initializer', version: '3.1.4.Final'
//compile group: 'org.jboss.resteasy', name: 'resteasy-jaxrs', version: '3.1.4.Final'
compile group: 'org.jboss.resteasy', name: 'resteasy-jaxb-provider', version: '3.1.4.Final'
compile group: 'org.jboss.resteasy', name: 'resteasy-multipart-provider', version: '3.1.4.Final'
When I use a resteasy-jaxrs lib instead of a resteasy-servlet-initializer, I can deploy the application without any issues but then application's endpoints don't work (not found error).

Related

Java EE WFLYCTL0412 Required services that are not installed

Hi im trying to deploy a javaEE application in my wildfly server and when i try to run my server it throws me an exception about services that are not installed this happened any ideas what can be in conflict? Here is the output:
Deploying C:\wildfly-26.1.0.Final\standalone\deployments\ProyectoServidor.ear
{
"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"ProyectoServidor.ear\".\"ProyectoEJB-ejb.jar\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of subdeployment \"ProyectoEJB-ejb.jar\" of deployment \"ProyectoServidor.ear\"
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class com.fannog.proyectoservidor.utils.Encryptor with ClassLoader ModuleClassLoader for Module \"deployment.ProyectoServidor.ear.ProyectoEJB-ejb.jar\" from Service Module Loader
Caused by: java.lang.NoClassDefFoundError: org/jasypt/util/password/StrongPasswordEncryptor
Caused by: java.lang.ClassNotFoundException: org.jasypt.util.password.StrongPasswordEncryptor from [Module \"deployment.ProyectoServidor.ear.ProyectoEJB-ejb.jar\" from Service Module Loader]"},
"WFLYCTL0412: Required services that are not installed:" => [
"jboss.deployment.unit.\"ProyectoServidor.ear\".WeldStartService",
"jboss.deployment.unit.\"ProyectoServidor.ear\".beanmanager"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"ProyectoServidor.ear\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"ProyectoServidor.ear\".beanmanager, jboss.deployment.unit.\"ProyectoServidor.ear\".WeldStartService]"]
}
C:\Users\facun\git\servidor\nbproject\build-impl.xml:330: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 6 seconds)
Your ejb is using org.jasypt.util.password.StrongPasswordEncryptor which is not provided in your application thus you are getting a ClassNotFoundException:
java.lang.ClassNotFoundException: org.jasypt.util.password.StrongPasswordEncryptor from [Module "deployment.ProyectoServidor.ear.ProyectoEJB-ejb.jar" from Service Module Loader]"},

ZooKeeperClientTimeoutException when using #EmbeddedKafka

Once I add #EmbeddedKafka to an integration test I see the following error:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'embeddedKafka': Invocation of init method failed; nested exception is kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection while in state: CONNECTING
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:407)
at org.springframework.kafka.test.context.EmbeddedKafkaContextCustomizer.customizeContext(EmbeddedKafkaContextCustomizer.java:119)
at org.springframework.boot.test.context.SpringBootContextLoader$ContextCustomizerAdapter.initialize(SpringBootContextLoader.java:315)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:626)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:370)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:126)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
... 64 more
Caused by: kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection while in state: CONNECTING
at kafka.zookeeper.ZooKeeperClient.$anonfun$waitUntilConnected$3(ZooKeeperClient.scala:258)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:253)
at kafka.zookeeper.ZooKeeperClient.waitUntilConnected(ZooKeeperClient.scala:254)
at kafka.zookeeper.ZooKeeperClient.<init>(ZooKeeperClient.scala:112)
at kafka.zk.KafkaZkClient$.apply(KafkaZkClient.scala:1826)
at kafka.server.KafkaServer.createZkClient$1(KafkaServer.scala:364)
at kafka.server.KafkaServer.initZkClient(KafkaServer.scala:387)
at kafka.server.KafkaServer.startup(KafkaServer.scala:207)
at kafka.utils.TestUtils$.createServer(TestUtils.scala:142)
at kafka.utils.TestUtils.createServer(TestUtils.scala)
at org.springframework.kafka.test.EmbeddedKafkaBroker.afterPropertiesSet(EmbeddedKafkaBroker.java:305)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
If you are using Spring boot 2.2.x
you have to explicitly use spring kafka 2.4.6 (at least in test)
testImplementation 'org.springframework.kafka:spring-kafka:2.4.6.RELEASE'
testImplementation 'org.springframework.kafka:spring-kafka-test:2.4.6.RELEASE'
and also explicitly set your kafka client version to 2.3.1 (in gradle.properties file):
kafka.version=2.4.1

com.lightbend.lagom.internal.broker.kafka.KafkaSubscriberActor

I am new to lagom,elasticsearch,I am using lagom,elasticsearch,scala and cassandra.Everything is fine but when i post json data through postman,data go to cassandra but not to the elasticsearch and I am getting an error a warning and as below
12:22:10.688 [error] com.lightbend.lagom.internal.broker.kafka.KafkaSubscriberActor [sourceThread=search-impl-application-akka.actor.default-dispatcher-5, akkaTimestamp=06:52:10.688UTC, akkaSource=akka.tcp://search-impl-application#127.0.0.1:51584/user/KafkaBackoffConsumer1-customerTopic/KafkaConsumerActor1-customerTopic, sourceActorSystem=search-impl-application] - Topic subscription interrupted due to failure: [java.lang.IllegalStateException: Service elastic-search was not found by service locator]
12:22:10.688 [error] akka.actor.OneForOneStrategy [sourceThread=search-impl-application-akka.actor.default-dispatcher-5, akkaTimestamp=06:52:10.688UTC, akkaSource=akka://search-impl-application/user/KafkaBackoffConsumer1-customerTopic/KafkaConsumerActor1-customerTopic, sourceActorSystem=search-impl-application] - Service elastic-search was not found by service locator
java.lang.IllegalStateException: Service elastic-search was not found by service locator
at com.lightbend.lagom.internal.client.ClientServiceCallInvoker.$anonfun$doInvoke$4(ClientServiceCallInvoker.scala:75)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:289)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[warn] com.lightbend.lagom.internal.scaladsl.registry.ServiceRegistryServiceLocator [] - Service name=[elastic-search] was not found. Hint: Maybe it was not registered?
any help??
See https://www.lagomframework.com/documentation/1.4.x/scala/ServiceLocator.html#Communicating-with-external-services for information on configuring the development mode service locator with additional services.
For example, this is how it's configured in the Online Auction Scala example project:
// register 'elastic-search' as an unmanaged service on the service locator so that at 'runAll' our code
// will resolve 'elastic-search' and use it. See also com.example.com.ElasticSearch
lagomUnmanagedServices in ThisBuild += ("elastic-search" -> "http://127.0.0.1:9200")
You'll need to reload your sbt configuration and restart your services for this to take effect.

Deployment issue of spring with JAX-WS WAR in JBOSS

I am using Spring, Maven and creating a web service in eclipse. While deploying the WAR in JBOSS I am getting following error-
Internal Server Error
{
"outcome" => "failed",
"failure-description" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"NextGen-web1.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"NextGen-web1.war\".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment \"NextGen-web1.war\"
Caused by: javax.xml.ws.WebServiceException: java.lang.reflect.UndeclaredThrowableException
Caused by: java.lang.reflect.UndeclaredThrowableException
Caused by: java.lang.NoSuchMethodException: org.objectweb.asm.MethodWriter.visitLabel(org.objectweb.asm.Label)"}},
"rolled-back" => true
}
you must include this library in your pom.xml:
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>3.3.1.redhat-9</version>
</dependency>

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.