[jboss-user] [EJB 3.0] - EJB3 client error - java.io.EOF exception
Jihnd
do-not-reply at jboss.com
Tue Aug 21 14:38:03 EDT 2007
hello all,
i'm folllowing the samples in bill burke's ejb3 book, i''ve successfully deployed my ejb bean, and i've got an simple database i've made in oracle xe as my datasource
i'm now at the stage where i'm tryng to access i through a client application - but whenever i run the client app, it hangs about 4/5 hours - after which i get these error messages:
(reconfigured port to 1201 for my install)
anonymous wrote :
| C:\>java Client
| javax.naming.CommunicationException: Could not obtain connection to any of these
| urls: jnp://localhost:1201 and discovery failed with error: javax.naming.Commun
| icationException: error setting options [Root exception is java.net.SocketExcept
| ion: error setting options] [Root exception is javax.naming.CommunicationExcepti
| on: Failed to retrieve stub from server localhost:1201 [Root exception is java.i
| o.EOFException]]
| at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
| at javax.naming.InitialContext.lookup(InitialContext.java:392)
| at Client.main(Client.java:14)
| Caused by: javax.naming.CommunicationException: Failed to retrieve stub from ser
| ver localhost:1201 [Root exception is java.io.EOFException]
| at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:263)
| at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
| ... 4 more
| Caused by: java.io.EOFException
| at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream
| .java:2279)
| at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputS
| tream.java:2748)
| at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780
| )
| at java.io.ObjectInputStream.(ObjectInputStream.java:280)
| at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:250)
| ... 5 more
|
in my searches it seems to be the jndicontext.lookup variable that could an issue, so i've been trying a variety of names including (AVman is the nname of my jar & the jndi name) "java:AVman/com/AVman/Audiorec/AVmanRemote", "java:com/AVman/Audiorec/AVmanRemote", "java:AVman/com/AVman/Audiorec/AVman/remote"
but no joy
my log gives me a series of these errors:
anonymous wrote :
|
| 2007-08-21 17:44:33,453 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
and here is my client app:
anonymous wrote : import com.AVman.Audiorec.AVmanRemote;
| import com.AVman.domain.Audiorec;
|
| import javax.naming.InitialContext;
| import javax.naming.Context;
| import javax.naming.NamingException;
| import java.util.Properties;
| import javax.rmi.PortableRemoteObject;
|
| public class Client {
| public static void main(String [] args) {
| try {
| Context jndiContext = getInitialContext( );
| Object ref = jndiContext.lookup("java:AVman/com/AVman/Audiorec/AVmanRemote");
| AVmanRemote dao = (AVmanRemote)
| PortableRemoteObject.narrow(ref,AVmanRemote.class);
|
| Audiorec audiorec_1 = new Audiorec( );
| audiorec_1.setAudiorec_alias("Edirol red 1");
| audiorec_1.setBarcode_audiorec(1111117);
| audiorec_1.setSerial_audiorec("abcdefg");
| audiorec_1.setMedia_audiorec("sd card, 1gb included");
|
| dao.createAudiorec(audiorec_1);
|
| Audiorec audiorec_2 = dao.findAudiorec("Edirol red 1");
| System.out.println(audiorec_1.getAudiorec_alias( ));
| System.out.println(audiorec_1.getBarcode_audiorec( ));
| System.out.println(audiorec_1.getSerial_audiorec( ));
| System.out.println(audiorec_1.getMedia_audiorec( ));
|
| } catch (javax.naming.NamingException ne){ne.printStackTrace( );}
| }
|
| public static Context getInitialContext( )
| throws javax.naming.NamingException {
|
| Properties p = new Properties( );
| p.put(Context.INITIAL_CONTEXT_FACTORY,
| "org.jnp.interfaces.NamingContextFactory");
| p.put(Context.URL_PKG_PREFIXES,
| "org.jboss.naming:org.jnp.interfaces");
| p.put(Context.PROVIDER_URL, "jnp://localhost:1201");
| return new javax.naming.InitialContext(p);
| }
| }
running:
JBoss [Zion] 4.0.5.GA
xp pro sp2
oracle 10g xe
jdk 1.6.0
& all on same machine, no firewalll
this post refers to jboss remoting - http://www.jboss.org/?module=bb&op=viewtopic&t=90965 -could this be my issue? i'm fairly neew to jboss so dont wanna conflate this by trying to get another framework in Yet, unless, thats what i need to do.... ?
please help!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076449#4076449
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076449
More information about the jboss-user
mailing list