[JBoss JIRA] (WELD-1146) CLONE - CDI, Unsatisfied dependencies for generic type arrays
by Marek Schmidt (JIRA)
Marek Schmidt created WELD-1146:
-----------------------------------
Summary: CLONE - CDI, Unsatisfied dependencies for generic type arrays
Key: WELD-1146
URL: https://issues.jboss.org/browse/WELD-1146
Project: Weld
Issue Type: Bug
Components: Bootstrap and Metamodel API
Affects Versions: 1.1.8.Final
Environment: JBoss AS 7.1.2.Final
Reporter: Marek Schmidt
Assignee: Ales Justin
The following set of beans fail to deploy with
{code}
public class Bar<X>
{
public Bar(X x) {
this.x = x;
}
public X x;
}
{code}
{code}
public class BarsProducer
{
private static Bar<Integer>[] bars = new Bar[]{new Bar<Integer>(new Integer(1))};
@Produces
public Bar<Integer>[] getBars() {
return bars;
}
}
{code}
{code}
public class Foo
{
@Inject Bar<Integer>[] field;
}
{code}
{noformat}
14:23:47,915 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."jboss-as-helloworld.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."jboss-as-helloworld.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Bar[]] with qualifiers [@Default] at injection point [[field] @Inject org.jboss.as.quickstarts.helloworld.Foo.field]
at org.jboss.as.weld.services.WeldService.start(WeldService.java:83)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Bar[]] with qualifiers [@Default] at injection point [[field] @Inject org.jboss.as.quickstarts.helloworld.Foo.field]
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:311)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:280)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:143)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:163)
at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:382)
at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:367)
at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:380)
at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83)
at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)
... 5 more
{noformat}
Also note that the src/test/java/org/jboss/weld/tests/arrays/ArrayInjectionTest.java will fail if @Inject is used to inject the arrays instead of the arquillian enrichment.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 7 months
[JBoss JIRA] (WELD-1133) Session EJB deployment failure
by Joseph Snyder (JIRA)
Joseph Snyder created WELD-1133:
-----------------------------------
Summary: Session EJB deployment failure
Key: WELD-1133
URL: https://issues.jboss.org/browse/WELD-1133
Project: Weld
Issue Type: Bug
Components: GlassFish Integration, Infrastructure
Affects Versions: 1.1.8.Final, 1.1.7.Final, 1.1.6.Final, 1.1.5.Final
Environment: linux
Reporter: Joseph Snyder
Starting with Weld 1.1.5.Final there are several CTS failures when running CTS against GlassFish. One specific test failure is org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.EnterpriseBeanSpecializationIntegrationTest. When the application associated with this test is deployed the deployment fails (see "Deployment Failure" below). I investigated the specs and it appears that weld is expecting the type of the session ejb (Office) to include the interface defined by the session bean that it extends (Building).
The CDI spec states in section "4.3.1 Direct and indirect specialization"
...
Furthermore, X must have all the bean types of Y. If X does not have some bean type of Y, the container automatically detects the problem and treats it as a definition error.
..
However this is in direct violation of the ejb 3.1 specification section 4.9.2.1 Session Bean Superclasses:
...
As an example, the client views exposed by a particular session bean are not inherited by a subclass that also happens to define a session bean.
@Stateless
public class A implements Foo { ... }
@Stateless
public class B extends A implements Bar { ... }
Assuming Foo and Bar are local business interfaces and there is no associated deployment descriptor, session bean A exposes local business interface Foo and session bean B exposes local business interface Bar, but not Foo.
...
Deployment Failure:
[#|2012-05-09T18:19:20.875-0400|SEVERE|44.0|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=12;_ThreadName=Thread-2;|WELD-001511 Specializing bean Session bean [class org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.Office with qualifiers [@Any @Default]; local interfaces are [OfficeLocal] does not have bean type interface org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.BuildingLocal of specialized bean Session bean [class org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.Building with qualifiers [@Any @Default]; local interfaces are [BuildingLocal]
org.glassfish.deployment.common.DeploymentException: WELD-001511 Specializing bean Session bean [class org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.Office with qualifiers [@Any @Default]; local interfaces are [OfficeLocal] does not have bean type interface org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.BuildingLocal of specialized bean Session bean [class org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.Building with qualifiers [@Any @Default]; local interfaces are [BuildingLocal]
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 7 months
[JBoss JIRA] (CDITCK-276) check visibility rules for injected proxies
by Mark Struberg (JIRA)
Mark Struberg created CDITCK-276:
------------------------------------
Summary: check visibility rules for injected proxies
Key: CDITCK-276
URL: https://issues.jboss.org/browse/CDITCK-276
Project: CDI TCK
Issue Type: Enhancement
Security Level: Public (Everyone can see)
Reporter: Mark Struberg
Consider the following situation:
You have an EAR with the following in a shared ejb-jar.xml lib:
public interface X..
and
@Stateless class MyEJB{ private @Inject X; ...
The EAR also contains 2 web applications which have the following implementations of X:
A implements X in webappA
B implements X in webappB
regarding on the webapp, the proxy either points to an instance of A or B
which are NOT castable to each other.
This is basically only possible if we only inject a subclass (or implementation if X is a pure interface) of X as proxy into the shared EJB.
Not sure though how this could be unit tested via the TCK.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months
[JBoss JIRA] (WELD-1141) Bean proxy class has non-varargs method for original varargs method
by Adam Michalik (JIRA)
Adam Michalik created WELD-1141:
-----------------------------------
Summary: Bean proxy class has non-varargs method for original varargs method
Key: WELD-1141
URL: https://issues.jboss.org/browse/WELD-1141
Project: Weld
Issue Type: Bug
Affects Versions: 1.1.8.Final
Reporter: Adam Michalik
Test case:
@RequestScoped
public class TestVarargs {
public void varargsMethod(String... strings) {}
}
public class TestClass {
@Inject
TestVarargs testVarargs;
public void runTest() {
testClass(testVarargs.getClass());
testClass(TestVarargs.class);
}
private void testClass(Class<?> clazz) {
for (Method m : clazz.getMethods()) {
if (m.getName().equals("varargsMethod")) {
System.out.println(clazz + " : " + m + " : " + m.isVarArgs());
}
}
}
}
Prints:
class TestVarargs$Proxy$_$$_WeldClientProxy : public void TestVarargs$Proxy$_$$_WeldClientProxy.varargsMethod(java.lang.String[]) : false
class TestVarargs : public void TestVarargs.varargsMethod(java.lang.String[]) : true
The method generated in Weld proxy class is not a varargs method while the original one was. This breaks proper method lookup in tools that use reflection - in my case it was ZK EL resolver: for ${bean.method('String arg')} where signature is method(String...) there was proper code to handle a varargs call but only if the method was indeed declared as Method.isVarargs(), which was not the case when ${bean} was a Weld proxy.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months
[JBoss JIRA] (WELD-1135) Investigate faster ways of performing type safe resolution
by Stuart Douglas (JIRA)
Stuart Douglas created WELD-1135:
------------------------------------
Summary: Investigate faster ways of performing type safe resolution
Key: WELD-1135
URL: https://issues.jboss.org/browse/WELD-1135
Project: Weld
Issue Type: Bug
Reporter: Stuart Douglas
Fix For: 1.2.0.CR1
At the moment quite a lot of bootstrap time is spent resolving injection points and events. By far the majority of this time is spent resolving container events that form part of the portable extensions SPI. As these events are parameterised types the resolution cannot be cached (as ProcessAnnotatedType<ClassA> can resolve differently to ProcessAnnotatedType<ClassB> ).
We should investigate if there is a faster way to do this, if not in the general case then at least for these container events.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months