Announcement Announcement Module
Collapse
No announcement yet.
"Rebinding JNDI object with name" in JndiTemplate after which no response from server Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • "Rebinding JNDI object with name" in JndiTemplate after which no response from server

    I am using Spring 2.0 that shipped with MyEclipse 6.0.0 for the project that i am working on. To begin with i wanted to explore the feasibility of using POJO and exposing it as a service. I am using Oracle Standalone server 9.0.3 for trying things out.

    I started by creating a sample program as follows
    1. Created IAccountService that had 2 methods. addAccount(Account) and removeAccount(Account). (Please note: This interface is not implementing java.rmi.Remote)
    2. Account class is a simple bean with id, name and number as its properties.
    3. Created an AccountManager implementing IAccountService. In the implementation methods i just printed some string to verify that the service methods were called.

    The following is the bean configuration file in the server
    <beans>
    <bean id="accountService" class="com.companyname.AccountManager"/>
    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
    <props>
    <prop key="java.naming.factory.initial">com.evermind.ser ver.rmi.RMIInitialContextFactory</prop>
    <prop key="java.naming.provider.url">ormi://HDCHCTDAM32491/aspen</prop>
    <prop key="java.naming.security.principal">admin</prop>
    <prop key="java.naming.security.credentials">welcome</prop>
    </props>
    </property>
    </bean>
    <bean class="org.springframework.remoting.rmi.JndiRmiSer viceExporter">
    <property name="service">
    <ref bean="accountService"/>
    </property>
    <property name="jndiName">
    <value>AccountService</value>
    </property>
    <property name="jndiTemplate">
    <ref bean="jndiTemplate"/>
    </property>
    <property name="serviceInterface">
    <value>com.companyname.IAccountService</value>
    </property>
    </bean>
    </beans>

    4. In the web.xml i gave the following
    <listener>
    <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
    </listener>

    5. I placed the server bean configuration in the WEB-INF and hence it detected it. Everything is fine till now.
    6. When the server is started all gets loaded and following is the log.

    [2008-03-11 23:58:08,717 org.springframework.core.CollectionFactory - DEBUG]: Creating [java.util.LinkedHashMap]
    [2008-03-11 23:58:08,717 org.springframework.beans.factory.support.DefaultL istableBeanFactory - DEBUG]: Eagerly caching bean 'org.springframework.remoting.rmi.JndiRmiServiceEx porter' to allow for resolving potential circular references
    [2008-03-11 23:58:08,717 org.springframework.beans.factory.support.DefaultL istableBeanFactory - DEBUG]: Returning cached instance of singleton bean 'accountService'
    [2008-03-11 23:58:08,717 org.springframework.core.CollectionFactory - DEBUG]: Creating [java.util.LinkedHashSet]
    [2008-03-11 23:58:08,717 org.springframework.beans.factory.support.DefaultL istableBeanFactory - DEBUG]: Returning cached instance of singleton bean 'jndiTemplate'
    [2008-03-11 23:58:08,717 org.springframework.core.CollectionFactory - DEBUG]: Creating [java.util.LinkedHashSet]
    [2008-03-11 23:58:08,717 org.springframework.beans.TypeConverterDelegate - DEBUG]: Converting String to [class java.lang.Class] using property editor [org.springframework.beans.propertyeditors.ClassEdi tor@1ab11b0]
    [2008-03-11 23:58:08,717 org.springframework.remoting.rmi.JndiRmiServiceExp orter - DEBUG]: RMI service [com.gmpt.core.AccountManager@165b7e] is an RMI invoker
    [2008-03-11 23:58:08,779 org.springframework.core.CollectionFactory - DEBUG]: Creating [java.util.IdentityHashMap]
    [2008-03-11 23:58:09,170 org.springframework.aop.framework.JdkDynamicAopPro xy - DEBUG]: Creating JDK dynamic proxy: target source is SingletonTargetSource for target object [com.gmpt.core.AccountManager@165b7e]
    [2008-03-11 23:58:09,248 org.springframework.remoting.rmi.JndiRmiServiceExp orter - INFO]: Binding RMI service to JNDI location [AccountService]
    [2008-03-11 23:58:09,248 org.springframework.jndi.JndiTemplate - DEBUG]: Rebinding JNDI object with name [AccountService]

    After this there is no response. No Log... nothing.. The log never rolls beyond this.
    What could be the probable cause. Someone please help me on this
Working...
X