0 Replies Latest reply on Apr 20, 2010 6:41 AM by Prakash M

    Jboss 5.1 javax.naming.NameNotFoundException: mands not bound

    Prakash M Novice

      I have an ear file, which contains the mbean (registerd to jmx clinet) to peridocally perform the updates from database, this was working fine with jboss 4.2.3, when we migrated to jboss 5.1 this is throwing the following exception while deploying,

       

      ERROR [AbstractKernelController] Error installing to Start: name=mands:service=PacketSender state=Create mode=Manual requiredState=Installed
      java.lang.reflect.InvocationTargetException
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          ...
          at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
          at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
          at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
          at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
          at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
          at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
          at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
          at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
          at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
          at org.jboss.Main.boot(Main.java:221)
          at org.jboss.Main$1.run(Main.java:556)
          at java.lang.Thread.run(Thread.java:619)
      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dao' defined in class path resource [com/mands/server/jmx/packetsender/PacketSender.appctx.xml]: Can't resolve reference to bean 'sessions' while setting property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessions' defined in class path resource [com/mands/server/jmx/packetsender/PacketSender.appctx.xml]: Initialization of bean failed; nested exception is javax.naming.NameNotFoundException: mands not bound
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:180)
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:105)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1012)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:823)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:345)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
          at com.mands.server.jmx.packetsender.PacketSender.start(PacketSender.java:235)
          ... 61 more
      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessions' defined in class path resource [com/mands/server/jmx/packetsender/PacketSender.appctx.xml]: Initialization of bean failed; nested exception is javax.naming.NameNotFoundException: mands not bound
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:370)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:176)
          ... 68 more
      Caused by: javax.naming.NameNotFoundException: mands not bound
          at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
          at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
          at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
          at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:125)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1058)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
          ... 71 more

       

       

      Following is the PacketSender.appctx.xml file which am using

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

       

      <beans>

       

          <bean id="sessions">
              <property name="jndiName" value="java:/mands/packetSender/hibernate/sessionFactory" />
          </bean>
         
          <bean id="dao">
              <property name="sessionFactory" ref="sessions" />
          </bean>
         
      </beans>

       

      It would be helpfull, if anyone provide hints on the above issue?

       

      Regards,

      Prakash