-
1. Re: namenotfound exception in JMS Client
cypnsv Dec 8, 2006 3:55 PM (in response to cypnsv)Sorry the exception is AlarmMgrConnectionFactory not bound
-
2. Re: namenotfound exception in JMS Client
cypnsv Dec 8, 2006 3:58 PM (in response to cypnsv)need help urgently
Please let me know where i am doing wrong -
3. Re: namenotfound exception in JMS Client
weston.price Dec 8, 2006 4:31 PM (in response to cypnsv)You cannot access JCA resources outside of JBoss. The reason your code is failing is that the java: namespace is not available. *-ds.xml definitions are only for resources that are targeted to be used in the EE container. If you simply want to post to destination outside of JBoss, create the destination and use the JNDI lookup
Properties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); properties.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces"); properties.put(Context.PROVIDER_URL, "localhost:3099"); InitialContext ctx = new InitialContext(properties); Object obj = ctx.lookup("ConnectionFactory");
From there you can create a connection and begin producing messages. -
4. Re: namenotfound exception in JMS Client
cypnsv Dec 8, 2006 4:39 PM (in response to cypnsv)thanks thanks for the quickest response,
So you mean to say that i need to create my own -ds.xml file, for example project-ds.xml and have the connection factory in this file and put this file into server\default\deploy directory
is that right?
[/img] -
5. Re: namenotfound exception in JMS Client
cypnsv Dec 8, 2006 4:55 PM (in response to cypnsv)sorry misunderstood,
i tried without java: but still it doe not work, i get the same error
AlarmMgrConnectionFactory not bound
please see the below codeProperties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); properties.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces"); properties.put(Context.PROVIDER_URL, "localhost:3099"); InitialContext ctx = new InitialContext(properties); Object obj = ctx.lookup("AlarmMgrConnectionFactory");
But in the server log file i see that AlarmMgrConnectionFactory jndiname is java:AlarmMgrConnectionFactory
below are the lines from the log file2006-12-09 03:18:37,501 DEBUG [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Binding object 'org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl@c8f0a4' into JNDI at 'java:AlarmMgrConnectionFactory' 2006-12-09 03:18:37,501 INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=AlarmMgrConnectionFactory' to JNDI name 'java:AlarmMgrConnectionFactory' 2006-12-09 03:18:37,501 DEBUG [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Started jboss.jca:service=ConnectionFactoryBinding,name=AlarmMgrConnectionFactory 2006-12-09 03:18:37,501 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.jca:service=ConnectionFactoryBinding,name=AlarmMgrConnectionFactory dependent components: [] 2006-12-09 03:18:37,501 DEBUG [org.jboss.system.ServiceController] starting service jboss.jca:service=ConnectionFactoryBinding,name=AlarmMgrConnectionFactory 2006-12-09 03:18:37,501 DEBUG [org.jboss.system.ServiceController] Ignoring start request for service: jboss.jca:service=ConnectionFactoryBinding,name=AlarmMgrConnectionFactory 2006-12-09 03:18:37,501 DEBUG [org.jboss.system.ServiceController] starting service jboss.jca:service=TxCM,name=EventConnectionFactory
-
6. Re: namenotfound exception in JMS Client
cypnsv Dec 8, 2006 4:56 PM (in response to cypnsv)Please advice, where i am going wrong
Please please... -
7. Re: namenotfound exception in JMS Client
cypnsv Dec 8, 2006 5:06 PM (in response to cypnsv)please help
-
8. Re: namenotfound exception in JMS Client
cypnsv Dec 8, 2006 5:26 PM (in response to cypnsv)i am still getting the same error
Please help -
9. Re: namenotfound exception in JMS Client
cypnsv Dec 8, 2006 5:39 PM (in response to cypnsv)Somebody please help
-
10. Re: namenotfound exception in JMS Client
weston.price Dec 8, 2006 5:43 PM (in response to cypnsv)Again, you cannot lookup a resource bound into JNDI in JBoss in a client outside of JBoss.
Change your code toProperties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); properties.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces"); properties.put(Context.PROVIDER_URL, "localhost:3099"); InitialContext ctx = new InitialContext(properties); ConnectionFactory cf = (ConnectionFactory)ctx.lookup("ConnectionFactory");
From this factory you can create a connection and from there a session etc. Also, you will have to look up your destinations from JNDI as well. -
11. Re: namenotfound exception in JMS Client
cypnsv Dec 8, 2006 5:56 PM (in response to cypnsv)i did the same
Now i get this errorException in thread "main" javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: org.jboss.mq.referenceable.ObjectRefAddr (no security manager: RMI class loader disabled)] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587) at javax.naming.InitialContext.lookup(Unknown Source) at Client.main(Client.java:33)
-
12. Re: namenotfound exception in JMS Client
weston.price Dec 8, 2006 6:01 PM (in response to cypnsv)Which means you have missing jars in your classpath. How are you running this?
-
13. Re: namenotfound exception in JMS Client
cypnsv Dec 8, 2006 6:24 PM (in response to cypnsv)i am running the JMSCLIENT program from the ECLIPSE
Whuch jar file am i missing? -
14. Re: namenotfound exception in JMS Client
weston.price Dec 8, 2006 6:29 PM (in response to cypnsv)It looks like you don't have jbossall-client.jar
This can be found in your JBOSS_HOME/client directory