geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: Exception by using EJB3 on Geronimo 2
Date Thu, 03 Apr 2008 06:51:01 GMT
Thanks for resending with comprehensible formatting :-)

I think you left out some information about your environment.  I  
think there is a jndi.properties file in the client's classpath that  
is directing the use of a corba name service for jndi lookups, using  
the sun ee corba implementation in the client.  It's somewhat tricky  
to get that to work.

Access to ejbs from anything other than a javaee module in the same  
javaee application is not standardized.  I recommend taking the corba  
and sun stuff out of your client and including the openejb3 client  
jar in its classpath.  This should set the jndi properties correctly  
for the openejb transport.

If you look in the server log as your application starts you should  
see the global jndi names your ejbs are bound under and that you can  
use with the openejb jndi provider to look up your ejbs.

hope this helps
david jencks

On Apr 1, 2008, at 8:41 AM, thomas2004 wrote:

>
> Hi all,
>
> I am learning the EJB3. I follow a tutorial under:
> http://www.webagesolutions.com/knowledgebase/javakb/jkb005/index.html
>
> and it runs quite well since I use the SUN Application Server.
>
> So I deployed the EJB Jars onto Geronimo 2. Bu tas I try to start  
> the client
> I got exception as follow:
>
> Caused by: java.net.ConnectException: Connection refused: connect
> 	at sun.nio.ch.Net.connect(Native Method)
> 	at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:464)
> 	at
> com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel 
> (ORBUtility.java:105)
> 	at
> com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket 
> (IIOPSSLSocketFactory.java:332)
> 	... 16 more
>
> Here is my session bean:
>
> @Stateless(name = "Example",  mappedName = "ejb/SimpleBeanJNDI")
> public class SimpleBeanImpl implements SimpleBean {
> 	public String sayHello(String name) {
> 		return "Hello, the text you enter is: " + name + "!";
> 	}
> }
>
>
> And here is the client and lookup:
>
> public class TestClient {
>
> 	public void runTest() throws Exception {
> 		InitialContext ctx = new InitialContext();
> 		SimpleBean bean = (SimpleBean) ctx.lookup("ejb/SimpleBeanJNDI");
> 		String result = bean.sayHello("Billy Bob, Wei Chen");
> 		System.out.println(result);
> 	}
>
> 	public static void main(String[] args) {
> 		try {
> 			TestClient cli = new TestClient();
> 			cli.runTest();
>
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 		}
> 	}
> }
>
> Has someone idea?
>
> Regards
>
> Thomas
>
>
> -- 
> View this message in context: http://www.nabble.com/Exception-by- 
> using-EJB3-on-Geronimo-2-tp16418687s134p16418687.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>


Mime
View raw message