Hi Guys,
I was wondering if anyone had any experience in using LocalStatelessSessionProxyFactoryBean to communicate with a 2.1 Local Stateless EJB in an OpenEjb 3.1.4 /Tomcat 6 environment ??
I'm trying to get it up and running without much success!
I have the following EJB code:
All of the above I have built and packaged using Maven and it exists as its own jar file (IMyInterface has the exact same methods (method1 & method2) is in a separate project) and it works fine in a regular client application.Code:LocalBean implements EjbLocalObject, IMyInterface { } LocalBeanHome implements EjbLocalHome { LocalBean create() throws CreateException; } LocalBeanSession implements SessionBean { // EJB Implementation public void method1(){ //do something } public void method2(){ //do something } } //Located in a different package, in my web application interface IMyInterface{ public void method1(); public void method2(); }
(The web application I am calling this EJB from has only a web.xml reference to the local ejb. I have the ejb jar in TOMCAT_HOME/webapps/)
So now I'm trying to integrate/invoke this EJB using the LocalStatelessSessionProxyFactoryBean from the application context.
I am using:
I then have a controller class which specify's an attribute: IMyComponent myComponent, and I inject the above bean into this.Code:<bean id="bean1" class="...LocalStatelessSessionProxyFactoryBean"> <property name="jndiName" value="MyBean"> <property name="businessInterface" value="...IMyComponent"/> </bean>
This all appears to work to some degree, in that openejb finds and registers the EJB, and my application can definitely find it (in that I get a reference to the home interface of my EJB).
But here is my problem. In my simple mind I directly invoke myComponent.method1() from within my controller and expect to see the output from that method in the EJB.
However, when I try this I get consistent :
MethodNotFound exceptions, followed by UndeclaredThrowableExceptions.
Can anyone see if I am blatantly missing something?!
The interface methods are exactly the same and I have tried to put the ejb jar in TOMCAT_HOME/webapps/openejb/lib but without much success.
Thanks in advance! Eoin


Reply With Quote