ActiveMQ JNDI Lookup Issues

Trying to get ActiveMQ with JNDI running following ( and i have all the required activeMQ jars in my jboss/server/node/lib folder and my 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( at javax.naming.InitialContext.lookup( at org.jboss.naming.NamingService.startService( at org.jboss.system.ServiceMBeanSupport.jbossInternalStart( at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle( at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( at at at at at at at at at org.jboss.system.ServiceController$ServiceProxy.invoke( at $Proxy0.start(Unknown Source) at org.jboss.system.ServiceController.start( at org.jboss.system.ServiceController.start( at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( at at at at at at at $Proxy4.start(Unknown Source) at org.jboss.deployment.SARDeployer.start( at org.jboss.deployment.MainDeployer.start( at org.jboss.deployment.MainDeployer.deploy( at org.jboss.deployment.MainDeployer.deploy( at org.jboss.deployment.MainDeployer.deploy( at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( at at at at at at at at at at $Proxy5.deploy(Unknown Source) at org.jboss.system.server.ServerImpl.doStart( at org.jboss.system.server.ServerImpl.start( at org.jboss.Main.boot( at org.jboss.Main$ at

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 file and in that file i have standard,


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 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), All Rights Reserved.

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