Provando la porta 4447 ottengo il seguente errore:

codice:
11:17:52,286 ERROR [stderr] (http-/127.0.0.1:8080-1) javax.naming.CommunicationException: Could not obtain connection to any of these urls: 127.0.0.1:4447 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to retrieve stub from server 127.0.0.1:4447 [Root exception is java.io.StreamCorruptedException: invalid stream header: 0000000C]]
11:17:52,287 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
11:17:52,287 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
11:17:52,287 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
11:17:52,287 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at javax.naming.InitialContext.lookup(InitialContext.java:417)
11:17:52,287 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at com.andrea.servlet.Test1.doGet(Test1.java:45)
11:17:52,288 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
11:17:52,288 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
11:17:52,288 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
11:17:52,288 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
11:17:52,288 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
11:17:52,288 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
11:17:52,289 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
11:17:52,289 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
11:17:52,289 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
11:17:52,289 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
11:17:52,289 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
11:17:52,289 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
11:17:52,289 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
11:17:52,290 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
11:17:52,290 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at java.lang.Thread.run(Thread.java:745)
11:17:52,290 ERROR [stderr] (http-/127.0.0.1:8080-1) Caused by: javax.naming.CommunicationException: Failed to retrieve stub from server 127.0.0.1:4447 [Root exception is java.io.StreamCorruptedException: invalid stream header: 0000000C]
11:17:52,290 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:268)
11:17:52,290 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
11:17:52,291 ERROR [stderr] (http-/127.0.0.1:8080-1) 	... 19 more
11:17:52,291 ERROR [stderr] (http-/127.0.0.1:8080-1) Caused by: java.io.StreamCorruptedException: invalid stream header: 0000000C
11:17:52,291 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:806)
11:17:52,291 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)
11:17:52,292 ERROR [stderr] (http-/127.0.0.1:8080-1) 	at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:255)
11:17:52,292 ERROR [stderr] (http-/127.0.0.1:8080-1) 	... 20 more

Se volessi usare EJB 3 come dovrei implementare le classi?