You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by fbcyborg <fb...@gmail.com> on 2012/11/01 19:01:09 UTC

Help configuring ActiveMQ as JMSProvider in WebSphere

Hello, 

I am running ActiveMQ 5.7.0 on Linux and I created a Queue named
"jms/systemMessageQueue" through the web interface.
Since I am developing J2EE applications I use IBM Websphere (6.1 or 7) to
deploy my Servlets.

I wrote a Servlet that fails after this line:

Queue queue = (Queue) jndiContext.lookup("jms/systemMessageQueue");

This is the exception:
com.ibm.websphere.naming.CannotInstantiateObjectException: Exception
occurred while the JNDI NamingManager was processing a
javax.naming.Reference object. [Root exception is
javax.naming.NoInitialContextException: Failed to create InitialContext
using factory specified in hashtable
{java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQWASInitialContextFactory,
com.ibm.websphere.naming.hostname.normalizer=com.ibm.ws.naming.util.DefaultHostnameNormalizer,
com.ibm.websphere.naming.name.syntax=jndi,
com.ibm.websphere.naming.namespace.connection=eager,
com.ibm.ws.naming.ldap.ldapinitctxfactory=com.sun.jndi.ldap.LdapCtxFactory,
com.ibm.websphere.naming.jndicache.cacheobject=populated,
com.ibm.websphere.naming.namespaceroot=defaultroot,
com.ibm.ws.naming.implementation=WsnIpCos,
com.ibm.ws.naming.wsn.factory.initial=com.ibm.ws.naming.util.WsnInitCtxFactory,
com.ibm.websphere.naming.jndicache.maxcachelife=0,
com.ibm.websphere.naming.jndicache.maxentrylife=0,
java.naming.connectionFactoryNames=jms/queueConnectionFactory,
java.naming.provider.url=tcp://localhost:61616,
com.ibm.websphere.naming.jndicache.cachename=providerURL,
java.naming.factory.url.pkgs=com.ibm.ws.naming:com.ibm.ws.runtime:com.ibm.iscportal.jndi:com.ibm.ws.naming:com.ibm.ws.naming,
java.naming.queue=jms/systemMessageQueue} [Root exception is
java.lang.StringIndexOutOfBoundsException: String index out of range: 18]]

I don't understand why it says "String index out of range: 18". 

This is the configuration I use on WAS:

Resources->JMS->JMS Providers:
        Name: ActiveMQ
        External initial context factory:
org.apache.activemq.jndi.ActiveMQWASInitialContextFactory
        External provider URL: tcp://localhost:61616
        Custom Properties: 
                Name: java.naming.connectionFactoryNames; Value:
jms/queueConnectionFactory 
                Name: java.naming.queue; Value: jms/systemMessageQueue
Resources->JMS->Queue Connection Factories:
        Name: Queue Connection Factory
        JNDI Name: jms/QueueConnectionFactory
        External JNDI Name: jms/QueueConnectionFactory
        Provider: ActiveMQ
Resources->JMS->Queues
        Name: System Message Queue
        JNDI Name: jms/systemMessageQueue
        External JNDI Name: jms/systemMessageQueue
        Provider: ActiveMQ

The directory /opt/IBM/WebSphere/AppServer/lib/ext/ contains the following
jar files:
- activeio-core-3.1.4.jar
- activemq-core-5.7.0.jar

I don't know if there is something wrong within the configuration or not,
but I think so.
Could somebody help me to solve this problem when trying to connect to the
queue?



--
View this message in context: http://activemq.2283324.n4.nabble.com/Help-configuring-ActiveMQ-as-JMSProvider-in-WebSphere-tp4658603.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Help configuring ActiveMQ as JMSProvider in WebSphere

Posted by fbcyborg <fb...@gmail.com>.
gtully wrote
> the actievmq initial context is just a hash map, it does not query the
> broker to find destinaitons.
> so either you configure the hashmap via properties or you do a lookup
> in the dynamicQueues context and it will return what ever you ask for.
> 
> eg:
> 
> Queue queue = (Queue)
> jndiContext.lookup("dynamicQueues/jms/systemMessageQueue");

Hi!

Thank you for replying.
Well, I've tried what you suggested but apart from the fact that I am not
using dynamically created queues because they are already defined in
ActiveMQ, I tried to write: 
/queue = (Queue)jndiContext.lookup("dynamicQueues/jms/systemMessageQueue");/
but this seems to be not working as well.

This is the exception I get:
/[11/10/12 18:59:14:428 CET] 00000026 SystemErr     R
javax.naming.NameNotFoundException: Context:
Z21X9ENode01Cell/nodes/Z21X9ENode01/servers/server1, name:
dynamicQueues/jms/systemMessageQueue: First component in name
dynamicQueues/jms/systemMessageQueue not found. [Root exception is
org.omg.CosNaming.NamingContextPackage.NotFound:
IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]/

Cheers



--
View this message in context: http://activemq.2283324.n4.nabble.com/Help-configuring-ActiveMQ-as-JMSProvider-in-WebSphere-tp4658603p4659164.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Help configuring ActiveMQ as JMSProvider in WebSphere

Posted by Gary Tully <ga...@gmail.com>.
the actievmq initial context is just a hash map, it does not query the
broker to find destinaitons.
so either you configure the hashmap via properties or you do a lookup
in the dynamicQueues context and it will return what ever you ask for.

eg:

Queue queue = (Queue)
jndiContext.lookup("dynamicQueues/jms/systemMessageQueue");


or in jndi.properties add:

# register some queues in JNDI using the form
# queue.[jndiName] = [physicalName]
queue.jms/systemMessageQueue = jms/systemMessageQueue

It may be that the use of / in the queue name will be problematic. not sure.

Some more detail at:
http://activemq.apache.org/jndi-support.html

On 8 November 2012 22:04, fbcyborg <fb...@gmail.com> wrote:
> OK,
>
> I compiled activemq from sources and I use activemq-all-5.8-SNAPSHOT.jar now
> but the problem still exists:
>
> [11/8/12 23:00:08:754 CET] 00000029 SystemErr     R
> com.ibm.websphere.naming.CannotInstantiateObjectException: threw
> NameNotFoundException while the JNDI NamingManager was processing a
> javax.naming.Reference object. [Root exception is
> javax.naming.NameNotFoundException: jms/systemMessageQueue]
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:1013)
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:730)
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:3691)
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1861)
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1762)
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1513)
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:645)
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:166)
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:180)
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> javax.naming.InitialContext.lookup(Unknown Source)
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> com.test.jms.JMSTestServlet.manageRequest(JMSTestServlet.java:123)
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> com.test.jms.JMSTestServlet.doPost(JMSTestServlet.java:59)
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
> [11/8/12 23:00:08:755 CET] 00000029 SystemErr     R     at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
> [11/8/12 23:00:08:756 CET] 00000029 SystemErr     R     at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939)
> [11/8/12 23:00:08:756 CET] 00000029 SystemErr     R     at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
> [11/8/12 23:00:08:756 CET] 00000029 SystemErr     R     at
> com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
> [11/8/12 23:00:08:756 CET] 00000029 SystemErr     R     at
> com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3935)
> [11/8/12 23:00:08:756 CET] 00000029 SystemErr     R     at
> com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
> [11/8/12 23:00:08:756 CET] 00000029 SystemErr     R     at
> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
> [11/8/12 23:00:08:756 CET] 00000029 SystemErr     R     at
> com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
> [11/8/12 23:00:08:756 CET] 00000029 SystemErr     R     at
> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
> [11/8/12 23:00:08:756 CET] 00000029 SystemErr     R     at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
> [11/8/12 23:00:08:756 CET] 00000029 SystemErr     R     at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
> [11/8/12 23:00:08:756 CET] 00000029 SystemErr     R     at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
> [11/8/12 23:00:08:756 CET] 00000029 SystemErr     R     at
> com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     at
> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     at
> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     at
> com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     at
> com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     at
> com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     at
> com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     at
> com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     at
> com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1613)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R Caused by:
> javax.naming.NameNotFoundException: jms/systemMessageQueue
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     at
> org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:235)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     at
> javax.naming.InitialContext.lookup(Unknown Source)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     at
> com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:390)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     at
> com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     at
> com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstanceExt(IndirectJndiLookupObjectFactory.java:226)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     at
> com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:924)
> [11/8/12 23:00:08:757 CET] 00000029 SystemErr     R     ... 34 more
>
>
> Where am I making a mistake?
> I don't understand.
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Help-configuring-ActiveMQ-as-JMSProvider-in-WebSphere-tp4658603p4659087.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://redhat.com
http://blog.garytully.com

Re: Help configuring ActiveMQ as JMSProvider in WebSphere

Posted by fbcyborg <fb...@gmail.com>.
OK, 

I compiled activemq from sources and I use activemq-all-5.8-SNAPSHOT.jar now
but the problem still exists:

[11/8/12 23:00:08:754 CET] 00000029 SystemErr     R
com.ibm.websphere.naming.CannotInstantiateObjectException: threw
NameNotFoundException while the JNDI NamingManager was processing a
javax.naming.Reference object. [Root exception is
javax.naming.NameNotFoundException: jms/systemMessageQueue]
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:1013)
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:730)
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:3691)
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1861)
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1762)
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1513)
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:645)
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:166)
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:180)
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
javax.naming.InitialContext.lookup(Unknown Source)
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
com.test.jms.JMSTestServlet.manageRequest(JMSTestServlet.java:123)
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
com.test.jms.JMSTestServlet.doPost(JMSTestServlet.java:59)
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
[11/8/12 23:00:08:755 CET] 00000029 SystemErr     R 	at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
[11/8/12 23:00:08:756 CET] 00000029 SystemErr     R 	at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939)
[11/8/12 23:00:08:756 CET] 00000029 SystemErr     R 	at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
[11/8/12 23:00:08:756 CET] 00000029 SystemErr     R 	at
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
[11/8/12 23:00:08:756 CET] 00000029 SystemErr     R 	at
com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3935)
[11/8/12 23:00:08:756 CET] 00000029 SystemErr     R 	at
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
[11/8/12 23:00:08:756 CET] 00000029 SystemErr     R 	at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
[11/8/12 23:00:08:756 CET] 00000029 SystemErr     R 	at
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
[11/8/12 23:00:08:756 CET] 00000029 SystemErr     R 	at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
[11/8/12 23:00:08:756 CET] 00000029 SystemErr     R 	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
[11/8/12 23:00:08:756 CET] 00000029 SystemErr     R 	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
[11/8/12 23:00:08:756 CET] 00000029 SystemErr     R 	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
[11/8/12 23:00:08:756 CET] 00000029 SystemErr     R 	at
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	at
com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	at
com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	at
com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	at
com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1613)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R Caused by:
javax.naming.NameNotFoundException: jms/systemMessageQueue
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	at
org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:235)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	at
javax.naming.InitialContext.lookup(Unknown Source)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	at
com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:390)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	at
com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	at
com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstanceExt(IndirectJndiLookupObjectFactory.java:226)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	at
com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:924)
[11/8/12 23:00:08:757 CET] 00000029 SystemErr     R 	... 34 more


Where am I making a mistake?
I don't understand. 



--
View this message in context: http://activemq.2283324.n4.nabble.com/Help-configuring-ActiveMQ-as-JMSProvider-in-WebSphere-tp4658603p4659087.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Help configuring ActiveMQ as JMSProvider in WebSphere

Posted by fbcyborg <fb...@gmail.com>.
OK, I can confirm this is the exceptions I get when using the
activemq-all-5.7.0.jar:

[11/2/12 21:48:12:747 CET] 0000001b SystemErr     R
com.ibm.websphere.naming.CannotInstantiateObjectException: threw
NameNotFoundException while the JNDI NamingManager was processing a
javax.naming.Reference object. [Root exception is
javax.naming.NameNotFoundException: jms/systemMessageQueue]
[11/2/12 21:48:12:747 CET] 0000001b SystemErr     R 	at
com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:1013)
[11/2/12 21:48:12:747 CET] 0000001b SystemErr     R 	at
com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:730)
[11/2/12 21:48:12:747 CET] 0000001b SystemErr     R 	at
com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:3691)
[11/2/12 21:48:12:747 CET] 0000001b SystemErr     R 	at
com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1861)
[11/2/12 21:48:12:747 CET] 0000001b SystemErr     R 	at
com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1762)
[11/2/12 21:48:12:747 CET] 0000001b SystemErr     R 	at
com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1513)
[11/2/12 21:48:12:747 CET] 0000001b SystemErr     R 	at
com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:645)
[11/2/12 21:48:12:747 CET] 0000001b SystemErr     R 	at
com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:166)
[11/2/12 21:48:12:747 CET] 0000001b SystemErr     R 	at
com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:180)
[11/2/12 21:48:12:747 CET] 0000001b SystemErr     R 	at
javax.naming.InitialContext.lookup(Unknown Source)
[11/2/12 21:48:12:747 CET] 0000001b SystemErr     R 	at
com.test.jms.JMSTestServlet.manageRequest(JMSTestServlet.java:123)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
com.test.jms.JMSTestServlet.doPost(JMSTestServlet.java:59)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3935)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
[11/2/12 21:48:12:748 CET] 0000001b SystemErr     R 	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
[11/2/12 21:48:12:749 CET] 0000001b SystemErr     R 	at
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
[11/2/12 21:48:12:749 CET] 0000001b SystemErr     R 	at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
[11/2/12 21:48:12:749 CET] 0000001b SystemErr     R 	at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[11/2/12 21:48:12:749 CET] 0000001b SystemErr     R 	at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[11/2/12 21:48:12:749 CET] 0000001b SystemErr     R 	at
com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
[11/2/12 21:48:12:749 CET] 0000001b SystemErr     R 	at
com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
[11/2/12 21:48:12:749 CET] 0000001b SystemErr     R 	at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
[11/2/12 21:48:12:749 CET] 0000001b SystemErr     R 	at
com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
[11/2/12 21:48:12:749 CET] 0000001b SystemErr     R 	at
com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1613)
[11/2/12 21:48:12:749 CET] 0000001b SystemErr     R Caused by:
javax.naming.NameNotFoundException: jms/systemMessageQueue
[11/2/12 21:48:12:749 CET] 0000001b SystemErr     R 	at
org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:235)
[11/2/12 21:48:12:750 CET] 0000001b SystemErr     R 	at
javax.naming.InitialContext.lookup(Unknown Source)
[11/2/12 21:48:12:750 CET] 0000001b SystemErr     R 	at
com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:390)
[11/2/12 21:48:12:750 CET] 0000001b SystemErr     R 	at
com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
[11/2/12 21:48:12:750 CET] 0000001b SystemErr     R 	at
com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstanceExt(IndirectJndiLookupObjectFactory.java:226)
[11/2/12 21:48:12:750 CET] 0000001b SystemErr     R 	at
com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:924)
[11/2/12 21:48:12:750 CET] 0000001b SystemErr     R 	... 34 more

and the jms/systemMessageQueue JNDI name exists.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Help-configuring-ActiveMQ-as-JMSProvider-in-WebSphere-tp4658603p4658712.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Help configuring ActiveMQ as JMSProvider in WebSphere

Posted by fbcyborg <fb...@gmail.com>.
On Fri, Nov 2, 2012 at 8:49 AM, Claus Ibsen &lt;claus.ibsen@&gt; wrote:
> Hi
>
> And you dont see anymore of the stacktrace?
>
> Wonder if the error comes from the ActiveMQWASInitialContextFactory

Hello! Excuse me for the late reply.

Here's the  complete stacktrace <http://pastebin.com/b7n90Q1H>  .

> I spotted the bug in that code, and logged a ticket
> https://issues.apache.org/jira/browse/AMQ-4153
Great!
I look forward to see some improvement on that.

> You may try with one of the other factories from
> org/apache/activemq/jndi, such as the plain:
> ActiveMQInitialContextFactory.java
OK, I placed org.apache.activemq.jndi.ActiveMQInitialContextFactory instead
of org.apache.activemq.jndi.ActiveMQWASInitialContextFactory as External
initial context factory in the WAS configuration for the JMS Provider.
This is the exception I get:
[11/2/12 21:09:24:312 CET] 0000001d SystemErr     R SLF4J: Failed to load
class "org.slf4j.impl.StaticLoggerBinder".
[11/2/12 21:09:24:312 CET] 0000001d SystemErr     R SLF4J: Defaulting to
no-operation (NOP) logger implementation
[11/2/12 21:09:24:312 CET] 0000001d SystemErr     R SLF4J: See
http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[11/2/12 21:09:24:413 CET] 0000001d SystemErr     R
com.ibm.websphere.naming.CannotInstantiateObjectException: threw
NameNotFoundException while the JNDI NamingManager was processing a
javax.naming.Reference object. [Root exception is
javax.naming.NameNotFoundException: jms/systemMessageQueue]
[11/2/12 21:09:24:413 CET] 0000001d SystemErr     R 	at
com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:1013)
[11/2/12 21:09:24:413 CET] 0000001d SystemErr     R 	at
com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:730)
[11/2/12 21:09:24:413 CET] 0000001d SystemErr     R 	at
com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:3691)

Note that I am also getting other exceptions for slf4j missing jars, because
I don't know exactly what to put into 
/opt/IBM/WebSphere/AppServer/lib/ext/. I thought only common-logging jar was
necessary but it seems not!

So do you confirm my ActiveMQ configuration on WAS is correct?
Notice also that I am using WAS 7.0.0.23 + activemq-5.7.0 on Linux at my
home PC, but I have WAS 6.1 on windows @work, and I have to use a prior
version of ActiveMQ: 5.4.3 (if I remeber correctly).

Thanks



--
View this message in context: http://activemq.2283324.n4.nabble.com/Help-configuring-ActiveMQ-as-JMSProvider-in-WebSphere-tp4658603p4658710.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Help configuring ActiveMQ as JMSProvider in WebSphere

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Nov 2, 2012 at 8:49 AM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> And you dont see anymore of the stacktrace?
>
> Wonder if the error comes from the ActiveMQWASInitialContextFactory
>

I spotted the bug in that code, and logged a ticket
https://issues.apache.org/jira/browse/AMQ-4153

You may try with one of the other factories from
org/apache/activemq/jndi, such as the plain:
ActiveMQInitialContextFactory.java


>
>
> On Thu, Nov 1, 2012 at 7:01 PM, fbcyborg <fb...@gmail.com> wrote:
>> Hello,
>>
>> I am running ActiveMQ 5.7.0 on Linux and I created a Queue named
>> "jms/systemMessageQueue" through the web interface.
>> Since I am developing J2EE applications I use IBM Websphere (6.1 or 7) to
>> deploy my Servlets.
>>
>> I wrote a Servlet that fails after this line:
>>
>> Queue queue = (Queue) jndiContext.lookup("jms/systemMessageQueue");
>>
>> This is the exception:
>> com.ibm.websphere.naming.CannotInstantiateObjectException: Exception
>> occurred while the JNDI NamingManager was processing a
>> javax.naming.Reference object. [Root exception is
>> javax.naming.NoInitialContextException: Failed to create InitialContext
>> using factory specified in hashtable
>> {java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQWASInitialContextFactory,
>> com.ibm.websphere.naming.hostname.normalizer=com.ibm.ws.naming.util.DefaultHostnameNormalizer,
>> com.ibm.websphere.naming.name.syntax=jndi,
>> com.ibm.websphere.naming.namespace.connection=eager,
>> com.ibm.ws.naming.ldap.ldapinitctxfactory=com.sun.jndi.ldap.LdapCtxFactory,
>> com.ibm.websphere.naming.jndicache.cacheobject=populated,
>> com.ibm.websphere.naming.namespaceroot=defaultroot,
>> com.ibm.ws.naming.implementation=WsnIpCos,
>> com.ibm.ws.naming.wsn.factory.initial=com.ibm.ws.naming.util.WsnInitCtxFactory,
>> com.ibm.websphere.naming.jndicache.maxcachelife=0,
>> com.ibm.websphere.naming.jndicache.maxentrylife=0,
>> java.naming.connectionFactoryNames=jms/queueConnectionFactory,
>> java.naming.provider.url=tcp://localhost:61616,
>> com.ibm.websphere.naming.jndicache.cachename=providerURL,
>> java.naming.factory.url.pkgs=com.ibm.ws.naming:com.ibm.ws.runtime:com.ibm.iscportal.jndi:com.ibm.ws.naming:com.ibm.ws.naming,
>> java.naming.queue=jms/systemMessageQueue} [Root exception is
>> java.lang.StringIndexOutOfBoundsException: String index out of range: 18]]
>>
>> I don't understand why it says "String index out of range: 18".
>>
>> This is the configuration I use on WAS:
>>
>> Resources->JMS->JMS Providers:
>>         Name: ActiveMQ
>>         External initial context factory:
>> org.apache.activemq.jndi.ActiveMQWASInitialContextFactory
>>         External provider URL: tcp://localhost:61616
>>         Custom Properties:
>>                 Name: java.naming.connectionFactoryNames; Value:
>> jms/queueConnectionFactory
>>                 Name: java.naming.queue; Value: jms/systemMessageQueue
>> Resources->JMS->Queue Connection Factories:
>>         Name: Queue Connection Factory
>>         JNDI Name: jms/QueueConnectionFactory
>>         External JNDI Name: jms/QueueConnectionFactory
>>         Provider: ActiveMQ
>> Resources->JMS->Queues
>>         Name: System Message Queue
>>         JNDI Name: jms/systemMessageQueue
>>         External JNDI Name: jms/systemMessageQueue
>>         Provider: ActiveMQ
>>
>> The directory /opt/IBM/WebSphere/AppServer/lib/ext/ contains the following
>> jar files:
>> - activeio-core-3.1.4.jar
>> - activemq-core-5.7.0.jar
>>
>> I don't know if there is something wrong within the configuration or not,
>> but I think so.
>> Could somebody help me to solve this problem when trying to connect to the
>> queue?
>>
>>
>>
>> --
>> View this message in context: http://activemq.2283324.n4.nabble.com/Help-configuring-ActiveMQ-as-JMSProvider-in-WebSphere-tp4658603.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Help configuring ActiveMQ as JMSProvider in WebSphere

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

And you dont see anymore of the stacktrace?

Wonder if the error comes from the ActiveMQWASInitialContextFactory



On Thu, Nov 1, 2012 at 7:01 PM, fbcyborg <fb...@gmail.com> wrote:
> Hello,
>
> I am running ActiveMQ 5.7.0 on Linux and I created a Queue named
> "jms/systemMessageQueue" through the web interface.
> Since I am developing J2EE applications I use IBM Websphere (6.1 or 7) to
> deploy my Servlets.
>
> I wrote a Servlet that fails after this line:
>
> Queue queue = (Queue) jndiContext.lookup("jms/systemMessageQueue");
>
> This is the exception:
> com.ibm.websphere.naming.CannotInstantiateObjectException: Exception
> occurred while the JNDI NamingManager was processing a
> javax.naming.Reference object. [Root exception is
> javax.naming.NoInitialContextException: Failed to create InitialContext
> using factory specified in hashtable
> {java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQWASInitialContextFactory,
> com.ibm.websphere.naming.hostname.normalizer=com.ibm.ws.naming.util.DefaultHostnameNormalizer,
> com.ibm.websphere.naming.name.syntax=jndi,
> com.ibm.websphere.naming.namespace.connection=eager,
> com.ibm.ws.naming.ldap.ldapinitctxfactory=com.sun.jndi.ldap.LdapCtxFactory,
> com.ibm.websphere.naming.jndicache.cacheobject=populated,
> com.ibm.websphere.naming.namespaceroot=defaultroot,
> com.ibm.ws.naming.implementation=WsnIpCos,
> com.ibm.ws.naming.wsn.factory.initial=com.ibm.ws.naming.util.WsnInitCtxFactory,
> com.ibm.websphere.naming.jndicache.maxcachelife=0,
> com.ibm.websphere.naming.jndicache.maxentrylife=0,
> java.naming.connectionFactoryNames=jms/queueConnectionFactory,
> java.naming.provider.url=tcp://localhost:61616,
> com.ibm.websphere.naming.jndicache.cachename=providerURL,
> java.naming.factory.url.pkgs=com.ibm.ws.naming:com.ibm.ws.runtime:com.ibm.iscportal.jndi:com.ibm.ws.naming:com.ibm.ws.naming,
> java.naming.queue=jms/systemMessageQueue} [Root exception is
> java.lang.StringIndexOutOfBoundsException: String index out of range: 18]]
>
> I don't understand why it says "String index out of range: 18".
>
> This is the configuration I use on WAS:
>
> Resources->JMS->JMS Providers:
>         Name: ActiveMQ
>         External initial context factory:
> org.apache.activemq.jndi.ActiveMQWASInitialContextFactory
>         External provider URL: tcp://localhost:61616
>         Custom Properties:
>                 Name: java.naming.connectionFactoryNames; Value:
> jms/queueConnectionFactory
>                 Name: java.naming.queue; Value: jms/systemMessageQueue
> Resources->JMS->Queue Connection Factories:
>         Name: Queue Connection Factory
>         JNDI Name: jms/QueueConnectionFactory
>         External JNDI Name: jms/QueueConnectionFactory
>         Provider: ActiveMQ
> Resources->JMS->Queues
>         Name: System Message Queue
>         JNDI Name: jms/systemMessageQueue
>         External JNDI Name: jms/systemMessageQueue
>         Provider: ActiveMQ
>
> The directory /opt/IBM/WebSphere/AppServer/lib/ext/ contains the following
> jar files:
> - activeio-core-3.1.4.jar
> - activemq-core-5.7.0.jar
>
> I don't know if there is something wrong within the configuration or not,
> but I think so.
> Could somebody help me to solve this problem when trying to connect to the
> queue?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Help-configuring-ActiveMQ-as-JMSProvider-in-WebSphere-tp4658603.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen