I have communication ( may be JNDI ?) problems even by testing the simplest EJB program My Ejb Bean:
@Stateless(name = "Test1") | public class Test1 implements Test1Remote { | | /** | * Default constructor. | */ | public Test1() { | // TODO Auto-generated constructor stub | } | | public String echo (String str){ | System.out.println("Test1:echo str ="+str); | return str; | } My Remote: @Remote | public interface Test1Remote { | | public String echo (String str); | | } My Client: public class Main { | public static void main(String[] args) { | try { | InitialContext ctx = CmsEjbUtil.getInitialCotext(); | Test1Remote dao = (Test1Remote) ctx.lookup("Test1/remote"); | String str =dao.echo("Hello World"); | System.out.println(str); | } catch (NamingException e) { | | e.printStackTrace(); | } | | } CmsEjbUtil.getInitialCotext() : | public static InitialContext getInitialCotext() throws NamingException { | Hashtable props = new Hashtable<String, String>(); | props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); | props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); | props.put("java.naming.provider.url", "jnp://localhost:1099"); | return new InitialContext(props); | } but when I run client I get the following stack trace: | javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 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 connect to server localhost/0:0:0:0:0:0:0:1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost/0:0:0:0:0:0:0:1:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]] | at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1725) | at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:689) | at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682) | at javax.naming.InitialContext.lookup(Unknown Source) | at Main.main(Main.java:14) | Caused by: javax.naming.CommunicationException: Failed to connect to server localhost/0:0:0:0:0:0:0:1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost/0:0:0:0:0:0:0:1:1099 [Root exception is java.net.ConnectException: Connection refused: connect]] | at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:331) | at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1696) | ... 4 more | Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost/0:0:0:0:0:0:0:1:1099 [Root exception is java.net.ConnectException: Connection refused: connect] | at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:301) | ... 5 more | Caused by: java.net.ConnectException: Connection refused: connect | at java.net.PlainSocketImpl.socketConnect(Native Method) | at java.net.PlainSocketImpl.doConnect(Unknown Source) | at java.net.PlainSocketImpl.connectToAddress(Unknown Source) | at java.net.PlainSocketImpl.connect(Unknown Source) | at java.net.SocksSocketImpl.connect(Unknown Source) | at java.net.Socket.connect(Unknown Source) | at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:97) | at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:82) | at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:297) | ... 5 more When my server don't get any request from client. While boot of jboss 5.0.1 I got some errors that first error that I've got is: | 12:22:42,206 DEBUG [ProfileServiceBootstrap] Failed to build ManagedDeployment for: abstractkerneldeploym...@18ddc48{name=file:/C:/AS/jboss-5.0.1.GA/server/default/conf/bootstrap/vfs.xml installed=true beanfactories=[abstractbeanmetad...@12bbe6b{name=vfscache bean=null properties=[realCache, permanentRoots] constructor=abstractconstructormetad...@1347124{parameters=[null] factoryClass=org.jboss.virtual.spi.cache.VFSCacheFactory factoryMethod=getInstance} autowireCandidate=true start=abstractlifecyclemetad...@1f02b85{ whenrequired=controllerst...@e28a61{start} parameters= }}, abstractbeanmetad...@146ee9c{name=vfsnamesexceptionhandler bean=org.jboss.virtual.plugins.context.helpers.NamesExceptionHandler properties= constructor=abstractconstructormetad...@1db52c8{parameters=[java.lang.string]} autowireCandidate=true}]} | org.jboss.deployers.spi.DeploymentException: Error deploying: file:/C:/AS/jboss-5.0.1.GA/server/default/conf/bootstrap/vfs.xml | at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) | at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.deploy(BeanMetaDataFactoryVisitor.java:136) | at org.jboss.system.server.profileservice.ProfileServiceBootstrap.initBootstrapMDs(ProfileServiceBootstrap.java:453) | at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:199) | at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405) | at org.jboss.Main.boot(Main.java:209) | at org.jboss.Main$1.run(Main.java:547) | at java.lang.Thread.run(Thread.java:595) | Caused by: java.lang.IllegalStateException: ClassLoader has not been set | at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit.getClassLoader(AbstractDeploymentUnit.java:152) | at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.addBeanComponent(BeanMetaDataFactoryVisitor.java:60) | at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.deploy(BeanMetaDataFactoryVisitor.java:126) | ... 6 more Could it be the prooblems stems from my OS Vista? Please help. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4216909#4216909 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4216909 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user