-
1. Re: Unproxyable class: superclasses also need no-arg constructor?
alesj Mar 27, 2012 10:41 AM (in response to rcd)I guess it considers X a bean as well.
Try vetoing the X bean.
-
2. Re: Unproxyable class: superclasses also need no-arg constructor?
rcd Mar 27, 2012 10:58 AM (in response to alesj)How do I veto X? Using @Typed to specify what I want proxied? Just tried that and I get this:
10:54:49,969 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."NMSS.ear".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."NMSS.ear".WeldService: java.lang.NullPointerException
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.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_02]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_02]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_02]
Caused by: java.lang.NullPointerException
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:111)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:127)
at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:346)
at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:331)
at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:366)
at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83)
at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)
... 5 more
-
3. Re: Unproxyable class: superclasses also need no-arg constructor?
alesj Mar 27, 2012 6:25 PM (in response to rcd)What exactly did you try? As NPE is always a bug.
For the veto, either you use Extension and veto the X explicitly,
or you use JBoss Solder which has this impled under @Veto.
-
4. Re: Unproxyable class: superclasses also need no-arg constructor?
rcd Mar 30, 2012 11:33 AM (in response to alesj)When I got the NPE, the only thing I did differently was that I annotated the class with @Typed(Y.class) so that class X would not be a bean type.
@Veto does not help because, again, I don't control class X. Similarly, I don't see how Extension helps either.
I have managed to create a workaround that's good enough for this case by injecting a factory that can be used to obtain a new instance of Y instead of injecting Y directly. This works in my case because scope is irrelevant for this object, but I would still like to know why this problem exists in the first place...
-
5. Re: Unproxyable class: superclasses also need no-arg constructor?
alesj Mar 30, 2012 11:39 AM (in response to rcd)Is there a way you could provide us with an Arquillian test case for both things?
-
6. Re: Unproxyable class: superclasses also need no-arg constructor?
rcd Mar 30, 2012 11:55 AM (in response to alesj)I should be able to make some simple test cases that expose the problems. Should I just upload them here?
-
7. Re: Unproxyable class: superclasses also need no-arg constructor?
alesj Mar 31, 2012 2:50 PM (in response to rcd)I should be able to make some simple test cases that expose the problems. Should I just upload them here?
No, if possible. :-)
What we do now is create an Arquillian test against our Weld Core project - https://github.com/weld/core, tests-arquillian/ directory,
commit, and then do a pull-request in github. It's saves everyone a ton of time.