-
1. Re: Uses remote ejb bean in servlet from EAR file.
nickarls Nov 14, 2012 3:11 AM (in response to michael_jboss)So are you saying that you have a test.war and then you have another ear with jars in the lib (and MyBeanRemoteInterface is defined in one of those)?
And ther servlet in the war doesn't find the EJB to inject?
I think you need to give the injection point some more information, have you tried something like
@EJB(lookup = "ejb:app/module/distinct/BeanName!View")
(where the lookup corresponds to your bean?)
Check the JBoss AS documentation for the correct lookup string.
-
2. Re: Uses remote ejb bean in servlet from EAR file.
michael_jboss Nov 14, 2012 3:51 AM (in response to nickarls)So are you saying that you have a test.war and then you have another ear with jars in the lib (and MyBeanRemoteInterface is defined in one of those)?
And ther servlet in the war doesn't find the EJB to inject?
Yes, all so.
@EJB(lookup = "ejb:app/module/distinct/BeanName!View")
I used attribute lookup in EJB annotation.
I had exception when deploying my test.war(ClassNotFoundException: MyBeanRemoteInterface ) because the WAR was without EJB JAR. Next I put EJB JAR in WAR and all worked.
But I am not want copy out my EJB JAR into EAR and WAR(I want only copy out my EJB JAR in EAR).
Do I can uses configuration xml files in my web project, for dependency on EJB JAR.
-
3. Re: Uses remote ejb bean in servlet from EAR file.
nickarls Nov 14, 2012 3:57 AM (in response to michael_jboss)Since the WAR and the EJB could in theory be deployed on separate hosts and the client would need the signature of the EJB remote interface in any case, how about splitting the required interfaceparts into a separate jar that is used both in the WAR and the EAR?
I'm not using remote EJBs so I'm not sure what is the best practice, just looking at the problem from a classloading-point-of-view
-
4. Re: Uses remote ejb bean in servlet from EAR file.
michael_jboss Nov 14, 2012 4:16 AM (in response to nickarls)... so I'm not sure what is the best practice
I also
I am going to think on my architecture.
Thank you Nicklas.
I am sorry for my English!
-
5. Re: Uses remote ejb bean in servlet from EAR file.
jaikiran Nov 14, 2012 7:08 AM (in response to nickarls)Nicklas Karlsson wrote:
Since the WAR and the EJB could in theory be deployed on separate hosts and the client would need the signature of the EJB remote interface in any case, how about splitting the required interfaceparts into a separate jar that is used both in the WAR and the EAR?
That's how it's supposed to be done. The jar containing the bean interfaces is typically in a separate jar which can then be packaged in individual applications.
-
6. Re: Uses remote ejb bean in servlet from EAR file.
michael_jboss Nov 14, 2012 7:21 AM (in response to jaikiran)Nicklas Karlsson wrote:
Since the WAR and the EJB could in theory be deployed on separate hosts and the client would need the signature of the EJB remote interface in any case, how about splitting the required interfaceparts into a separate jar that is used both in the WAR and the EAR?
That's how it's supposed to be done. The jar containing the bean interfaces is typically in a separate jar which can then be packaged in individual applications.
Ok, I am going to do it. Thank you.