geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Lietz <>
Subject Re: Exception in thread "main" java.lang.NullPointerException?
Date Wed, 05 Dec 2007 11:02:14 GMT

EJB is meant to run as a service inside JavaEE-Servers to serve e.g. a web
application inside the server or a number of coupled servers. In general
you won't expose EJBs directly to a standard java remote client

I guess you've done this tutorial already?

Then you've got your working client already, namely the MyServlet.class!

If you want to use them with a plain standard Java application (that's what
I think you want to do?), there's not a defined and easy way to do it.
WebSphere has something like that
but I don't know about Geronimo.

The best way to do what you want to do is to build webservice around your
EJBs, e.g. with SOAP, RMI or similar technologies.


On Tue, 4 Dec 2007 20:48:20 -0800 (PST), beyondjusitn
<> wrote:
> Then, how can I make it to access the remote EJB interface in my
> application
> client? I would really appreciate if you could write an step-by-step
> tutorial to me, of course use eclipse and Geronimo. I'm totally desperate
> now.
> Thanks a lot!
> Johannes Lietz wrote:
>> Simply said: You can't just add a main method to an EJB class and expect
>> it
>> to run in the same way as it would inside an application server.
>> You need the whole infrastructure an application server provides, which
>> does a lot of things behind the scenes. In your class, the server would
>> "magically" instantiate an object for your member remoteBusinessIntf,
>> which
>> will do a sayHello(). In your case remoteBusinessIntf is null, and the
>> error is thrown.
>> -Johannes
> -----
> --
> Best Wishes!
> Justin Tsao
> --
> View this message in context:
> Sent from the Apache Geronimo - Users mailing list archive at

View raw message