[jboss-jira] [JBoss JIRA] Moved: (JBAS-7879) JNDI Lookup for EJB3 Component with EJB2 Interface delivers wrong Proxy (EJB3 instead of EJB2)
Carlo de Wolf (JIRA)
jira-events at lists.jboss.org
Tue Mar 30 07:17:43 EDT 2010
[ https://jira.jboss.org/jira/browse/JBAS-7879?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carlo de Wolf moved JBNAME-40 to JBAS-7879:
-------------------------------------------
Project: JBoss Application Server (was: JBoss Naming)
Key: JBAS-7879 (was: JBNAME-40)
Affects Version/s: JBossAS-5.1.0.GA
(was: 5.1.0.GA)
Security: Public
> JNDI Lookup for EJB3 Component with EJB2 Interface delivers wrong Proxy (EJB3 instead of EJB2)
> ----------------------------------------------------------------------------------------------
>
> Key: JBAS-7879
> URL: https://jira.jboss.org/jira/browse/JBAS-7879
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: JBossAS-5.1.0.GA
> Environment: JBoss 5.1.0 (out of the box). Windows 7 (64 Bit), Also under Windows XP (32 Bit) Java 1.6.0_16 (Sun)
> Reporter: Volker Raum
>
> Two EJB components are packaged into two jars within an EAR. EJB3 is an EJB3.0 Stateless Session Bean. EJB2 is a EJB2.0 Stateless Session Bean. EJB2 needs access to EJB3 so EJB3 was equipped with EJB2.0 Home and Remote Interfaces.
> 1. The EJB3 is coded like that:
> ...
> @Stateless(name="EJB3")
> @RemoteHome(EJB3Home.class)
> public class EJB3Bean implements EJB3
> {
> ...
> 2. EJB3Home looks like this: (for compatibility with EJB2.0)
> public interface EJB3Home extends EJBHome
> {
> public EJB3Remote create() throws CreateException, RemoteException;
> }
> 3. EJB3 is the EJB3 Business Remote Interface (according to EJB3.0 Spec) and looks like this:
> @Remote
> public interface EJB3
> {
> public void doThings() ;
> 4. EJB3Remote is a Remote Interface according to the EJB2.0 Spec:
> public interface EJB3Remote extends EJBObject
> {
> public void doThings() throws RemoteException ;
> ...
> 5. For the EJB2 there is a deployment descriptor defined. The section for the EJB2 Session Bean contains the following ejb-ref:
> ...
> <ejb-ref>
> <ejb-ref-name>EJB2Remote</ejb-ref-name>
> <ejb-ref-type>Session</ejb-ref-type>
> EJB3Home
> EJB3Remote
> <ejb-link>EJB3</ejb-link> <!-- results are identical with or without this line-->
> </ejb-ref>
> ...
> 6. The EJB2 does a Lookup like
> Object obj = jndi.lookup("EJB2Remote") ;
> What i would expect is an object implementing EJB3Home. After narrowing it i could call create() with it and get a EJB3Remote Object.
> But what i get instead is an object of type EJB3, the Business Interface.
> Looks like a bug. jaikiran from the community forums asked me to report this as bug.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list