tags:

views:

185

answers:

1

Hello,

perhaps someone can help me - I have EJB project (in Netbeans) which is deployed to Glassfish. I also have a WAR project (not part of EAR containing the previous EJB JAR) which has a dependency on the EJB JAR mentioned. The calls between WAR and EJB are remote EJB calls.

If I use EJB JAR as library in WAR, it seems that Glassfish tries to inject @EJB annotations in the EJB JAR, and I get tons of errors since WAR obviously doesn't know about some internal EJBs used locally by the EJB JAR.

How to solve this problem? If I try to create a separate project (just for remote interfaces), this soon becomes a nightmare since interfaces depend on entity beans and then this "helper" project becomes bloated with all sorts of things.

Any ideas?

Thank you for answers.

A: 

You have to provide a JAR with the remote interfaces to your WAR (also known as a client ejb-jar), there is no other option. And if your remote interfaces do use entities (or any other dependencies), then your WAR must obviously be aware of them (i.e. you also need to include entities and any other dependency in a JAR and to package it in the WAR). Nothing wrong with that.

Pascal Thivent