Announcement Announcement Module
Collapse
No announcement yet.
I get a problem with JndiRmiServiceExporter! Please HELP Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • I get a problem with JndiRmiServiceExporter! Please HELP

    here is my config file[bean.xml]:
    Code:
    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate"> 
                    <property name="environment"> 
                         <props>
    						 <prop key="java.naming.factory.initial">com.sun.jndi.cosnaming.CNCtxFactory</prop>
    						 <prop key="java.naming.provider.url">iiop&#58;//localhost&#58;55555</prop>
    		 			</props>
                    </property> 
            </bean>
    	<bean id="iiop" class="org.springframework.remoting.rmi.JndiRmiServiceExporter">
    		<property name="jndiTemplate">
     	 		<ref bean="jndiTemplate"/>
     		</property>
     		<property name="jndiName">
     			<value>helloService</value>
     		</property>
     		<property name="service">
     			<ref bean="hello"/>
     		</property>
    	</bean>
    
    	<bean id="hello" class="net.fox.HelloImpl"/>
    Here is my Class:
    Code:
    package net.fox;
    
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    
    /**
     * @author Administrator
     *
     * TODO To change the template for this generated type comment go to
     * Window - Preferences - Java - Code Style - Code Templates
     */
    public interface Hello extends Remote &#123;
    	String sayHello&#40;String name&#41; throws RemoteException;
    &#125;
    
    
    
    ///--
    package net.fox;
    
    import java.rmi.RemoteException;
    import java.rmi.server.RemoteObject;
    import java.rmi.server.RemoteRef;
    
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    
    
    
    /**
     * @author Administrator
     *
     * TODO To change the template for this generated type comment go to
     * Window - Preferences - Java - Code Style - Code Templates
     */
    public class HelloImpl extends RemoteObject implements Hello &#123;
    
    	/**
    	 * 
    	 */
    	protected static final Log log = LogFactory.getLog&#40;HelloImpl.class&#41;;
    	public HelloImpl&#40;&#41; &#123;
    		super&#40;&#41;;
    		// TODO Auto-generated constructor stub
    	&#125;
    
    	/**
    	 * @param arg0
    	 */
    	public HelloImpl&#40;RemoteRef arg0&#41; &#123;
    		super&#40;arg0&#41;;
    		// TODO Auto-generated constructor stub
    	&#125;
    
    	/* &#40;non-Javadoc&#41;
    	 * @see net.fox.Hello#sayHello&#40;java.lang.String&#41;
    	 */
    	public String sayHello&#40;String name&#41; throws RemoteException &#123;
    		// TODO Auto-generated method stub
    		//log.info&#40;"我在RMI的服务器端,客户端正在调用'sayHello'方法。 "&#41;;
            log.info&#40;"Hello  " + name&#41;;
    
    		return "hello" + name;
    	&#125;
    
    &#125;
    
    
    ////---Main
    import org.springframework.context.ApplicationContext;
    import org.springframework.context.support.FileSystemXmlApplicationContext;
    import org.springframework.remoting.rmi.JndiRmiServiceExporter;
    
    
    public class Main &#123;
    
    	public static void main&#40;String&#91;&#93; args&#41; &#123;
    		ApplicationContext ac = new FileSystemXmlApplicationContext&#40;"bean.xml"&#41;;
    		JndiRmiServiceExporter iiop =&#40;JndiRmiServiceExporter&#41;ac.getBean&#40;"iiop"&#41;;
    	&#125;
    &#125;

    Here is error Message:

    Code:
    2005-7-13 9&#58;40&#58;40 com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl <init>
    警告&#58; "IOP00410201&#58; &#40;COMM_FAILURE&#41; Connection failure&#58; socketType&#58; IIOP_CLEAR_TEXT; hostname&#58; localhost; port&#58; 55555"
    org.omg.CORBA.COMM_FAILURE&#58;   vmcid&#58; SUN  minor code&#58; 201  completed&#58; No
    	at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl.createConnection&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.request&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.invoke&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.resolve&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.orb.ORBImpl.resolve_initial_references&#40;Unknown Source&#41;
    	at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext&#40;Unknown Source&#41;
    	at com.sun.jndi.cosnaming.CNCtx.initUsingIiopUrl&#40;Unknown Source&#41;
    	at com.sun.jndi.cosnaming.CNCtx.initUsingUrl&#40;Unknown Source&#41;
    	at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext&#40;Unknown Source&#41;
    	at com.sun.jndi.cosnaming.CNCtx.<init>&#40;Unknown Source&#41;
    	at com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext&#40;Unknown Source&#41;
    	at javax.naming.spi.NamingManager.getInitialContext&#40;Unknown Source&#41;
    	at javax.naming.InitialContext.getDefaultInitCtx&#40;Unknown Source&#41;
    	at javax.naming.InitialContext.init&#40;Unknown Source&#41;
    	at javax.naming.InitialContext.<init>&#40;Unknown Source&#41;
    	at org.springframework.jndi.JndiTemplate.createInitialContext&#40;JndiTemplate.java&#58;105&#41;
    	at org.springframework.jndi.JndiTemplate.execute&#40;JndiTemplate.java&#58;83&#41;
    	at org.springframework.jndi.JndiTemplate.rebind&#40;JndiTemplate.java&#58;184&#41;
    	at org.springframework.remoting.rmi.JndiRmiServiceExporter.afterPropertiesSet&#40;JndiRmiServiceExporter.java&#58;93&#41;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods&#40;AbstractAutowireCapableBeanFactory.java&#58;962&#41;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean&#40;AbstractAutowireCapableBeanFactory.java&#58;354&#41;
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean&#40;AbstractBeanFactory.java&#58;223&#41;
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean&#40;AbstractBeanFactory.java&#58;147&#41;
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons&#40;DefaultListableBeanFactory.java&#58;277&#41;
    	at org.springframework.context.support.AbstractApplicationContext.refresh&#40;AbstractApplicationContext.java&#58;312&#41;
    	at org.springframework.context.support.FileSystemXmlApplicationContext.<init>&#40;FileSystemXmlApplicationContext.java&#58;82&#41;
    	at org.springframework.context.support.FileSystemXmlApplicationContext.<init>&#40;FileSystemXmlApplicationContext.java&#58;67&#41;
    	at org.springframework.context.support.FileSystemXmlApplicationContext.<init>&#40;FileSystemXmlApplicationContext.java&#58;58&#41;
    	at Main.main&#40;Main.java&#58;21&#41;
    Caused by&#58; java.net.ConnectException&#58; Connection refused&#58; connect
    	at sun.nio.ch.Net.connect&#40;Native Method&#41;
    	at sun.nio.ch.SocketChannelImpl.connect&#40;Unknown Source&#41;
    	at java.nio.channels.SocketChannel.open&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl.createSocket&#40;Unknown Source&#41;
    	... 35 more
    Exception in thread "main" org.springframework.beans.factory.BeanCreationException&#58; Error creating bean with name 'iiop' defined in file &#91;C&#58;\eclipse\workspace\iiop\bean.xml&#93;&#58; Initialization of bean failed; nested exception is javax.naming.CommunicationException&#58; Cannot connect to ORB
    javax.naming.CommunicationException&#58; Cannot connect to ORB &#91;Root exception is org.omg.CORBA.COMM_FAILURE&#58;   vmcid&#58; SUN  minor code&#58; 201  completed&#58; No&#93;
    	at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext&#40;Unknown Source&#41;
    	at com.sun.jndi.cosnaming.CNCtx.initUsingIiopUrl&#40;Unknown Source&#41;
    	at com.sun.jndi.cosnaming.CNCtx.initUsingUrl&#40;Unknown Source&#41;
    	at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext&#40;Unknown Source&#41;
    	at com.sun.jndi.cosnaming.CNCtx.<init>&#40;Unknown Source&#41;
    	at com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext&#40;Unknown Source&#41;
    	at javax.naming.spi.NamingManager.getInitialContext&#40;Unknown Source&#41;
    	at javax.naming.InitialContext.getDefaultInitCtx&#40;Unknown Source&#41;
    	at javax.naming.InitialContext.init&#40;Unknown Source&#41;
    	at javax.naming.InitialContext.<init>&#40;Unknown Source&#41;
    	at org.springframework.jndi.JndiTemplate.createInitialContext&#40;JndiTemplate.java&#58;105&#41;
    	at org.springframework.jndi.JndiTemplate.execute&#40;JndiTemplate.java&#58;83&#41;
    	at org.springframework.jndi.JndiTemplate.rebind&#40;JndiTemplate.java&#58;184&#41;
    	at org.springframework.remoting.rmi.JndiRmiServiceExporter.afterPropertiesSet&#40;JndiRmiServiceExporter.java&#58;93&#41;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods&#40;AbstractAutowireCapableBeanFactory.java&#58;962&#41;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean&#40;AbstractAutowireCapableBeanFactory.java&#58;354&#41;
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean&#40;AbstractBeanFactory.java&#58;223&#41;
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean&#40;AbstractBeanFactory.java&#58;147&#41;
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons&#40;DefaultListableBeanFactory.java&#58;277&#41;
    	at org.springframework.context.support.AbstractApplicationContext.refresh&#40;AbstractApplicationContext.java&#58;312&#41;
    	at org.springframework.context.support.FileSystemXmlApplicationContext.<init>&#40;FileSystemXmlApplicationContext.java&#58;82&#41;
    	at org.springframework.context.support.FileSystemXmlApplicationContext.<init>&#40;FileSystemXmlApplicationContext.java&#58;67&#41;
    	at org.springframework.context.support.FileSystemXmlApplicationContext.<init>&#40;FileSystemXmlApplicationContext.java&#58;58&#41;
    	at Main.main&#40;Main.java&#58;21&#41;
    Caused by&#58; org.omg.CORBA.COMM_FAILURE&#58;   vmcid&#58; SUN  minor code&#58; 201  completed&#58; No
    	at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure&#40;Unknown Source&#41;2005-07-13 09&#58;40&#58;40,312 INFO &#91;org.springframework.beans.factory.support.DefaultListableBeanFactory&#93; - Destroying singletons in factory &#123;org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans &#91;jndiTemplate,iiop,hello&#93;; root of BeanFactory hierarchy&#125;
    
    	at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl.createConnection&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.request&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.invoke&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.resolve&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.orb.ORBImpl.resolve_initial_references&#40;Unknown Source&#41;
    	... 24 more
    Caused by&#58; java.net.ConnectException&#58; Connection refused&#58; connect
    	at sun.nio.ch.Net.connect&#40;Native Method&#41;
    	at sun.nio.ch.SocketChannelImpl.connect&#40;Unknown Source&#41;
    	at java.nio.channels.SocketChannel.open&#40;Unknown Source&#41;
    	at com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl.createSocket&#40;Unknown Source&#41;
    	... 35 more

    What is the problem?? Please Help me!

  • #2
    Do you have the CORBA ORB running on port 55555?

    Rob

    Comment

    Working...
    X