views:

72

answers:

1

Hi All,

I have a an ejb3 jar file containing:

1) remote interface I1 and the stateless implementation IMPL1 (exposed to the client)

2) local interface I2 and the stateless implementation IMPL2 (used locally within the server application)

IMPL1 has got @EJB annotation to inject local I2 (IMPL2).

When I put the ejb3 jar to the client and try to deploy the client application it fails with the error "Cannot resolve reference Unresolved Ejb-Ref" to the local I2 because obviously the local I2 ejb is not accessible from the client.

As far as I understand I should have put only remote interfaces and entities in the client's lib. Not the implementation IMPL1 as it causes the problem. Alternatively I cam make the I2 remote and then the client deploys successfully. However I don't want to expose I2 and want to get the response from the local bean "by reference".

The problem is I can't split the project into two parts (client+server), so I have put the whole ejb jar to the client's lib.

Is it possible to disable the local @EJB in IMPL1 on the client (somehow in web.xml)?

Thanks in advance, Anton

A: 

You might find the instructions for performing remote lookup and invocations of EJBs, from a SE client at the Glassfish FAQ. Although it is for JEE 5/EJB 3.0, it holds good for JEE6/EJB 3.1 as well.

Vineet Reynolds
@Vineet Thanks for your efforts. I had had a look at the FAQ before I posted my question, but could not find the answer in there. Thanks.
Anton