1
votes

I have an EJB ear deployed to Weblogic. The EJB has some JMS queues setup which it sends out a message by design. The client web application invoking the EJB is running on another JVM on the same machine (to mimic a remote call)

EJB Interface

@Remote
public interface MyLog {
    public void doSomething();
}

In the client,

Maven dependency includes the following. I'm using the ejb jar itself. How do I go about generating the ejb client jar and what's the difference between the two?

org.ihc.myLog myLog-ejb 1.0 jar

I'm using spring to lookup the ejb and I'm using the ejb jar (Not sure if I fully understand the difference between the ejb jar and the ejb-client jar).

<bean id="myLog" parent="MyEjbParent" lazy-init="false">
   <property name="jndiName" value="MyLog#org.ihc.My.MyLog"/>
   <property name="businessInterface" value="org.ihc.audit.AuditLog"/>
   <property name="lookup-home-on-startup" value="false"/>
</bean>

and I'm using Spring DI to wire myLog to the appropriate attribute of a class and performing my operations.

myLog.doSomething();

The problem is that when I try to deploy the web app that invokes the EJB, the deployment fails saying that the JMS queues aren't setup on the client Application server. I do not understand why the client applicaion server needs to have the JMS queues setup as they are already setup on the Weblogic server running the EJB instance. Shouldn't the client be just concerned about invoking the remote method and let the EJB do it's thing? Might be that my config is wrong or something else? Thanks.

Here is the error I get during deployment of the client web app that invokes the ejb

|Exception while loading the app : EJB Container initialization error
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: JMS resource
not created : jms.mylog_queue
1
if my answer helped you pls vote ;-) - Diversity

1 Answers

1
votes

Has your ejb client jar the ejbs with in it or the configuration files or does it contain just the Interface classes. Seems that you client server also tries to initialize your beans which indeed is not necessary.

Try to seperate client code from server code. Your client just needs to know the remote interfaces and your client server needs all ejb-client dependencies in order to invoke all that ejb remote --> rmi-iiop stuff.

UPDATE due to comment:

Create a seperate WEB Project. With just the dependencies it needs to invoke the remote EJBS. In this case the Remote Interfaces. If it is a Web Project than just put in the configurations which are necessary for this WEB-Project and deploy it as a WAR File not as a JAR or EAR.