ActiveMQ JNDI Lookup Issues

Trying to get ActiveMQ with JNDI running following (http://activemq.apache.org/jndi-support.html) and i have all the required activeMQ jars in my jboss/server/node/lib folder and my jndi.properties looks like:

java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory # use the following property to configure the default connector java.naming.provider.url = vm://localhost # use the following property to specify the JNDI name the connection factory # should appear as. #connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry connectionFactoryNames = connectionFactory # register some queues in JNDI using the form # queue.[jndiName] = [physicalName] queue.MyQueue = TESTQUEUE # register some topics in JNDI using the form # topic.[jndiName] = [physicalName] topic.MyTopic = example.MyTopic

and have following piece of code in producer which actually produces the call:

InitialContext ic = null; ConnectionFactory factory = null; Connection con = null; Session session = null; Queue queue = null; MessageProducer producer = null; ic = new InitialContext(); factory = (ConnectionFactory) ic.lookup("connectionFactoryNames"); con = factory.createConnection(); session = con.createSession(false, Session.AUTO_ACKNOWLEDGE); queue = (Queue)ic.lookup("queue/TESTQUEUE"); producer = session.createProducer(queue); // Then... send the message. producer.send(session.createObjectMessage(new Long(Id)));

and here is the exception am getting, not sure what does it mean by scheme java not recognized

WARN org.jboss.system.ServiceController - Problem starting service jboss:service=Naming javax.naming.NamingException: scheme java not recognized at org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:221) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.jboss.naming.NamingService.startService(NamingService.java:274) at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) at $Proxy0.start(Unknown Source) at org.jboss.system.ServiceController.start(ServiceController.java:417) at org.jboss.system.ServiceController.start(ServiceController.java:435) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy4.start(Unknown Source) at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302) at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy5.deploy(Unknown Source) at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482) at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362) at org.jboss.Main.boot(Main.java:200) at org.jboss.Main$1.run(Main.java:490) at java.lang.Thread.run(Thread.java:662)

This question moved me in proper direction: ActiveMQInitialContextFactory vs. NamingContextFactory

-------------Problems Reply------------

I was able to get it up and running, issue was that i had one jndi.properties file and in that file i have standard,

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

and as we were already using jndi in our application, i could not go ahead an modify files present here and also cannot add my activemq related changes in here and so solution was to create different jndi.properties file for activemq and get new initialcontext to it as mentioned in ActiveMQInitialContextFactory vs. NamingContextFactory and other thing had to make sure is that i have same broker information for both producer and sender side, which is obvious and it worked fine.

Adding information so that next time someone lands up on this question then he or she does not have to spend time which i have already spend figuring this thing out. Hope this would help.

Category:java Views:1 Time:2011-12-15

Related post

  • Tomcat vs Weblogic JNDI Lookup 2008-09-06

    The Weblogic servers we are using have been configured to allow JNDI datasource names like "appds". For development (localhost), we might be running Tomcat and when declared in the <context> section of server.xml, Tomcat will hang JNDI datasour

  • Why is my JNDI lookup for a QueueConnectionFactory returning null? 2009-08-26

    I am trying to look up a QueueConnectionFactory and Queue via Geronimo's JNDI. The Queue gets returned fine, but the QueueConnectionFactory lookup always returns null. It doesn't throw a NamingException, which is what I'd expect if the JNDI name was

  • Resolve JNDI lookups from Spring application context? 2009-08-27

    In our Spring application we use clustered Hibernate Search with ActiveMQ which sets up some objects via JNDI. These objects are configured via the Spring application context and I am looking for a way to resolve JNDI calls to these objects. All I co

  • JNDI lookup of EJB3 inside an EAR file on Glassfish 2009-10-06

    I have an EAR file with a bunch of JARs in it, and one of these JARs contains Local Session Beans (EJB3). I need to perform a JNDI lookup of these Session Beans from within an unmanaged POJO, also contained in the EAR (and in this case in the same JA

  • EJB3 beans JNDI lookup in Websphere 7 2010-08-20

    I have created an EAR with a web project, ejb3 project and the ejb client. I'm able to call the bean methods via injection in the servlet. I'm planning to use a ServiceDelegate which is a pojo to handle the bean invocation. So I'll call the delegate

  • Performing a JNDI lookup in a JAXB XmlAdapter 2011-10-12

    My project is a Java Enterprise project and consists of three modules: Assembly (EAR) EJB (JAR) Web (WAR) My domain model resides in the EJB. This includes a Manufacturer class and a Model class. A one-to-many relationship exists between the two. I e

  • The JNDI lookup for the JTA UserTransaction is not available to MBean threads in Websphere Application Server 7 2011-12-01

    I'm trying to invoke business logic via JMX (using 'standard' MBeans) in a web application in Websphere Application Server 7 with JTA switched on and would like to know why this business logic can't see the JTA UserTransaction when invoked from an MB

  • activemq jndi tomcat error 2011-12-16

    I am trying to use ActiveMQ via JNDI, deploying the application in Tomcat 7.0 server. I have made the settings for ActiveMQ connection factory and queue in Tomcat context.xml configuration file, and they look like this: <Resource auth="Container"

  • JNDI lookup of a datasource in JBoss 7.0.2 resulting in a NameNotFoundException 2012-02-16

    I'm having some issues getting a JNDI lookup of a datasource in JBoss 7.0.2 to work properly. Basically, this application is one that should be deployable across multiple application servers, so I'd like to adhere to appropriate standards. The applic

  • Does Jboss 7 support remote jndi lookups from a remote client 2012-03-02

    I have custom components that are standalone java components that do not run within the Jboss application server. These components need to interface with a HornetQ JMS queue which runs inside of AS7. Looking at the Jboss AS 7 documentation, there see

  • Jndi lookup in junit using spring 2012-03-14

    How can I lookup Jndi name in junit test class? I do not want to use separate configration file for junit and not giving datasource properties? I specifically need to do jndi lookup in my test class. --------------Solutions------------- If you are us

  • JNDI lookup from Applet to JBoss on EC2 instance 2012-05-02

    I have JBoss 4.0.4.GA running on a Linux Amazon EC2 instance. I connect to a URL from my browser that maps to a JSP that downloads an Applet. The Applet code does a JNDI lookup for a Session Bean. The error I am seeing on my browser's Java console is

  • EJB JNDI lookup on different WebSphere servers 2009-08-11

    I have two separate installs of WebSphere. (Actually one is WebSphere Application Server V6.1 with EJB 3.0 and Web Services feature packs, and the other server is WebSphere ESB Server V6.2). However, I know that ESB is really built on top of WAS, so

  • Maven profiles basic datasource, jee:jndi-lookup 2009-12-08

    I have a project with spring and maven. I found that using profiles, maven could change the properties of the data source. But what if in production the datasource is with a lookup like this, how to do the profiles for this: one with a basic datasour

  • EJB JNDI lookup from GWT development mode into glassfish v3 2010-02-01

    I am trying to perform a JNDI-lookup from within the GWT devmode. I have a local glassfishv3 running the EJBs I want to look up. If i deploy the GWT-Webapp into said glassfish everything works as expected. But if I try to look up the EJBs from within

  • By using ejb3 and jsf do I still have to do jndi lookup? 2010-04-29

    I am not sure jndi lookup is necessary or not in terms of ejb3 technology advantages. Any help would be appreciated, thanks. --------------Solutions------------- Yes you need to. But you can use annotations for this. @EJB private BeanInterface yourbe

  • EJB3 JNDI Lookup Failure in Java EE application client 2010-04-29

    I'm trying to access an EJB3 from a Java EE client-application, but keep getting nothing but lookup failures. The client application is running within the Java EE Application Client Container. My Java EE Application 'CoreServer' is exposing a number

  • Spring JndiTemplate and parameterized JNDI lookup from context 2010-05-27

    How can I represent new JndiTemplate(properties).lookup(name), where name is a string variable, in the Spring application context file? Can I express it in a way similar to the following, where the application provides name when it retrieves the bean

  • Remote EJB lookup issue with WebSphere 6.1 2010-06-09

    I've seen this question asked before, but I've tried various solutions proposed, to no avail. Essentially, I have two EJB enterprise applications, that need to communicate with one another. The first is a web application, the second is a search serve

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.184 (s). 11 q(s)