[jboss-jira] [JBoss JIRA] Updated: (JBAS-5646) @EJB does not work in servlet
Carlo de Wolf (JIRA)
jira-events at lists.jboss.org
Thu Jun 19 03:25:37 EDT 2008
[ http://jira.jboss.com/jira/browse/JBAS-5646?page=all ]
Carlo de Wolf updated JBAS-5646:
--------------------------------
Component/s: Web (Tomcat) service
> @EJB does not work in servlet
> -----------------------------
>
> Key: JBAS-5646
> URL: http://jira.jboss.com/jira/browse/JBAS-5646
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: EJB3, Web (Tomcat) service
> Affects Versions: JBossAS-5.0.0.CR1
> Environment: JBOSS trunk revision 74818 on both Windows 2000SP4 and Linux Fedora 8 (64-bit) with 32-bit JDK 1.5.0.14 (on both Windows and Linux)
> Reporter: Rick Vederman
> Assigned To: Carlo de Wolf
>
> This was not an issue in 5.0.0.Beta4. I pulled the trunk to get the fix for another bug and this cropped up. Basically, I declare an interface POJO and prefix it with @Remote. I then declare a stateless EJB which implements that interface and prefix it with @Stateless. Finally, I create a servlet and prefix an attribute declaration of the interface type using @EJB. None of the annotations have any parameters.
> See the Forum reference for the log dump (first post) as well as the java code (third post). I apologize if this is a duplicate...I see some other issues which look close, but I was not sure.
> Work-around:
> Add 'mappedName="EJB3Test1/CoverageWCBean/remote"' to the @EJB annotation in the servlet. This gets me past the "java.lang.IllegalStateException: Resolution should not happen via injection container" problem, but then this problem crops up:
> 23:41:28,159 ERROR [FieldBeanProperty] failed to set value jboss.j2ee:ear=EJB3Test.ear,jar=EJB3TestEJB.jar,name=CoverageWCBean,service=EJB3 on field private ic.poc.wc.CoverageWC EJB3TestServlet.wc
> java.lang.IllegalArgumentException
> at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
> This problem is then worked around by setting CallByValue=true in the Naming service (jboss-service.xml) and then it works (EJBTHREE-983 might be related to this problem). Note that I tested this in GlassFish and it all works fine with just the annotations without any parameters as it did under 5.0.0.Beta4.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list