I write a EJB3 session bean, it run in a JBOSS4.0.3SP1 server.
and i write a client to test the EJB3 session bean, the client is run in another
JVM.
here is my client
public class JNDITest {
public JNDITest() {
super();
// TODO Auto-generated constructor stub
}
/**
* @param args
*/
public static void main(String[] args) {
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interface");
env.setProperty(Context.PROVIDER_URL, "jnp://xbw:1099");
try {
Context ctx = new InitialContext(env);
com.xubin.jnditest.ejb3.JNDITest testbean =
(com.xubin.jnditest.ejb3.JNDITest)ctx.lookup(com.xubin.jnditest.ejb3.JNDITest.class.getName());
System.out.println(testbean.getInfo());
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
and here is my ejb3
package com.xubin.jnditest.ejb3;
import javax.ejb.Stateless;
import com.xubin.jnditest.ejb3.JNDITest;
public @Stateless class JNDITestBean implements JNDITest {
public String getInfo() {
return "Just a test";
}
}
when I run my client, it's all right, "Just a test" is printed on console.
But, in server side, an error is raise:
15:32:09,515 ERROR [ServerThread] failed
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.ObjectInputStream$PeekInputStream.peek(Unknown Source)
at
java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.refill(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.read(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.readByte(Unknown
Source)
at java.io.ObjectInputStream.readByte(Unknown Source)
at
org.jboss.remoting.transport.socket.ServerSocketWrapper.checkConnection(ServerSocketWrapper.java:54)
at
org.jboss.remoting.transport.socket.ServerThread.acknowledge(ServerThread.java:217)
at
org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:298)
at
org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:169)
Can anyone tell me why? Please give me a hand!
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3909684#3909684
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3909684
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user