[weld-issues] [JBoss JIRA] Commented: (WELD-870) Add injection point information to exception message when injection into observer fails

2011-03-23 Thread Dan Allen (JIRA)

[ 
https://issues.jboss.org/browse/WELD-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=1259#comment-1259
 ] 

Dan Allen commented on WELD-870:


This Arquillian test proves that injection points on observer methods are not 
validated on startup (I'm assuming the same goes for producer methods).

{code:java}
public class Observer {
// there is no bean for File
public void observe(@Observes String event, File file) {}
}
{code}

{code:java}
@RunWith(Arquillian.class)
public class ObserverMethodParameterInjectionValidationTest {
@Deployment
public static JavaArchive getDeployment() {
return ShrinkWrap.create(JavaArchive.class, test.jar)
.addManifestResource(EmptyAsset.INSTANCE, beans.xml)
.addClass(Observer.class);
}

@Test
public void testDeployment() {
Assert.fail(Excepted deployment error:  +
   'Unsatisfied dependencies for type [File] with qualifiers 
[@Default] on observer method injection point');
}

/**
 * This test should not run, but if it does, it shows Weld reporting the 
ambiguous error in WELD-870:
 * WELD-001324 Argument bean must not be null
 */
@Test
public void testNullInjectionOnObserverMethod(BeanManager beanManager) {
beanManager.fireEvent(message);
}
}
{code}

 Add injection point information to exception message when injection into 
 observer fails
 ---

 Key: WELD-870
 URL: https://issues.jboss.org/browse/WELD-870
 Project: Weld
  Issue Type: Enhancement
  Components: Events
Affects Versions: 1.1.0.Final
Reporter: Dan Allen

 Injections that fail when an observer method is invoked are massively hard to 
 track down. Here's the information you get:
 org.jboss.weld.exceptions.IllegalArgumentException: WELD-001324 Argument bean 
 must not be null
at 
 org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:714)
at 
 org.jboss.seam.exception.control.HandlerMethodImpl.notify(HandlerMethodImpl.java:187)
at 
 org.jboss.seam.exception.control.ExceptionHandlerDispatch.executeHandlers(ExceptionHandlerDispatch.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at 
 org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
at 
 org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
at 
 org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
at 
 org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
at 
 org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
at 
 org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
at 
 org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
at 
 org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:270)
at 
 org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
at 
 org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:222)
at 
 org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:632)
at 
 org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:619)
at 
 org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:613)
 I expect to see the type and qualifiers at the failing injection point. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
___
weld-issues mailing list
weld-issues@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-issues


[weld-issues] [JBoss JIRA] Commented: (WELD-870) Add injection point information to exception message when injection into observer fails

2011-03-23 Thread Dan Allen (JIRA)

[ 
https://issues.jboss.org/browse/WELD-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12591112#comment-12591112
 ] 

Dan Allen commented on WELD-870:


Arquillian 1.0.0.Alpha5 supports assertions for deployment errors.

 Add injection point information to exception message when injection into 
 observer fails
 ---

 Key: WELD-870
 URL: https://issues.jboss.org/browse/WELD-870
 Project: Weld
  Issue Type: Enhancement
  Components: Events
Affects Versions: 1.1.0.Final
Reporter: Dan Allen

 Injections that fail when an observer method is invoked are massively hard to 
 track down. Here's the information you get:
 org.jboss.weld.exceptions.IllegalArgumentException: WELD-001324 Argument bean 
 must not be null
at 
 org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:714)
at 
 org.jboss.seam.exception.control.HandlerMethodImpl.notify(HandlerMethodImpl.java:187)
at 
 org.jboss.seam.exception.control.ExceptionHandlerDispatch.executeHandlers(ExceptionHandlerDispatch.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at 
 org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
at 
 org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
at 
 org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
at 
 org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
at 
 org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
at 
 org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
at 
 org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
at 
 org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:270)
at 
 org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
at 
 org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:222)
at 
 org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:632)
at 
 org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:619)
at 
 org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:613)
 I expect to see the type and qualifiers at the failing injection point. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
___
weld-issues mailing list
weld-issues@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-issues


[weld-issues] [JBoss JIRA] Commented: (WELD-80) Passivation of stateful session beans results in a loss of reference to injected object

2011-03-23 Thread Pete Muir (JIRA)

[ 
https://issues.jboss.org/browse/WELD-80?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12591127#comment-12591127
 ] 

Pete Muir commented on WELD-80:
---

Should still just work I think without any spec language, but would be worth 
testing...

Did you take a look at our test, can you enhance it to show your issue? Or add 
another one? If you set the timeouts very low (there are annotations for the 
passivation timeout) and use a thread.sleep it should work (albeit it is very 
fragile).

 Passivation of stateful session beans results in a loss of reference to 
 injected object
 ---

 Key: WELD-80
 URL: https://issues.jboss.org/browse/WELD-80
 Project: Weld
  Issue Type: Bug
  Components: Scopes  Contexts
 Environment: JBoss AS 5.1
Reporter: John Ament
 Fix For: TBC

 Attachments: statefulpassivate.zip


 See forum post

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
___
weld-issues mailing list
weld-issues@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-issues


[weld-issues] [JBoss JIRA] Assigned: (WELD-870) Add injection point information to exception message when injection into observer fails

2011-03-23 Thread Stuart Douglas (JIRA)

 [ 
https://issues.jboss.org/browse/WELD-870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stuart Douglas reassigned WELD-870:
---

Assignee: Stuart Douglas


 Add injection point information to exception message when injection into 
 observer fails
 ---

 Key: WELD-870
 URL: https://issues.jboss.org/browse/WELD-870
 Project: Weld
  Issue Type: Enhancement
  Components: Events
Affects Versions: 1.1.0.Final
Reporter: Dan Allen
Assignee: Stuart Douglas

 Injections that fail when an observer method is invoked are massively hard to 
 track down. Here's the information you get:
 org.jboss.weld.exceptions.IllegalArgumentException: WELD-001324 Argument bean 
 must not be null
at 
 org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:714)
at 
 org.jboss.seam.exception.control.HandlerMethodImpl.notify(HandlerMethodImpl.java:187)
at 
 org.jboss.seam.exception.control.ExceptionHandlerDispatch.executeHandlers(ExceptionHandlerDispatch.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at 
 org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
at 
 org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
at 
 org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
at 
 org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
at 
 org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
at 
 org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
at 
 org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
at 
 org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:270)
at 
 org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
at 
 org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:222)
at 
 org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:632)
at 
 org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:619)
at 
 org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:613)
 I expect to see the type and qualifiers at the failing injection point. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
___
weld-issues mailing list
weld-issues@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-issues


[weld-issues] [JBoss JIRA] Created: (WELD-872) Glassfish 3.1 maven-embedded-glassfish-plugin failure when cdi enabled (beans.xml present): java.lang.ClassNotFoundException: org.apache.tools.ant.Task

2011-03-23 Thread Craig Ringer (JIRA)
Glassfish 3.1 maven-embedded-glassfish-plugin failure when cdi enabled 
(beans.xml present): java.lang.ClassNotFoundException: org.apache.tools.ant.Task
---

 Key: WELD-872
 URL: https://issues.jboss.org/browse/WELD-872
 Project: Weld
  Issue Type: Bug
 Environment: Glassfish 3.1 via maven-embedded-glassfish-plugin 

Tested on:
Apache Maven 3.0.2 (r1056850; 2011-01-09 08:58:10+0800) 
Java version: 1.6.0_24, vendor: Sun Microsystems Inc. 
Java home: C:\Program Files\Java\jdk1.6.0_24\jre 
Default locale: en_AU, platform encoding: Cp1252 
OS name: windows 7, version: 6.1, arch: x86, family: windows

and:
Apache Maven 3.0.1 (r1038046; 2010-11-23 18:58:32+0800)
Java version: 1.6.0_20
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_AU, platform encoding: UTF-8
OS name: linux version: 2.6.35-25-generic-pae arch: i386 Family: unix
Reporter: Craig Ringer


From http://java.net/jira/browse/JERSEY-689 ; I'm not sure if this is a Jersey 
or a Weld issue.

I'm having problems getting my app to run under Glassfish 3.1 embedded, and 
have boiled the issue down to a minimal test case involving 
maven-embedded-glassfish-plugin for glassfish 3.1, jersey 1.5, and cdi (weld). 
There isn't even any Java code of my own in it, only web.xml, beans.xml and a 
pom.xml that declares a dependency on jersey-server 1.5. I'm using Jersey 1.5 
because I need its improved file upload handling and JSON support. 

When I use it to run an embedded glassfish server, deployment to to the 
embedded server fails with: 

  3/03/2011 6:40:28 PM org.glassfish.deployment.admin.DeployCommand execute 
  SEVERE: Exception while loading the app : org/apache/tools/ant/Task 
  java.lang.ClassNotFoundException: org.apache.tools.ant.Task 
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
... (elided, see full exception linked below) ...
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at 
org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1465)
at 
org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1368)
at 
org.glassfish.weld.BeanDeploymentArchiveImpl.handleEntry(BeanDeploymentArchiveImpl.java:485)
at 
org.glassfish.weld.BeanDeploymentArchiveImpl.collectJarInfo(BeanDeploymentArchiveImpl.java:473)
at 
org.glassfish.weld.BeanDeploymentArchiveImpl.populate(BeanDeploymentArchiveImpl.java:420)
at 
org.glassfish.weld.BeanDeploymentArchiveImpl.init(BeanDeploymentArchiveImpl.java:148)
at 
org.glassfish.weld.BeanDeploymentArchiveImpl.populate(BeanDeploymentArchiveImpl.java:391)
at 
org.glassfish.weld.BeanDeploymentArchiveImpl.init(BeanDeploymentArchiveImpl.java:148)
at 
org.glassfish.weld.BeanDeploymentArchiveImpl.init(BeanDeploymentArchiveImpl.java:128)
at org.glassfish.weld.DeploymentImpl.init(DeploymentImpl.java:120)
at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:334)
at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:99)
at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
at 
org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:249)
at 
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
at 
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at 
org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
...

(full exception and log of test run here: 
https://github.com/ringerc/scrapcode/blob/master/testcases/javaee/embeddedglassfish-jersey15-testcase/README
 ) 

If I delete beans.xml to disable CDI, the failure goes away. The stack trace 
passes through weld, providing further evidence that it's somewhere in CDI-land 
that things are breaking. 

I suspected that the problem might be related to WADL generation, so I set 
com.sun.jersey.config.feature.DisableWADL to true in the jersey servlet init 
params. That had no effect. 

Excluding all the dependencies of jersey-server, so only the jersey-server jar 
its self was present, still triggers the issue. It doesn't seem to be an issue 
with one of jersey-server's dependencies.

The ready-to-run testcase is here: 
https://github.com/ringerc/scrapcode/tree/master/testcases/javaee/embeddedglassfish-jersey15-testcase
 . Just: 

just: 

git clone git://github.com/ringerc/scrapcode.git 
cd scrapcode/testcases/javaee/embeddedglassfish-jersey15-testcase 
mvn clean install 

I'm filing this here because Jersey 1.5 seems to be the immediate cause, but 
there's always a chance it's a GF 3.1 or Weld bug.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[weld-issues] [JBoss JIRA] Resolved: (WELD-872) Glassfish 3.1 maven-embedded-glassfish-plugin failure when cdi enabled (beans.xml present): java.lang.ClassNotFoundException: org.apache.tools.ant.Task

2011-03-23 Thread Ales Justin (JIRA)

 [ 
https://issues.jboss.org/browse/WELD-872?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ales Justin resolved WELD-872.
--

Resolution: Won't Fix


Re-open if this really turns out to be Weld bug.


 Glassfish 3.1 maven-embedded-glassfish-plugin failure when cdi enabled 
 (beans.xml present): java.lang.ClassNotFoundException: 
 org.apache.tools.ant.Task
 ---

 Key: WELD-872
 URL: https://issues.jboss.org/browse/WELD-872
 Project: Weld
  Issue Type: Bug
 Environment: Glassfish 3.1 via maven-embedded-glassfish-plugin 
 Tested on:
 Apache Maven 3.0.2 (r1056850; 2011-01-09 08:58:10+0800) 
 Java version: 1.6.0_24, vendor: Sun Microsystems Inc. 
 Java home: C:\Program Files\Java\jdk1.6.0_24\jre 
 Default locale: en_AU, platform encoding: Cp1252 
 OS name: windows 7, version: 6.1, arch: x86, family: windows
 and:
 Apache Maven 3.0.1 (r1038046; 2010-11-23 18:58:32+0800)
 Java version: 1.6.0_20
 Java home: /usr/lib/jvm/java-6-openjdk/jre
 Default locale: en_AU, platform encoding: UTF-8
 OS name: linux version: 2.6.35-25-generic-pae arch: i386 Family: unix
Reporter: Craig Ringer

 From http://java.net/jira/browse/JERSEY-689 ; I'm not sure if this is a 
 Jersey or a Weld issue.
 I'm having problems getting my app to run under Glassfish 3.1 embedded, and 
 have boiled the issue down to a minimal test case involving 
 maven-embedded-glassfish-plugin for glassfish 3.1, jersey 1.5, and cdi 
 (weld). There isn't even any Java code of my own in it, only web.xml, 
 beans.xml and a pom.xml that declares a dependency on jersey-server 1.5. I'm 
 using Jersey 1.5 because I need its improved file upload handling and JSON 
 support. 
 When I use it to run an embedded glassfish server, deployment to to the 
 embedded server fails with: 
   3/03/2011 6:40:28 PM org.glassfish.deployment.admin.DeployCommand execute 
   SEVERE: Exception while loading the app : org/apache/tools/ant/Task 
   java.lang.ClassNotFoundException: org.apache.tools.ant.Task 
 at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 ... (elided, see full exception linked below) ...
   at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
   at 
 org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1465)
   at 
 org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1368)
   at 
 org.glassfish.weld.BeanDeploymentArchiveImpl.handleEntry(BeanDeploymentArchiveImpl.java:485)
   at 
 org.glassfish.weld.BeanDeploymentArchiveImpl.collectJarInfo(BeanDeploymentArchiveImpl.java:473)
   at 
 org.glassfish.weld.BeanDeploymentArchiveImpl.populate(BeanDeploymentArchiveImpl.java:420)
   at 
 org.glassfish.weld.BeanDeploymentArchiveImpl.init(BeanDeploymentArchiveImpl.java:148)
   at 
 org.glassfish.weld.BeanDeploymentArchiveImpl.populate(BeanDeploymentArchiveImpl.java:391)
   at 
 org.glassfish.weld.BeanDeploymentArchiveImpl.init(BeanDeploymentArchiveImpl.java:148)
   at 
 org.glassfish.weld.BeanDeploymentArchiveImpl.init(BeanDeploymentArchiveImpl.java:128)
   at org.glassfish.weld.DeploymentImpl.init(DeploymentImpl.java:120)
   at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:334)
   at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:99)
   at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
   at 
 org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:249)
   at 
 com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
   at 
 com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
   at 
 org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
 ...
 (full exception and log of test run here: 
 https://github.com/ringerc/scrapcode/blob/master/testcases/javaee/embeddedglassfish-jersey15-testcase/README
  ) 
 If I delete beans.xml to disable CDI, the failure goes away. The stack trace 
 passes through weld, providing further evidence that it's somewhere in 
 CDI-land that things are breaking. 
 I suspected that the problem might be related to WADL generation, so I set 
 com.sun.jersey.config.feature.DisableWADL to true in the jersey servlet init 
 params. That had no effect. 
 Excluding all the dependencies of jersey-server, so only the jersey-server 
 jar its self was present, still triggers the issue. It doesn't seem to be an 
 issue with one of jersey-server's dependencies.
 The ready-to-run testcase is here: 
 https://github.com/ringerc/scrapcode/tree/master/testcases/javaee/embeddedglassfish-jersey15-testcase
  . Just: 
 just: 
 git clone git://github.com/ringerc/scrapcode.git 
 cd 

[weld-issues] [JBoss JIRA] Assigned: (WELD-870) Add injection point information to exception message when injection into observer fails

2011-03-23 Thread Ales Justin (JIRA)

 [ 
https://issues.jboss.org/browse/WELD-870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ales Justin reassigned WELD-870:


Assignee: Ales Justin  (was: Stuart Douglas)


 Add injection point information to exception message when injection into 
 observer fails
 ---

 Key: WELD-870
 URL: https://issues.jboss.org/browse/WELD-870
 Project: Weld
  Issue Type: Enhancement
  Components: Events
Affects Versions: 1.1.0.Final
Reporter: Dan Allen
Assignee: Ales Justin

 Injections that fail when an observer method is invoked are massively hard to 
 track down. Here's the information you get:
 org.jboss.weld.exceptions.IllegalArgumentException: WELD-001324 Argument bean 
 must not be null
at 
 org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:714)
at 
 org.jboss.seam.exception.control.HandlerMethodImpl.notify(HandlerMethodImpl.java:187)
at 
 org.jboss.seam.exception.control.ExceptionHandlerDispatch.executeHandlers(ExceptionHandlerDispatch.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at 
 org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
at 
 org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
at 
 org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
at 
 org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
at 
 org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
at 
 org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
at 
 org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
at 
 org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:270)
at 
 org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
at 
 org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:222)
at 
 org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:632)
at 
 org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:619)
at 
 org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:613)
 I expect to see the type and qualifiers at the failing injection point. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
___
weld-issues mailing list
weld-issues@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-issues


[weld-issues] [JBoss JIRA] Commented: (WELD-870) Add injection point information to exception message when injection into observer fails

2011-03-23 Thread Ales Justin (JIRA)

[ 
https://issues.jboss.org/browse/WELD-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12591331#comment-12591331
 ] 

Ales Justin commented on WELD-870:
--

I've got two fix impls:
(a) https://github.com/alesj/core/tree/weld-870
(b) https://github.com/alesj/core/tree/weld-870-lite

When doing (a) I saw that I could just do (b).
But (a) also adds some other things, similar to why we have @Dispose as Bean,
so I didn't just throw it away.

Pete, Stuart, wdyt?


 Add injection point information to exception message when injection into 
 observer fails
 ---

 Key: WELD-870
 URL: https://issues.jboss.org/browse/WELD-870
 Project: Weld
  Issue Type: Enhancement
  Components: Events
Affects Versions: 1.1.0.Final
Reporter: Dan Allen
Assignee: Ales Justin

 Injections that fail when an observer method is invoked are massively hard to 
 track down. Here's the information you get:
 org.jboss.weld.exceptions.IllegalArgumentException: WELD-001324 Argument bean 
 must not be null
at 
 org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:714)
at 
 org.jboss.seam.exception.control.HandlerMethodImpl.notify(HandlerMethodImpl.java:187)
at 
 org.jboss.seam.exception.control.ExceptionHandlerDispatch.executeHandlers(ExceptionHandlerDispatch.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at 
 org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
at 
 org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
at 
 org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
at 
 org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
at 
 org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
at 
 org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
at 
 org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
at 
 org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:270)
at 
 org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
at 
 org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:222)
at 
 org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:632)
at 
 org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:619)
at 
 org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:613)
 I expect to see the type and qualifiers at the failing injection point. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
___
weld-issues mailing list
weld-issues@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-issues