I am learning java ee right now. I have successfully implemented a hello-world style application where a app-client invokes an stateless session bean via a remote interface. (maven3, glassfish3, javaee6).
My question is, where should I package the remote interfaces. The main reason I ask is that netbeans 7.0.1 prompted me to put the remote interface in a different module. Since I only have web, ejb, and client modules, the only option was to put it in the client module. Why does netbeans suggest this?
It generally does not make sense to me to put all the remote interfaces with the client and have the ejb module depend on the client. Shouldn’t the remote interfaces of an ejb modules be coupled relatively tightly with the ejb module itself.
Perhaps a seperate module just for remote interfaces?
I can post code if this is unclear.
Thanks in advance.
A separate client interface JAR is easiest (see
<ejb-client-jar>in ejb-jar.xml). That JAR can be bundled alongside the EJB module and the client module without being specific to either.