You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by dfrey <fr...@gmail.com> on 2009/03/16 12:49:09 UTC

OpenEjb tomcat samples

I managed to successfully integrate openejb into tomcat. I went ahead and
successfuly ran the ejbexample. I then tried to run the MDB sample. It runs
ok but no message is being posted to the queue. Tomcat does not throw any
error? What could be wrong?
-- 
View this message in context: http://www.nabble.com/OpenEjb-tomcat-samples-tp22536578p22536578.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: OpenEjb tomcat samples

Posted by dfrey <fr...@gmail.com>.
hi, 

i did the setup as you suggested. I am getting the error:

 MessagingClientBeanRemote does not exist in the system

It seems to be a resource location problem..What could be the problem?
-- 
View this message in context: http://www.nabble.com/OpenEjb-tomcat-samples-tp22536578p22777722.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: OpenEjb tomcat samples

Posted by Jonathan Gallimore <jo...@gmail.com>.
Hi,

Do you mean the simple-mdb example? I've just deployed this to Tomcat 
and run it successfully by invoking the MessagingClientBean from a test, 
but I had to change a couple of things:

firstly I added a Remote interface to the MessagingClientBean:

@Remote
public interface MessagingClientRemote {

    public void sendMessage(String text) throws JMSException;

    public String receiveMessage() throws JMSException;
}

and changed ChatBeanTest to point to my local instance of Tomcat instead 
of using an Embedded server and to use the remote interface instead of 
the local one (note the different Initial context factory, URL and JNDI 
name):

public void test() throws Exception {
        Properties p = new Properties();
        p.put(Context.INITIAL_CONTEXT_FACTORY, 
"org.apache.openejb.client.RemoteInitialContextFactory");
        p.put(Context.PROVIDER_URL, "http://localhost:8080/openejb/ejb");
        InitialContext context = new InitialContext(p);

        MessagingClientRemote bean = (MessagingClientRemote) 
context.lookup("MessagingClientBeanRemote");

        bean.sendMessage("Hello World!");

        assertEquals(bean.receiveMessage(), "Hello, Test Case!");

        bean.sendMessage("How are you?");

        assertEquals(bean.receiveMessage(), "I'm doing well.");

        bean.sendMessage("Still spinning?");

        assertEquals(bean.receiveMessage(), "Once every day, as usual.");
    }

This test run successfully on my machine.

Hope that helps.

Jon


dfrey wrote:
> I managed to successfully integrate openejb into tomcat. I went ahead and
> successfuly ran the ejbexample. I then tried to run the MDB sample. It runs
> ok but no message is being posted to the queue. Tomcat does not throw any
> error? What could be wrong?
>