[weld-issues] [JBoss JIRA] Updated: (WELD-940) Possible bug when using <weld:scan>
Ondrej Zizka (JIRA)
jira-events at lists.jboss.org
Sun Jul 10 12:33:23 EDT 2011
[ https://issues.jboss.org/browse/WELD-940?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ondrej Zizka updated WELD-940:
------------------------------
Summary: Possible bug when using <weld:scan> (was: Weird behavior when using weld-servlet.)
Description:
A project has two jars.
One jar contains beans in package `org.jboss.jawabot`.
Other has WEB-INF/beans.xml (used by weld-servlet-core through embedded Jetty), which contains
{code}
<weld:scan>
<weld:include name="org.jboss.jawabot.**"/>
...
{code}
This causes CDI to stop working, giving errors like "Unable to resolve dependency XY" or (after removing this @Inject) this:
{code}
Exception in thread "main" org.jboss.weld.exceptions.DeploymentException: WELD-001417 Enabled interceptor class <class>org.jboss.weld.environment.se.jpa.JpaTransactionInterceptor</class> in jar:file:/mnt/ssd1/data/.m2/repository/org/jboss/jawabot/JawaBot-core/2.0.0-SNAPSHOT/JawaBot-core-2.0.0-SNAPSHOT.jar!/META-INF/beans.xml at 11 is neither annotated @Interceptor nor registered through a portable extension
at org.jboss.weld.bootstrap.Validator.validateEnabledInterceptorClasses(Validator.java:466)
{code}
, despite the class has @Interceptor (and the same class works fine with the other module).
The project is at http://ondrazizka.googlecode.com/svn/trunk/bots/JawaBot/branches/2.0/ rev. 293
To see the error, run mvn dependency:copy-dependencies java -cp ... org.jboss.jawabot.JawaBotApp Or simply run the web module in NetBeans.
was:
In a project which has pluggable modules, with one module, weld works.
When other module, which uses weld-servlet-core, is put on classpath (with it's deps), CDI stops working, giving errors like "Unable to resolve dependency XY" or (after removing this @Inject) this:
Exception in thread "main" org.jboss.weld.exceptions.DeploymentException: WELD-001417 Enabled interceptor class <class>org.jboss.weld.environment.se.jpa.JpaTransactionInterceptor</class> in jar:file:/mnt/ssd1/data/.m2/repository/org/jboss/jawabot/JawaBot-core/2.0.0-SNAPSHOT/JawaBot-core-2.0.0-SNAPSHOT.jar!/META-INF/beans.xml at 11 is neither annotated @Interceptor nor registered through a portable extension
at org.jboss.weld.bootstrap.Validator.validateEnabledInterceptorClasses(Validator.java:466)
Although the class has @Interceptor (and the same class works fine with the other module). I've checked the dependencies and TattleTale report, they all seem fine. Any ideas what should I look at / try?
The project is at http://ondrazizka.googlecode.com/svn/trunk/bots/JawaBot/branches/2.0/ rev. 293
To see the error, run mvn dependency:copy-dependencies java -cp ... org.jboss.jawabot.JawaBotApp Or simply run the web module in NetBeans.
Forum Reference: http://seamframework.org/Community/CDIStopsWorkingWhenUsingWeldsecoreAndWeldservletcore#comment159679 (was: http://seamframework.org/Community/CDIStopsWorkingWhenUsingWeldsecoreAndWeldservletcore#comment159679)
> Possible bug when using <weld:scan>
> -----------------------------------
>
> Key: WELD-940
> URL: https://issues.jboss.org/browse/WELD-940
> Project: Weld
> Issue Type: Bug
> Components: Interceptors and Decorators
> Affects Versions: 1.1.1.Final
> Environment: Java SE application with weld-se-core, and a module with embedded jetty hosting a servlet using weld-servlet-core
> Reporter: Ondrej Zizka
>
> A project has two jars.
> One jar contains beans in package `org.jboss.jawabot`.
> Other has WEB-INF/beans.xml (used by weld-servlet-core through embedded Jetty), which contains
> {code}
> <weld:scan>
> <weld:include name="org.jboss.jawabot.**"/>
> ...
> {code}
> This causes CDI to stop working, giving errors like "Unable to resolve dependency XY" or (after removing this @Inject) this:
> {code}
> Exception in thread "main" org.jboss.weld.exceptions.DeploymentException: WELD-001417 Enabled interceptor class <class>org.jboss.weld.environment.se.jpa.JpaTransactionInterceptor</class> in jar:file:/mnt/ssd1/data/.m2/repository/org/jboss/jawabot/JawaBot-core/2.0.0-SNAPSHOT/JawaBot-core-2.0.0-SNAPSHOT.jar!/META-INF/beans.xml at 11 is neither annotated @Interceptor nor registered through a portable extension
> at org.jboss.weld.bootstrap.Validator.validateEnabledInterceptorClasses(Validator.java:466)
> {code}
> , despite the class has @Interceptor (and the same class works fine with the other module).
> The project is at http://ondrazizka.googlecode.com/svn/trunk/bots/JawaBot/branches/2.0/ rev. 293
> To see the error, run mvn dependency:copy-dependencies java -cp ... org.jboss.jawabot.JawaBotApp Or simply run the web module in NetBeans.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the weld-issues
mailing list