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.
也许有人可以帮助我 - 我有部署到Glassfish的EJB项目(在Netbeans中)。我还有一个WAR项目(不包含以前的EJB JAR的EAR的一部分),它依赖于所提到的EJB JAR。 WAR和EJB之间的调用是远程EJB调用。
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.
如果我在WAR中使用EJB JAR作为库,似乎Glassfish试图在EJB JAR中注入@EJB注释,并且我得到了大量的错误,因为WAR显然不知道EJB JAR在本地使用的一些内部EJB。
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.
如何解决这个问题呢?如果我尝试创建一个单独的项目(仅用于远程接口),这很快就会变成一场噩梦,因为接口依赖于实体bean,然后这个“帮助”项目变得臃肿了各种各样的东西。
Any ideas?
有任何想法吗?
Thank you for answers.
谢谢你的回答。
1 个解决方案
#1
0
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.
您必须为JAR提供WAR的远程接口(也称为客户端ejb-jar),没有其他选择。如果您的远程接口确实使用实体(或任何其他依赖项),那么您的WAR显然必须知道它们(即您还需要在JAR中包含实体和任何其他依赖项并将其打包在WAR中)。没有错。
#1
0
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.
您必须为JAR提供WAR的远程接口(也称为客户端ejb-jar),没有其他选择。如果您的远程接口确实使用实体(或任何其他依赖项),那么您的WAR显然必须知道它们(即您还需要在JAR中包含实体和任何其他依赖项并将其打包在WAR中)。没有错。