-
1. Re: CDI producer in module
ctomc Mar 13, 2013 9:38 AM (in response to benjaminprevot)Hi,
how did you prepare module?
does it contain jandex index?
--
tomaz
-
2. Re: CDI producer in module
benjaminprevot Mar 14, 2013 2:46 AM (in response to ctomc)Hi,
The module is a simple JAR copied in the %JBOSS_EAP%/modules/system/layers/base/my/test/main folder with a module.xml file.
What is a jandex index ?
If you mean the .jar.index file, yes, the file is in the module folder.
I have attached a sample.
-
test.zip 7.0 KB
-
-
3. Re: CDI producer in module
brian.stansberry Mar 13, 2013 6:15 PM (in response to benjaminprevot)1 of 1 people found this helpfulTwo suggestions regarding module placement:
1) Don't put it in modules/system/layers/base, as that is for modules that ship with EAP. End user-provided modules can remain simply under modules/.
2) The string format for the id of a module is dot.separated.name[:slot]. The :slot part is optional in the string form, with a default 'slot' of "main" assumed if not provided. However, the filesystem path to the root of the module requires the full name and slot. So, the path to the root of your module would be %JBOSS_EAP%/modules/my/test/main.
-
4. Re: CDI producer in module
brian.stansberry Mar 13, 2013 6:16 PM (in response to brian.stansberry)Note that putting it under modules/system/layers/base wouldn't prevent it working; it's just not the intended way to do it. The key part is including "main" in the filesystem path.
-
5. Re: CDI producer in module
benjaminprevot Mar 14, 2013 2:49 AM (in response to brian.stansberry)Hello Brian,
I forgot to copy/paste the main folder for the module.
In fact, it exists (I have updated my message).
I have tested with the module directly deployed in modules (%JBOSS_EAP%/modules/my/test/main) but same result
-
6. Re: CDI producer in module
brian.stansberry Mar 14, 2013 1:45 PM (in response to benjaminprevot)I'm not an expert in this particular feature, but your module packaging sounds fine. You describe adding Dependencies to MANIFEST.MF as well.
Here's a link to a test case that was added as part of the commit for AS7-4567. Perhaps you'll notice a difference between what's done there and what you're doing. The deploy2() method is what creates the test deployment. It builds a jar (using shrinkwrap but that's irrelevant) that packages up the deployment's classes, beans.xml and a MANIFEST.MF with contents "Dependencies: org.jboss.test.weldModule meta-inf".
-
7. Re: CDI producer in module
benjaminprevot Mar 15, 2013 3:01 AM (in response to brian.stansberry)Brian, you're the best
I didn't noticed the meta-inf information in the Dependencies attribute when looking for a solution.
That's the key.
I have added it, and it works fine.
To sum up, here is the configuration:
Module
- Create a module with CDI producer
- Add META-INF/beans.xml file in it
- Deploy it in %JBOSS_EAP%/modules/my/module/main with the module.xml file
Application
- Add Dependencies: my.module meta-inf in MANIFEST.MF
- Deploy in JBoss EAP
- Run
Thanks a lot for your help.