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?