users@glassfish.java.net

Re: Deployment of an EAR with multiple WARs to different HTTP listeners

From: Witold Szczerba <pljosh.mail_at_gmail.com>
Date: Tue, 26 Jan 2010 14:46:04 +0100

2010/1/26 Witold Szczerba <pljosh.mail_at_gmail.com>:
> 2010/1/26 Dominik Dorn <dominik.dorn_at_gmail.com>:
>> you could split up the ear and deploy the classes of the ear as an own
>> application
>> and access them with ejb from two separate web-applications.. You can
>> then assign
>> the web-applications to different vhosts
>
> I am not sure, but local interfaces allow access only from within the
> same application, so if EJB module has a session bean with local
> interface - it will not be available to another module deployed as
> separate application. As far as I remember, different vendors can
> choose to enable such access, but it is not guaranteed by JEE
> specification and I think it will not work with Glassfish.
>

I have just checked it.
There is EAR modules: [ejb1, ejb2, web1]
Web1 is referencing ejb1 using local interface declared in ejb1-api
jar library and everything works.
Now I deploy EAR [ejb1, ejb2] and web1 as a standalone web module.
Now, when I click button to test if I can reference ejb1, the
exception is thrown:

javax.faces.FacesException: com.sun.enterprise.InjectionException:
Exception attempting to inject Unresolved Ejb-Ref
web1.SFManagedBean/bean1_at_jndi:
ejb1.Bean1Local_at_null@ejb1.Bean1Local_at_Session@null into class
web1.SFManagedBean

That's all for that subject...