[wildfly-dev] How to expose javax.batch classes to all deployments?

Cheng Fang cfang at redhat.com
Fri Jun 28 23:17:56 EDT 2013


Thanks Stuart.  I added javax.bath.api to JavaEEDependencyProcessor for 
now, and solved this problem.

Cheng

On 6/27/13 5:28 PM, Stuart Douglas wrote:
> You need to great a DeploymentUnitProcessor that adds the dependency, 
> see any of the DUP's that run in the DEPENDENCIES phase for details 
> (e.g. org.jboss.as.weld.deployment.processors.WeldDependencyProcessor).
>
> Stuart
>
>
> Cheng Fang wrote:
>> I'm trying to integrate javax.batch API (part of EE 7) into WildFly.
>> I've added a couple of batch-related modules, updated build module, and
>> also added javax.batch.api module to javaee.api module's dependency
>> list, hoping that would automatically expose javax.batch to all
>> deployments.  javax.batch is required API in EE 7 full profile.
>>
>> This is how the part of javaee.api module.xml I touched:
>>
>> <dependencies>
>>           <module name="javax.activation.api" export="true"/>
>>           <module name="javax.annotation.api" export="true"/>
>>           <module name="javax.batch.api" export="true"/>
>>           <module name="javax.ejb.api" export="true"/>
>> ...
>>
>> When deploying a webapp that uses javax.batch, I'm still seeing class
>> not found errors from Weld (these batch classes are annotated with 
>> @Named)
>>
>> Is there anything else I need to change to make javax.batch classes
>> available to all deployments?
>>
>> Thanks for the help.
>>
>> java.lang.LinkageError: Failed to link
>> com/ibm/jbatch/tck/artifacts/specialized/StartLimitStateMachineVariation1Batchlet 
>>
>> (Module
>> "deployment.jslxml_web_vehicle.ear.jslxml_web_vehicle_web.war:main" from
>> Service Module Loader)
>>       at
>> org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:427) 
>>
>> [jboss-modules.jar:1.2.2.Final]
>>       at
>> org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:260) 
>>
>> [jboss-modules.jar:1.2.2.Final]
>>       at
>> org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:75) 
>>
>> [jboss-modules.jar:1.2.2.Final]
>>       at org.jboss.modules.Module.loadModuleClass(Module.java:526)
>> [jboss-modules.jar:1.2.2.Final]
>>       at
>> org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:188) 
>> [jboss-modules.jar:1.2.2.Final]
>>       at
>> org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) 
>>
>> [jboss-modules.jar:1.2.2.Final]
>>       at
>> org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) 
>>
>> [jboss-modules.jar:1.2.2.Final]
>>       at
>> org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) 
>>
>> [jboss-modules.jar:1.2.2.Final]
>>       at
>> org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) 
>>
>> [jboss-modules.jar:1.2.2.Final]
>>       at java.lang.Class.getEnclosingMethod0(Native Method) 
>> [rt.jar:1.7.0_25]
>>       at java.lang.Class.getEnclosingMethodInfo(Class.java:959)
>> [rt.jar:1.7.0_25]
>>       at java.lang.Class.getEnclosingConstructor(Class.java:1035)
>> [rt.jar:1.7.0_25]
>>       at
>> org.jboss.weld.util.reflection.Reflections.isNonStaticInnerClass(Reflections.java:388) 
>>
>> [weld-core-impl-2.0.1.Final.jar:2013-06-03 10:29]
>>       at
>> org.jboss.weld.util.Beans.isTypeManagedBeanOrDecoratorOrInterceptor(Beans.java:503) 
>>
>> [weld-core-impl-2.0.1.Final.jar:2013-06-03 10:29]
>>       at
>> org.jboss.weld.bootstrap.BeanDeployer.createClassBean(BeanDeployer.java:226) 
>>
>> [weld-core-impl-2.0.1.Final.jar:2013-06-03 10:29]
>>       at
>> org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:74) 
>>
>> [weld-core-impl-2.0.1.Final.jar:2013-06-03 10:29]
>>       at
>> org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:72) 
>>
>> [weld-core-impl-2.0.1.Final.jar:2013-06-03 10:29]
>>       at
>> org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60) 
>>
>> [weld-core-impl-2.0.1.Final.jar:2013-06-03 10:29]
>>       at
>> org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53) 
>>
>> [weld-core-impl-2.0.1.Final.jar:2013-06-03 10:29]
>>       at
>> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>> [rt.jar:1.7.0_25]
>>       at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>> [rt.jar:1.7.0_25]
>>       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.lang.NoClassDefFoundError: 
>> javax/batch/api/AbstractBatchlet
>>       at java.lang.ClassLoader.defineClass1(Native Method) 
>> [rt.jar:1.7.0_25]
>>       at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
>> [rt.jar:1.7.0_25]
>>       at
>> org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:344) 
>>
>> [jboss-modules.jar:1.2.2.Final]
>>       at
>> org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:422) 
>>
>> [jboss-modules.jar:1.2.2.Final]
>>       ... 23 more
>> Caused by: java.lang.ClassNotFoundException:
>> javax.batch.api.AbstractBatchlet from [Module
>> "deployment.jslxml_web_vehicle.ear.jslxml_web_vehicle_web.war:main" from
>> Service Module Loader]
>>       at
>> org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) 
>> [jboss-modules.jar:1.2.2.Final]
>>       at
>> org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) 
>>
>> [jboss-modules.jar:1.2.2.Final]
>>       at
>> org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) 
>>
>> [jboss-modules.jar:1.2.2.Final]
>>       at
>> org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) 
>>
>> [jboss-modules.jar:1.2.2.Final]
>>       at
>> org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) 
>>
>> [jboss-modules.jar:1.2.2.Final]
>> _______________________________________________
>> wildfly-dev mailing list
>> wildfly-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/wildfly-dev



More information about the wildfly-dev mailing list