4 Replies Latest reply on Nov 18, 2013 3:49 AM by Andy Taylor

    HornetQ implementation in Spring application

    ananymous7239 Newbie

      Hi i am new to hornetQ,and i want to implement hornetQ in my Sms application,so i started by trying this example

      code which is shown in the link http://howtodoinjava.com/2013/03/24/spring-3-hornetq-standalone-integration-example/,but i am

      getting an exception when running the main method ,please some experts guide me how to implement HornetQ properly.

       

      Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'namingServerImpl' defined in file [F:\HornetQ Workspace\Spring3HornetQStandaloneIntegration\resource\config\server\spring.xml]: Invocation of init method failed; nested exception is javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)

          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)

          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)

          at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)

          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)

          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)

          at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)

          at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:84)

          at com.howtodoinjava.hornetq.demo.SpringContainerLoader.loadEnvironment(SpringContainerLoader.java:9)

          at com.howtodoinjava.hornetq.demo.HornetQMessagingTest.main(HornetQMessagingTest.java:10)

      Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial

          at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)

          at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)

          at javax.naming.InitialContext.getEnvironment(Unknown Source)

          at org.jnp.server.NamingBeanImpl.start(NamingBeanImpl.java:160)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1544)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)

          ... 13 more

       

      Thanks in advance

      gopal