Results 1 to 1 of 1
  1. #1
    alvandrood is offline Member
    Join Date
    Aug 2008
    Posts
    4
    Rep Power
    0

    Default my problem in client of EJB

    Hello

    I'm new in EJB , I tried to develop my first EJB so I used this document :
    InformIT: Creating a Session Bean > A "Hello World" Session Bean

    I've created an EJB and I deployed it to the application server (Sun application server) like what is written in Sample

    After I deployed the EJB when I refer to "Admin Console" page of Application Server (Sun SDK5) " Application Server -> Applications -> Enterprise Applications" section , in the right page table(Deployed Enterprise Applications table) it shows that HelloWorld in "Application Name" filed True
    in "Enabled" filed and ${com.sun.aas.instanceRoot}/applications/j2ee-apps/HelloWorld in "Location" filed
    I think it shows the EJB deployed successfully (It's image has been attached)

    And I use a stand-alone Client application to use my EJB in follow I've written it's code(but not complete):

    Java Code:
    package usingj2ee.hello;
     
    import java.util.Properties;
     
    import java.util.*;
    import javax.naming.*;
    import javax.rmi.*;
     
     
    public class client {
        public client() {
        }
        public static void main(String[] args) throws Exception{
            Properties env = new Properties(); 
            env.put(Context.INITIAL_CONTEXT_FACTORY, 
              "com.sun.jndi.cosnaming.CNCtxFactory"); 
            env.put(Context.PROVIDER_URL, "iiop://localhost:9010");       
            Context initial = new InitialContext(env); 
     
          ...
     
        }
    }

    when I trace the client code when it run "Context initial = new InitialContext(env)" line it retrun this error (HelloWorldClient.jar the client jar file that produced by deployetool is added to -classpath) :


    Java Code:
    Apr 21, 2010 2:14:14 PM com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 9010"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
    	at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2172)
    	at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2193)
    	at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:205)
    	at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:218)
    	at com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:101)
    	at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
    	at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:118)
    	at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.invoke(BootstrapResolverImpl.java:74)
    	at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.resolve(BootstrapResolverImpl.java:107)
    	at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
    	at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
    	at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
    	at com.sun.corba.se.impl.orb.ORBImpl.resolve_initial_references(ORBImpl.java:1157)
    	at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:340)
    	at com.sun.jndi.cosnaming.CNCtx.initUsingIiopUrl(CNCtx.java:289)
    	at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:245)
    	at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:209)
    	at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:69)
    	at com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.java:32)
    	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
    	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
    	at javax.naming.InitialContext.init(InitialContext.java:223)
    	at javax.naming.InitialContext.<init>(InitialContext.java:197)
    	at usingj2ee.hello.client.main(client.java:18)
    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 java.nio.channels.SocketChannel.open(SocketChannel.java:146)
    	at com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl.createSocket(DefaultSocketFactoryImpl.java:60)
    	at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:188)
    	... 21 more
    Exception in thread "main" javax.naming.CommunicationException: Cannot connect to ORB [Root exception is org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No]
    	at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:362)
    	at com.sun.jndi.cosnaming.CNCtx.initUsingIiopUrl(CNCtx.java:289)
    	at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:245)
    	at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:209)
    	at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:69)
    	at com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.java:32)
    	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
    	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
    at javax.naming.InitialContext.init(InitialContext.java:223)
    at javax.naming.InitialContext.<init>(InitialContext.java:197)
    at usingj2ee.hello.client.main(client.java:18)
    aused by: org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
    at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2172)
    at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2193)
    at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:205)
    at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:218)
    at com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:101)
    at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
    at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:118)
    at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.invoke(BootstrapResolverImpl.java:74)
    at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.resolve(BootstrapResolverImpl.java:107)
    at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
    at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
    at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
    at com.sun.corba.se.impl.orb.ORBImpl.resolve_initial_references(ORBImpl.java:1157)
    at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:340)
    Caused by: java.net.ConnectException: Connection refused: connect
    Do you know the cause of this error ?

    thank you
    Attached Thumbnails Attached Thumbnails my problem in client of EJB-applicationserver.jpg  
    Last edited by alvandrood; 04-21-2010 at 12:55 PM.

Similar Threads

  1. client server problem
    By kievari in forum Advanced Java
    Replies: 4
    Last Post: 02-12-2010, 08:06 AM
  2. Client to Server, ClassNotFound Package Problem
    By pwnzer in forum New To Java
    Replies: 3
    Last Post: 11-07-2009, 09:17 PM
  3. passing info between server/client problem
    By DarkBlaze in forum New To Java
    Replies: 13
    Last Post: 07-24-2008, 03:14 AM
  4. Problem while running web service client
    By krsv36 in forum Other IDEs
    Replies: 0
    Last Post: 05-15-2008, 05:12 PM
  5. client-server communication problem
    By revathi17 in forum New To Java
    Replies: 1
    Last Post: 08-09-2007, 02:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •