[JBoss JIRA] (ARQ-1943) Deployment fails with WELD >= 2.2.5.Final because of duplicate CDI beans when beans inside a dependent JAR.
by Chris Rankin (JIRA)
[ https://issues.jboss.org/browse/ARQ-1943?page=com.atlassian.jira.plugin.s... ]
Chris Rankin edited comment on ARQ-1943 at 4/18/15 7:15 PM:
------------------------------------------------------------
I've been experimenting with the versions of various dependencies inside my example project, and I have discovered that Arquillian works fine with WELD <= 2.2.4.Final:
{code}
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/chris/.m2/repository/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/chris/Programs/omnifone/arquillian-test/test-servlet/target/tomcat7-embedded/webapps/ROOT/WEB-INF/lib/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
00:05:43.774 localhost-startStop-1 INFO o.j.w.e.s.EnhancedListener - Initialize Weld using ServletContainerInitializer
00:05:43.795 localhost-startStop-1 INFO org.jboss.weld.Version - WELD-000900: 2.2.4 (Final)
00:05:43.962 localhost-startStop-1 INFO org.jboss.weld.Bootstrap - WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
00:05:44.085 localhost-startStop-1 WARN org.jboss.weld.Interceptor - WELD-001700: Interceptor annotation class javax.ejb.PostActivate not found, interception based on it is not enabled
00:05:44.086 localhost-startStop-1 WARN org.jboss.weld.Interceptor - WELD-001700: Interceptor annotation class javax.ejb.PrePassivate not found, interception based on it is not enabled
00:05:44.291 localhost-startStop-1 INFO o.j.w.e.tomcat.TomcatContainer - Tomcat 7+ detected, CDI injection will be available in Servlets, Filters and Listeners.
00:05:44.437 localhost-startStop-1 INFO o.j.w.e.servlet.Listener - org.jboss.weld.environment.servlet.EnhancedListener used for ServletContext notifications
00:05:44.437 localhost-startStop-1 INFO o.j.w.e.s.EnhancedListener - org.jboss.weld.environment.servlet.Listener used for ServletRequest and HttpSession notifications
Apr 19, 2015 12:05:44 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /home/chris/Programs/omnifone/arquillian-test/test-servlet/target/tomcat7-embedded/webapps/ROOT.war has finished in 1,582 ms
00:05:45.964 http-bio-8084-exec-9 INFO org.testing.web.TroubleServlet - Look: Here comes trouble!
event: org.jboss.arquillian.container.spi.event.container.BeforeStop@51a42578
d: _DEFAULT_
{code}
The problem appears with WELD >= 2.2.5.Final:
{code}
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/chris/.m2/repository/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/chris/Programs/omnifone/arquillian-test/test-servlet/target/tomcat7-embedded/webapps/ROOT/WEB-INF/lib/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
00:10:14.508 localhost-startStop-1 INFO o.j.w.e.servletWeldServlet - WELD-ENV-001008: Initialize Weld using ServletContainerInitializer
00:10:14.521 localhost-startStop-1 INFO org.jboss.weld.Version - WELD-000900: 2.2.5 (Final)
00:10:14.537 localhost-startStop-1 INFO org.jboss.weld.Bootstrap - WELD-ENV-000020: Using jandex for bean discovery
00:10:14.613 localhost-startStop-1 WARN o.j.w.e.servletWeldServlet - WELD-ENV-001004: Found both WEB-INF/beans.xml and WEB-INF/classes/META-INF/beans.xml. It's not portable to use both locations at the same time. Weld is going to use jndi:/localhost/WEB-INF/beans.xml.
00:10:14.709 localhost-startStop-1 INFO org.jboss.weld.Bootstrap - WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
00:10:14.799 localhost-startStop-1 WARN org.jboss.weld.Interceptor - WELD-001700: Interceptor annotation class javax.ejb.PostActivate not found, interception based on it is not enabled
00:10:14.800 localhost-startStop-1 WARN org.jboss.weld.Interceptor - WELD-001700: Interceptor annotation class javax.ejb.PrePassivate not found, interception based on it is not enabled
00:10:14.951 localhost-startStop-1 INFO o.j.w.e.servletTomcat - WELD-ENV-001100: Tomcat 7+ detected, CDI injection will be available in Servlets, Filters and Listeners.
00:10:15.096 localhost-startStop-1 INFO o.j.w.e.servletWeldServlet - WELD-ENV-001006: org.jboss.weld.environment.servlet.EnhancedListener used for ServletContext notifications
00:10:15.096 localhost-startStop-1 INFO o.j.w.e.servletWeldServlet - WELD-ENV-001009: org.jboss.weld.environment.servlet.Listener used for ServletRequest and HttpSession notifications
Apr 19, 2015 12:10:15 AM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet Trouble as unavailable
Apr 19, 2015 12:10:15 AM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet threw load() exception
org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type String with qualifiers @Trouble
at injection point [BackedAnnotatedField] @Trouble @Inject private org.testing.web.TroubleServlet.trouble
at org.testing.web.TroubleServlet.trouble(TroubleServlet.java:0)
Possible dependencies:
- Producer Method [String] with qualifiers [@Trouble @Any] declared as [[BackedAnnotatedMethod] @Produces @Trouble org.testing.TroubleMaker.getTrouble()],
- Producer Method [String] with qualifiers [@Trouble @Any] declared as [[BackedAnnotatedMethod] @Produces @Trouble org.testing.TroubleMaker.getTrouble()]
{code}
However, I must stress that Maven's WAR artifact deploys fine with WELD 2.2.5.Final inside Tomcat 7.0.52. It is only the Arquillian deployment which begins to fail.
was (Author: chrisjr):
I've been experimenting with the versions of various dependencies inside my example project, and I have discovered that it works fine with WELD <= 2.2.4.Final:
{code}
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/chris/.m2/repository/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/chris/Programs/omnifone/arquillian-test/test-servlet/target/tomcat7-embedded/webapps/ROOT/WEB-INF/lib/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
00:05:43.774 localhost-startStop-1 INFO o.j.w.e.s.EnhancedListener - Initialize Weld using ServletContainerInitializer
00:05:43.795 localhost-startStop-1 INFO org.jboss.weld.Version - WELD-000900: 2.2.4 (Final)
00:05:43.962 localhost-startStop-1 INFO org.jboss.weld.Bootstrap - WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
00:05:44.085 localhost-startStop-1 WARN org.jboss.weld.Interceptor - WELD-001700: Interceptor annotation class javax.ejb.PostActivate not found, interception based on it is not enabled
00:05:44.086 localhost-startStop-1 WARN org.jboss.weld.Interceptor - WELD-001700: Interceptor annotation class javax.ejb.PrePassivate not found, interception based on it is not enabled
00:05:44.291 localhost-startStop-1 INFO o.j.w.e.tomcat.TomcatContainer - Tomcat 7+ detected, CDI injection will be available in Servlets, Filters and Listeners.
00:05:44.437 localhost-startStop-1 INFO o.j.w.e.servlet.Listener - org.jboss.weld.environment.servlet.EnhancedListener used for ServletContext notifications
00:05:44.437 localhost-startStop-1 INFO o.j.w.e.s.EnhancedListener - org.jboss.weld.environment.servlet.Listener used for ServletRequest and HttpSession notifications
Apr 19, 2015 12:05:44 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /home/chris/Programs/omnifone/arquillian-test/test-servlet/target/tomcat7-embedded/webapps/ROOT.war has finished in 1,582 ms
00:05:45.964 http-bio-8084-exec-9 INFO org.testing.web.TroubleServlet - Look: Here comes trouble!
event: org.jboss.arquillian.container.spi.event.container.BeforeStop@51a42578
d: _DEFAULT_
{code}
The problem appears with WELD >= 2.2.5.Final:
{code}
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/chris/.m2/repository/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/chris/Programs/omnifone/arquillian-test/test-servlet/target/tomcat7-embedded/webapps/ROOT/WEB-INF/lib/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
00:10:14.508 localhost-startStop-1 INFO o.j.w.e.servletWeldServlet - WELD-ENV-001008: Initialize Weld using ServletContainerInitializer
00:10:14.521 localhost-startStop-1 INFO org.jboss.weld.Version - WELD-000900: 2.2.5 (Final)
00:10:14.537 localhost-startStop-1 INFO org.jboss.weld.Bootstrap - WELD-ENV-000020: Using jandex for bean discovery
00:10:14.613 localhost-startStop-1 WARN o.j.w.e.servletWeldServlet - WELD-ENV-001004: Found both WEB-INF/beans.xml and WEB-INF/classes/META-INF/beans.xml. It's not portable to use both locations at the same time. Weld is going to use jndi:/localhost/WEB-INF/beans.xml.
00:10:14.709 localhost-startStop-1 INFO org.jboss.weld.Bootstrap - WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
00:10:14.799 localhost-startStop-1 WARN org.jboss.weld.Interceptor - WELD-001700: Interceptor annotation class javax.ejb.PostActivate not found, interception based on it is not enabled
00:10:14.800 localhost-startStop-1 WARN org.jboss.weld.Interceptor - WELD-001700: Interceptor annotation class javax.ejb.PrePassivate not found, interception based on it is not enabled
00:10:14.951 localhost-startStop-1 INFO o.j.w.e.servletTomcat - WELD-ENV-001100: Tomcat 7+ detected, CDI injection will be available in Servlets, Filters and Listeners.
00:10:15.096 localhost-startStop-1 INFO o.j.w.e.servletWeldServlet - WELD-ENV-001006: org.jboss.weld.environment.servlet.EnhancedListener used for ServletContext notifications
00:10:15.096 localhost-startStop-1 INFO o.j.w.e.servletWeldServlet - WELD-ENV-001009: org.jboss.weld.environment.servlet.Listener used for ServletRequest and HttpSession notifications
Apr 19, 2015 12:10:15 AM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet Trouble as unavailable
Apr 19, 2015 12:10:15 AM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet threw load() exception
org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type String with qualifiers @Trouble
at injection point [BackedAnnotatedField] @Trouble @Inject private org.testing.web.TroubleServlet.trouble
at org.testing.web.TroubleServlet.trouble(TroubleServlet.java:0)
Possible dependencies:
- Producer Method [String] with qualifiers [@Trouble @Any] declared as [[BackedAnnotatedMethod] @Produces @Trouble org.testing.TroubleMaker.getTrouble()],
- Producer Method [String] with qualifiers [@Trouble @Any] declared as [[BackedAnnotatedMethod] @Produces @Trouble org.testing.TroubleMaker.getTrouble()]
{code}
However, I must stress that Maven's WAR artifact deploys fine with WELD 2.2.5.Final inside Tomcat 7.0.52. It is only the Arquillian deployment which begins to fail.
> Deployment fails with WELD >= 2.2.5.Final because of duplicate CDI beans when beans inside a dependent JAR.
> -----------------------------------------------------------------------------------------------------------
>
> Key: ARQ-1943
> URL: https://issues.jboss.org/browse/ARQ-1943
> Project: Arquillian
> Issue Type: Bug
> Components: Tomcat Containers
> Affects Versions: tomcat_1.0.0.CR7
> Environment: Windows 7 x64, Linux x64, JDK7
> Reporter: Chris Rankin
> Attachments: arquillian-test.tar.xz
>
>
> Using arquillian-tomcat-embedded-7, arquillian-bom 1.1.7.Final, WELD 2.2.10.Final:
> I have created a simple WAR file that contains WELD and a single servlet. There is also a dependent JAR that contains the following:
> - a @Dependent bean with a @Produces method
> - a META-INF/beans.xml file.
> When I try to test this servlet using Arquillian's TestNG container, the deployment fails with this error:
> SEVERE: Servlet threw load() exception
> org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type String with qualifiers @Trouble
> at injection point [BackedAnnotatedField] @Trouble @Inject private org.testing.web.TroubleServlet.trouble
> at org.testing.web.TroubleServlet.trouble(TroubleServlet.java:0)
> Possible dependencies:
> - Producer Method [String] with qualifiers [@Trouble @Any] declared as [[BackedAnnotatedMethod] @Produces @Trouble org.testing.TroubleMaker.getTrouble()],
> - Producer Method [String] with qualifiers [@Trouble @Any] declared as [[BackedAnnotatedMethod] @Produces @Trouble org.testing.TroubleMaker.getTrouble()]
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years
[JBoss JIRA] (ARQ-1943) Deployment fails with WELD >= 2.2.5.Final because of duplicate CDI beans when beans inside a dependent JAR.
by Chris Rankin (JIRA)
[ https://issues.jboss.org/browse/ARQ-1943?page=com.atlassian.jira.plugin.s... ]
Chris Rankin commented on ARQ-1943:
-----------------------------------
I've been experimenting with the versions of various dependencies inside my example project, and I have discovered that it works fine with WELD <= 2.2.4.Final:
{code}
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/chris/.m2/repository/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/chris/Programs/omnifone/arquillian-test/test-servlet/target/tomcat7-embedded/webapps/ROOT/WEB-INF/lib/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
00:05:43.774 localhost-startStop-1 INFO o.j.w.e.s.EnhancedListener - Initialize Weld using ServletContainerInitializer
00:05:43.795 localhost-startStop-1 INFO org.jboss.weld.Version - WELD-000900: 2.2.4 (Final)
00:05:43.962 localhost-startStop-1 INFO org.jboss.weld.Bootstrap - WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
00:05:44.085 localhost-startStop-1 WARN org.jboss.weld.Interceptor - WELD-001700: Interceptor annotation class javax.ejb.PostActivate not found, interception based on it is not enabled
00:05:44.086 localhost-startStop-1 WARN org.jboss.weld.Interceptor - WELD-001700: Interceptor annotation class javax.ejb.PrePassivate not found, interception based on it is not enabled
00:05:44.291 localhost-startStop-1 INFO o.j.w.e.tomcat.TomcatContainer - Tomcat 7+ detected, CDI injection will be available in Servlets, Filters and Listeners.
00:05:44.437 localhost-startStop-1 INFO o.j.w.e.servlet.Listener - org.jboss.weld.environment.servlet.EnhancedListener used for ServletContext notifications
00:05:44.437 localhost-startStop-1 INFO o.j.w.e.s.EnhancedListener - org.jboss.weld.environment.servlet.Listener used for ServletRequest and HttpSession notifications
Apr 19, 2015 12:05:44 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /home/chris/Programs/omnifone/arquillian-test/test-servlet/target/tomcat7-embedded/webapps/ROOT.war has finished in 1,582 ms
00:05:45.964 http-bio-8084-exec-9 INFO org.testing.web.TroubleServlet - Look: Here comes trouble!
event: org.jboss.arquillian.container.spi.event.container.BeforeStop@51a42578
d: _DEFAULT_
{code}
The problem appears with WELD >= 2.2.5.Final:
{code}
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/chris/.m2/repository/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/chris/Programs/omnifone/arquillian-test/test-servlet/target/tomcat7-embedded/webapps/ROOT/WEB-INF/lib/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
00:10:14.508 localhost-startStop-1 INFO o.j.w.e.servletWeldServlet - WELD-ENV-001008: Initialize Weld using ServletContainerInitializer
00:10:14.521 localhost-startStop-1 INFO org.jboss.weld.Version - WELD-000900: 2.2.5 (Final)
00:10:14.537 localhost-startStop-1 INFO org.jboss.weld.Bootstrap - WELD-ENV-000020: Using jandex for bean discovery
00:10:14.613 localhost-startStop-1 WARN o.j.w.e.servletWeldServlet - WELD-ENV-001004: Found both WEB-INF/beans.xml and WEB-INF/classes/META-INF/beans.xml. It's not portable to use both locations at the same time. Weld is going to use jndi:/localhost/WEB-INF/beans.xml.
00:10:14.709 localhost-startStop-1 INFO org.jboss.weld.Bootstrap - WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
00:10:14.799 localhost-startStop-1 WARN org.jboss.weld.Interceptor - WELD-001700: Interceptor annotation class javax.ejb.PostActivate not found, interception based on it is not enabled
00:10:14.800 localhost-startStop-1 WARN org.jboss.weld.Interceptor - WELD-001700: Interceptor annotation class javax.ejb.PrePassivate not found, interception based on it is not enabled
00:10:14.951 localhost-startStop-1 INFO o.j.w.e.servletTomcat - WELD-ENV-001100: Tomcat 7+ detected, CDI injection will be available in Servlets, Filters and Listeners.
00:10:15.096 localhost-startStop-1 INFO o.j.w.e.servletWeldServlet - WELD-ENV-001006: org.jboss.weld.environment.servlet.EnhancedListener used for ServletContext notifications
00:10:15.096 localhost-startStop-1 INFO o.j.w.e.servletWeldServlet - WELD-ENV-001009: org.jboss.weld.environment.servlet.Listener used for ServletRequest and HttpSession notifications
Apr 19, 2015 12:10:15 AM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet Trouble as unavailable
Apr 19, 2015 12:10:15 AM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet threw load() exception
org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type String with qualifiers @Trouble
at injection point [BackedAnnotatedField] @Trouble @Inject private org.testing.web.TroubleServlet.trouble
at org.testing.web.TroubleServlet.trouble(TroubleServlet.java:0)
Possible dependencies:
- Producer Method [String] with qualifiers [@Trouble @Any] declared as [[BackedAnnotatedMethod] @Produces @Trouble org.testing.TroubleMaker.getTrouble()],
- Producer Method [String] with qualifiers [@Trouble @Any] declared as [[BackedAnnotatedMethod] @Produces @Trouble org.testing.TroubleMaker.getTrouble()]
{code}
However, I must stress that Maven's WAR artifact deploys fine with WELD 2.2.5.Final inside Tomcat 7.0.52. It is only the Arquillian deployment which begins to fail.
> Deployment fails with WELD >= 2.2.5.Final because of duplicate CDI beans when beans inside a dependent JAR.
> -----------------------------------------------------------------------------------------------------------
>
> Key: ARQ-1943
> URL: https://issues.jboss.org/browse/ARQ-1943
> Project: Arquillian
> Issue Type: Bug
> Components: Tomcat Containers
> Affects Versions: tomcat_1.0.0.CR7
> Environment: Windows 7 x64, Linux x64, JDK7
> Reporter: Chris Rankin
> Attachments: arquillian-test.tar.xz
>
>
> Using arquillian-tomcat-embedded-7, arquillian-bom 1.1.7.Final, WELD 2.2.10.Final:
> I have created a simple WAR file that contains WELD and a single servlet. There is also a dependent JAR that contains the following:
> - a @Dependent bean with a @Produces method
> - a META-INF/beans.xml file.
> When I try to test this servlet using Arquillian's TestNG container, the deployment fails with this error:
> SEVERE: Servlet threw load() exception
> org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type String with qualifiers @Trouble
> at injection point [BackedAnnotatedField] @Trouble @Inject private org.testing.web.TroubleServlet.trouble
> at org.testing.web.TroubleServlet.trouble(TroubleServlet.java:0)
> Possible dependencies:
> - Producer Method [String] with qualifiers [@Trouble @Any] declared as [[BackedAnnotatedMethod] @Produces @Trouble org.testing.TroubleMaker.getTrouble()],
> - Producer Method [String] with qualifiers [@Trouble @Any] declared as [[BackedAnnotatedMethod] @Produces @Trouble org.testing.TroubleMaker.getTrouble()]
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years
[JBoss JIRA] (ARQ-1943) Deployment fails with WELD >= 2.2.5.Final because of duplicate CDI beans when beans inside a dependent JAR.
by Chris Rankin (JIRA)
[ https://issues.jboss.org/browse/ARQ-1943?page=com.atlassian.jira.plugin.s... ]
Chris Rankin updated ARQ-1943:
------------------------------
Summary: Deployment fails with WELD >= 2.2.5.Final because of duplicate CDI beans when beans inside a dependent JAR. (was: Deployment fails because of duplicate CDI beans when beans inside a dependent JAR.)
> Deployment fails with WELD >= 2.2.5.Final because of duplicate CDI beans when beans inside a dependent JAR.
> -----------------------------------------------------------------------------------------------------------
>
> Key: ARQ-1943
> URL: https://issues.jboss.org/browse/ARQ-1943
> Project: Arquillian
> Issue Type: Bug
> Components: Tomcat Containers
> Affects Versions: tomcat_1.0.0.CR7
> Environment: Windows 7 x64, Linux x64, JDK7
> Reporter: Chris Rankin
> Attachments: arquillian-test.tar.xz
>
>
> Using arquillian-tomcat-embedded-7, arquillian-bom 1.1.7.Final, WELD 2.2.10.Final:
> I have created a simple WAR file that contains WELD and a single servlet. There is also a dependent JAR that contains the following:
> - a @Dependent bean with a @Produces method
> - a META-INF/beans.xml file.
> When I try to test this servlet using Arquillian's TestNG container, the deployment fails with this error:
> SEVERE: Servlet threw load() exception
> org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type String with qualifiers @Trouble
> at injection point [BackedAnnotatedField] @Trouble @Inject private org.testing.web.TroubleServlet.trouble
> at org.testing.web.TroubleServlet.trouble(TroubleServlet.java:0)
> Possible dependencies:
> - Producer Method [String] with qualifiers [@Trouble @Any] declared as [[BackedAnnotatedMethod] @Produces @Trouble org.testing.TroubleMaker.getTrouble()],
> - Producer Method [String] with qualifiers [@Trouble @Any] declared as [[BackedAnnotatedMethod] @Produces @Trouble org.testing.TroubleMaker.getTrouble()]
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years
[JBoss JIRA] (ARQ-567) Supporting Test Suites (@ArquillianSuite)
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/ARQ-567?page=com.atlassian.jira.plugin.sy... ]
Aslak Knutsen updated ARQ-567:
------------------------------
Comment: was deleted
(was:
ECCLESIA Clerk
Server: Ibis
-----------------------------------------------------------------------
Andreas Kind
Sehr geehrte Damen und Herren, ich bin bis zum 19.04.2015 einschließlich
nicht erreichbar. Ihre E-Mail wird bis dahin archiviert. Mit freundlichen
Grüßen,
)
> Supporting Test Suites (@ArquillianSuite)
> -----------------------------------------
>
> Key: ARQ-567
> URL: https://issues.jboss.org/browse/ARQ-567
> Project: Arquillian
> Issue Type: Feature Request
> Reporter: Mousavi Jahan Abadi S. M.
> Assignee: Aslak Knutsen
> Fix For: 1.2.0.Alpha1
>
>
> Currently, it is supported that JUnit test cases being run by Arquillian. This feature request is request for supporting test suites too to be run by Arquillian too. Idea is like:
> @RunWith(ArquillianSuite.class)
> @Suite.SuiteClasses( { TestCase1.class, TestCase2.class, .... } )
> public class AllTests{
> @Deployment
> public static JavaArchive createTestArchive(){
> return ShrinkWrap.create(JavaArchive.class,"test.jar");
> }
> }
> The advantages of above approach for users of Arquillian framework are:
> - Test cases don't needed to be modified to have: "@RunWith(Arquillian.class)" annotation. In other words, test cases will be pure JUnit code, and no Arquillian code (results in less coding for end users).
> - It is not necessary to include the static "@Deployment" methods in all test cases any more, and only Test Suite need to define the archieving/deployment related setting/definitions.
> The advantage of above approach for framework itself is:
> - From performance point-of-view, it becomes possible for Arquillian to deploy all test cases in the Test Suite into J2EE container in one action (one deploy/undeploy for one test suite, instead of mulitple deploy/undeploy for each test case).
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years
[JBoss JIRA] (ARQ-567) Supporting Test Suites (@ArquillianSuite)
by Andy K (JIRA)
[ https://issues.jboss.org/browse/ARQ-567?page=com.atlassian.jira.plugin.sy... ]
Andy K updated ARQ-567:
-----------------------
ECCLESIA Clerk
Server: Ibis
-----------------------------------------------------------------------
Andreas Kind
Sehr geehrte Damen und Herren, ich bin bis zum 19.04.2015 einschließlich
nicht erreichbar. Ihre E-Mail wird bis dahin archiviert. Mit freundlichen
Grüßen,
> Supporting Test Suites (@ArquillianSuite)
> -----------------------------------------
>
> Key: ARQ-567
> URL: https://issues.jboss.org/browse/ARQ-567
> Project: Arquillian
> Issue Type: Feature Request
> Reporter: Mousavi Jahan Abadi S. M.
> Assignee: Aslak Knutsen
> Fix For: 1.2.0.Alpha1
>
>
> Currently, it is supported that JUnit test cases being run by Arquillian. This feature request is request for supporting test suites too to be run by Arquillian too. Idea is like:
> @RunWith(ArquillianSuite.class)
> @Suite.SuiteClasses( { TestCase1.class, TestCase2.class, .... } )
> public class AllTests{
> @Deployment
> public static JavaArchive createTestArchive(){
> return ShrinkWrap.create(JavaArchive.class,"test.jar");
> }
> }
> The advantages of above approach for users of Arquillian framework are:
> - Test cases don't needed to be modified to have: "@RunWith(Arquillian.class)" annotation. In other words, test cases will be pure JUnit code, and no Arquillian code (results in less coding for end users).
> - It is not necessary to include the static "@Deployment" methods in all test cases any more, and only Test Suite need to define the archieving/deployment related setting/definitions.
> The advantage of above approach for framework itself is:
> - From performance point-of-view, it becomes possible for Arquillian to deploy all test cases in the Test Suite into J2EE container in one action (one deploy/undeploy for one test suite, instead of mulitple deploy/undeploy for each test case).
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years
[JBoss JIRA] (ARQ-472) Metadata annotations should not be read directly from the Java Classes
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/ARQ-472?page=com.atlassian.jira.plugin.sy... ]
Aslak Knutsen updated ARQ-472:
------------------------------
Fix Version/s: 1.2.0.Alpha1
(was: 1.1.8.Final)
> Metadata annotations should not be read directly from the Java Classes
> ----------------------------------------------------------------------
>
> Key: ARQ-472
> URL: https://issues.jboss.org/browse/ARQ-472
> Project: Arquillian
> Issue Type: Feature Request
> Components: Base Implementation
> Affects Versions: 1.0.0.Final
> Reporter: Aslak Knutsen
> Fix For: 1.2.0.Alpha1
>
>
> To better support Alternative languages on the JVM we should move away from reading MetaData annotations directly from the Java Classes, instead create a MetaModel indirection that is replaceable and can be implemented to fit specific needs.
> This goes for Metadata Annotations like @RunAsClient, @OperatesOnDeployment, @OperatesOnContainer, @Deployment etc
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years
[JBoss JIRA] (ARQ-1937) Class loading issue with injected deployer
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/ARQ-1937?page=com.atlassian.jira.plugin.s... ]
Aslak Knutsen updated ARQ-1937:
-------------------------------
Fix Version/s: 1.2.0.Alpha1
(was: 1.1.8.Final)
> Class loading issue with injected deployer
> -------------------------------------------
>
> Key: ARQ-1937
> URL: https://issues.jboss.org/browse/ARQ-1937
> Project: Arquillian
> Issue Type: Bug
> Components: Deployable Containers SPI
> Affects Versions: 1.1.1.Final
> Reporter: Martin Gencur
> Fix For: 1.2.0.Alpha1
>
>
> Steps to reproduce:
> 1) inject a Deployer via @ArquillianResource
> 2) declare a deployment as managed=false, use the deployer to deploy artifacts to a managed container
> 3) run a test method that operates on the deployment
> 4) check that classes inside the test method have the same classloader as the test class itself (see the code below where I call cache.getClass().getClassLoader())
> 5) this does not happen when the deployment is managed=true and deployer API is NOT used. In this case, the classes have a different class loader
> In the test below, I tried to load different versions of Infinispan in two deployments and test backward compatibility. However, due to this class loading issue the Infinispan classes are of the latest version regardless of libraries bundled in the WAR. This is probably due to the fact that the Maven test module has the latest Infinispan libraries defined in <dependencies> while the older version is downloaded separately via Maven dependency plugin.
> {code}
> package com.jboss.datagrid.test.backwardcompatibility;
> @RunWith(Arquillian.class)
> public class SingleFileStoreBackwardCompatibilityIT {
> private DefaultCacheManager dfc;
> private String cacheName = "testCache";
> private static final String OLD_ISPN = "dep1_with_old_ispn";
> private static final String NEW_ISPN = "dep2_with_new_ispn";
> private static Map<String, String> storedMap;
> @ArquillianResource
> Deployer deployer;
> @Deployment(name = OLD_ISPN, testable = true, managed = true, order=1)
> @TargetsContainer("container1")
> public static WebArchive createDeploymentOld() {
> WebArchive jar = DeploymentBuilder.createTestArchiveWithPreviousJDG("test1.war", "previous");
> System.out.println("ClassLoader: " + SingleFileStoreBackwardCompatibilityIT.class.getClassLoader());
> return jar;
> }
> @Deployment(name = NEW_ISPN, testable = true, managed = true, order=2)
> @TargetsContainer("container2")
> public static WebArchive createDeploymentNew() {
> WebArchive jar = DeploymentBuilder.createTestArchive("test2.war", "current");
> return jar;
> }
> private DefaultCacheManager configureCacheManager(boolean clearCacheStore) throws Exception {
> GlobalConfiguration glob = new GlobalConfigurationBuilder().nonClusteredDefault()
> .globalJmxStatistics().allowDuplicateDomains(true).
> build();
> ConfigurationBuilder c = new ConfigurationBuilder();
> c.clustering().cacheMode(CacheMode.LOCAL);
> File tmpStore = new File("/tmp/cache/" + cacheName + ".dat");
> if (clearCacheStore && tmpStore.exists()) {
> tmpStore.delete();
> }
> c.persistence().passivation(false).addSingleFileStore().purgeOnStartup(false).location("/tmp/cache/");
> Configuration cnf = c.build();
> DefaultCacheManager manager = new DefaultCacheManager(glob);
> manager.defineConfiguration(cacheName, cnf);
> return manager;
> }
> @Test
> @OperateOnDeployment(OLD_ISPN)
> @InSequence(1)
> public void testStoreWithOldJDG() throws Exception {
> deployer.deploy(OLD_ISPN);
> dfc = configureCacheManager(true);
> dfc.start();
> Cache<Object, Object> cache = dfc.getCache(cacheName);
> System.out.println("Version: " + cache.getVersion());
> System.out.println("ClassLoader: " + cache.getClass().getClassLoader());
> storedMap = new HashMap<String, String>();
> storedMap.put("k", "v");
> cache.put("mapKey", storedMap);
> dfc.stop();
> deployer.undeploy(OLD_ISPN);
> }
> @Test
> @OperateOnDeployment(NEW_ISPN)
> @InSequence(2)
> public void testReadWithNewJDG() throws Exception {
> deployer.deploy(NEW_ISPN);
> dfc = configureCacheManager(false);
> dfc.start();
> Cache<Object, Object> cache = dfc.getCache(cacheName);
> System.out.println("ClassLoader: " + cache.getClass().getClassLoader());
> System.out.println("Version: " + cache.getVersion());
> assertEquals(storedMap, cache.get("mapKey"));
> dfc.stop();
> deployer.undeploy(NEW_ISPN);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years
[JBoss JIRA] (ARQ-567) Supporting Test Suites (@ArquillianSuite)
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/ARQ-567?page=com.atlassian.jira.plugin.sy... ]
Aslak Knutsen updated ARQ-567:
------------------------------
Fix Version/s: 1.2.0.Alpha1
(was: 1.1.8.Final)
> Supporting Test Suites (@ArquillianSuite)
> -----------------------------------------
>
> Key: ARQ-567
> URL: https://issues.jboss.org/browse/ARQ-567
> Project: Arquillian
> Issue Type: Feature Request
> Reporter: Mousavi Jahan Abadi S. M.
> Assignee: Aslak Knutsen
> Fix For: 1.2.0.Alpha1
>
>
> Currently, it is supported that JUnit test cases being run by Arquillian. This feature request is request for supporting test suites too to be run by Arquillian too. Idea is like:
> @RunWith(ArquillianSuite.class)
> @Suite.SuiteClasses( { TestCase1.class, TestCase2.class, .... } )
> public class AllTests{
> @Deployment
> public static JavaArchive createTestArchive(){
> return ShrinkWrap.create(JavaArchive.class,"test.jar");
> }
> }
> The advantages of above approach for users of Arquillian framework are:
> - Test cases don't needed to be modified to have: "@RunWith(Arquillian.class)" annotation. In other words, test cases will be pure JUnit code, and no Arquillian code (results in less coding for end users).
> - It is not necessary to include the static "@Deployment" methods in all test cases any more, and only Test Suite need to define the archieving/deployment related setting/definitions.
> The advantage of above approach for framework itself is:
> - From performance point-of-view, it becomes possible for Arquillian to deploy all test cases in the Test Suite into J2EE container in one action (one deploy/undeploy for one test suite, instead of mulitple deploy/undeploy for each test case).
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years
[JBoss JIRA] (ARQ-1943) Deployment fails because of duplicate CDI beans when beans inside a dependent JAR.
by Chris Rankin (JIRA)
[ https://issues.jboss.org/browse/ARQ-1943?page=com.atlassian.jira.plugin.s... ]
Chris Rankin updated ARQ-1943:
------------------------------
Attachment: arquillian-test.tar.xz
Example project.
> Deployment fails because of duplicate CDI beans when beans inside a dependent JAR.
> ----------------------------------------------------------------------------------
>
> Key: ARQ-1943
> URL: https://issues.jboss.org/browse/ARQ-1943
> Project: Arquillian
> Issue Type: Bug
> Components: Tomcat Containers
> Affects Versions: tomcat_1.0.0.CR7
> Environment: Windows 7 x64, Linux x64, JDK7
> Reporter: Chris Rankin
> Attachments: arquillian-test.tar.xz
>
>
> Using arquillian-tomcat-embedded-7, arquillian-bom 1.1.7.Final, WELD 2.2.10.Final:
> I have created a simple WAR file that contains WELD and a single servlet. There is also a dependent JAR that contains the following:
> - a @Dependent bean with a @Produces method
> - a META-INF/beans.xml file.
> When I try to test this servlet using Arquillian's TestNG container, the deployment fails with this error:
> SEVERE: Servlet threw load() exception
> org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type String with qualifiers @Trouble
> at injection point [BackedAnnotatedField] @Trouble @Inject private org.testing.web.TroubleServlet.trouble
> at org.testing.web.TroubleServlet.trouble(TroubleServlet.java:0)
> Possible dependencies:
> - Producer Method [String] with qualifiers [@Trouble @Any] declared as [[BackedAnnotatedMethod] @Produces @Trouble org.testing.TroubleMaker.getTrouble()],
> - Producer Method [String] with qualifiers [@Trouble @Any] declared as [[BackedAnnotatedMethod] @Produces @Trouble org.testing.TroubleMaker.getTrouble()]
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years