Thank you very much man for your assistance,It is all working well now and just great, I feel like I was asking a stupid questions but sorry I didnt thought that there is a backward compatibitly issues since this code is from version 3
thank you. James.Strachan wrote: > > Again you're using the old class names from 3.x; in 4.x its in the > command package > > http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/command/ActiveMQTopic.html > > On 3/28/07, alaa_nobani <[EMAIL PROTECTED]> wrote: >> >> Thank you very much it is working now but another exception showed: >> javax.naming.NamingException: org.apache.activemq.message.ActiveMQTopic >> Is It related to the TOPIC I am trying to connect to, I mean that it >> doesnt >> exist, and if so I think it should create it !!! >> >> thanks >> >> >> >> James.Strachan wrote: >> > >> > You're using the wrong package names; ActiveMQ has been in the >> > org.apache.activemq package for a year and a half now >> > >> > On 3/26/07, alaa_nobani <[EMAIL PROTECTED]> wrote: >> >> >> >> Hi, I am new to ActiveMQ and tried to integrate it with tomcat 5.5 so >> I >> >> copied all the necessary JARS to the common/lib directory in tomcat >> then >> >> I >> >> added a META-INF/context.xml to my web application directory >> contaning: >> >> <Context antiJARLocking="true"> >> >> <Resource >> >> name="jms/ConnectionFactory" >> >> auth="Container" >> >> type="org.activemq.ActiveMQConnectionFactory" >> >> description="JMS Connection Factory" >> >> factory="org.activemq.jndi.JNDIReferenceFactory" >> >> brokerURL="ssl://localhost:61616" >> >> brokerName="LocalActiveMQBroker" >> >> useEmbeddedBroker="false"/> >> >> >> >> <Resource name="jms/topic/MyTopic" >> >> auth="Container" >> >> type="org.activemq.message.ActiveMQTopic" >> >> factory="org.activemq.jndi.JNDIReferenceFactory" >> >> physicalName="MY.TEST.FOO"/> >> >> </Context> >> >> >> >> >> >> then I tried to use it in a servlet like this : >> >> >> >> InitialContext initCtx = new InitialContext(); >> >> Context envContext = (Context) initCtx.lookup("java:comp/env"); >> >> ConnectionFactory connectionFactory = (ConnectionFactory) >> >> envContext.lookup("jms/ConnectionFactory"); >> >> Connection connection = connectionFactory.createConnection(); >> >> Session session = connection.createSession(false, >> >> Session.AUTO_ACKNOWLEDGE); >> >> MessageProducer producer = session.createProducer((Destination) >> >> envContext.lookup("jms/topic/MyTopic")); >> >> >> >> Message testMessage = session.createMessage(); >> >> testMessage.setStringProperty("testKey", "testValue"); >> >> producer.send(testMessage); >> >> >> >> >> >> When I request the servlet the following exception comes up: >> >> javax.naming.NamingException: Could not load resource factory class >> [Root >> >> exception is java.lang.ClassNotFoundException: >> >> org.activemq.jndi.JNDIReferenceFactory] >> >> >> >> >> >> So what is wrong and what I should I do else??? >> >> >> >> thanks. >> >> >> >> >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/Error-in-using-ActiveMQ-with-tomcat-5.5-tf3468628s2354.html#a9678340 >> >> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com. >> >> >> >> >> > >> > >> > -- >> > >> > James >> > ------- >> > http://radio.weblogs.com/0112098/ >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Error-in-using-ActiveMQ-with-tomcat-5.5-tf3468628s2354.html#a9708859 >> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com. >> >> > > > -- > > James > ------- > http://radio.weblogs.com/0112098/ > > -- View this message in context: http://www.nabble.com/Error-in-using-ActiveMQ-with-tomcat-5.5-tf3468628s2354.html#a9711141 Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
