WARNING: ACC010: wrong server port or invalid name?
843833Apr 28 2004 — edited May 4 2004I'm using J2EE(TM) Application Server 1.4 Developer Release (build b44-dr), AS8 of course.
I was trying to migrate a CMP program from weblogic6.
I finally successfully deployed the jar module.
However, I always had problem with the client side.
I pack these files in the application cliend jar file (without deplying it to the server):
application-client.xml, sun-application-client.xml, sun-acc.xml, bean remote interface class, bean home interface class, client class
and start from the command line:
appclient -client myclient.jar
but always got the error that follows. I'm longing to death hints. :( Thanks!
Here is how I lookup the home interface in Client.java:
Context initial = new InitialContext();
Context myEnv = (Context)initial.lookup("java:comp/env");
try {
Object home = (AccountHome) myEnv.lookup("ejb/AccountBean");
return (AccountHome) PortableRemoteObject.narrow(home, AccountHome.class);
}
In the descriptors:
sun-ejb-jar.xml: <jndi-name>AccountBean</jndi-name>
application-client.xml: <ejb-ref-name>ejb/AccountBean</ejb-ref-name>
sun-application-client.xml: <ejb-ref-name>ejb/AccountBean</ejb-ref-name>
sun-application-client.xml: <jndi-name>ejb/AccountBean</jndi-name>
// also tried with >>> sun-application-client.xml: <jndi-name>AccountBean</jndi-name>
The migration guide (from EJB 1.1 to 2) "http://docs.sun.com/source/817-6089/mg_appendixC.html" says that:
In Sun Java System Application Server Platform Edition 8, EJBs are systematically mapped to the JNDI sub-context "ejb/". If we attribute the JNDI name "Account" to an EJB, then Sun Java System Application Server Platform Edition 8 will automatically create the reference "ejb/Account" in the global JNDI context. The clients of this EJB will therefore have to look up "ejb/Account" to retrieve the corresponding home interface.
It puzzles me a little bit. I don't know if the error in my client is related to it. Anyway, here are the error messages:
$ appclient -client myclient.jar
Apr 28, 2004 8:15:56 PM com.sun.corba.ee.impl.legacy.connection.SocketFactoryConnectionImpl <init>
WARNING: ORBUTIL.connectFailure
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:1739)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:1757)
at com.sun.corba.ee.impl.legacy.connection.SocketFactoryConnectionImpl.<init>(SocketFactoryConnectionImpl.java:74)
at com.sun.corba.ee.impl.legacy.connection.SocketFactoryContactInfoImpl.createConnection(SocketFactoryContactInfoImpl.java:88)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:146)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:121)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:212)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:345)
at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:237)
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:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at com.sun.enterprise.naming.NamingManagerImpl.<init>(NamingManagerImpl.java:120)
at com.sun.enterprise.appclient.AppContainer.preInvoke(AppContainer.java:127)
at com.sun.enterprise.appclient.Main.<init>(Main.java:360)
at com.sun.enterprise.appclient.Main.main(Main.java:105)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:390)
at com.sun.corba.ee.impl.legacy.connection.SocketFactoryConnectionImpl.<init>(SocketFactoryConnectionImpl.java:58)
... 18 more
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:460)
at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:381)
... 19 more
Apr 28, 2004 8:15:56 PM com.sun.enterprise.appclient.Main <init>
WARNING: ACC003: Application threw an exception.
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.initOrbAndRootContext(CNCtx.java:237)
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:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at com.sun.enterprise.naming.NamingManagerImpl.<init>(NamingManagerImpl.java:120)
at com.sun.enterprise.appclient.AppContainer.preInvoke(AppContainer.java:127)
at com.sun.enterprise.appclient.Main.<init>(Main.java:360)
at com.sun.enterprise.appclient.Main.main(Main.java:105)
Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:1739)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:1757)
at com.sun.corba.ee.impl.legacy.connection.SocketFactoryConnectionImpl.<init>(SocketFactoryConnectionImpl.java:74)
at com.sun.corba.ee.impl.legacy.connection.SocketFactoryContactInfoImpl.createConnection(SocketFactoryContactInfoImpl.java:88)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:146)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:121)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:212)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:345)
... 11 more
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:390)
at com.sun.corba.ee.impl.legacy.connection.SocketFactoryConnectionImpl.<init>(SocketFactoryConnectionImpl.java:58)
... 18 more
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:460)
at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:381)
... 19 more
Apr 28, 2004 8:15:56 PM com.sun.enterprise.appclient.Main <init>
WARNING: ACC010: Make sure the server port is not disabled and that you are looking up a valid name
$