in the Tomcat console when i pass on the line :
ActiveMQQueueReceiver aqr = (ActiveMQQueueReceiver)qs.createReceiver(q) ;
i've got the error :
SERIOUS : error starting context /jms an that all ??
Could you help me to deal with this error ???
Thanks in advance,
Regards,
Denez
denez wrote:
>
> Do you already have this type of error ?
> Do i forget something in my configuration.
> I use :
> apache-activemq-4.1.1.jar
> Tomcat 5.5.23
> jdk1.5.0_07
>
> Could you tell me if something is wrong !
> Here is my context declaration in Tomcat :
>
> <Context path="/jms" reloadable="true" docBase="C:\myJMSApp"
> workDir="C:\myJMSApp\work" >
> <Resource
> name="jms/ConnectionFactory"
> auth="Container"
> type="org.apache.activemq.ActiveMQConnectionFactory"
> description="JMS Connection Factory"
> factory="org.apache.activemq.jndi.JNDIReferenceFactory"
> brokerURL="tcp://localhost:61616"
> brokerName="LocalActiveMQBroker"
> useEmbeddedBroker="true"/>
>
> <Resource name="jms/batch"
> auth="Container"
> type="org.apache.activemq.command.ActiveMQQueue"
> factory="org.apache.activemq.jndi.JNDIReferenceFactory"
> physicalName="batch"/>
> </Context>
>
> Thanks in advance for all reply, help / answer.
> Regards,
>
> Denez
>
>
> denez wrote:
>>
>> Hi all,
>>
>> I got the same error trying to create a sender !
>> A very strange thing appear because there is no exception throw ! Just
>> nothing happened and the rest of my code is never (i suspect) excecuted.
>>
>> Could you help me, or ask me if something is not clear.
>> Thanks in advance,
>> Regards,
>>
>> Denez
>>
>>
>> denez wrote:
>>>
>>> I search around to find my error and find that you should use
>>> ActiveMQConnection.
>>> Now i can start the connection but have a same problem will trying to
>>> createReceiver.
>>> See the code below (previous + modification) :
>>>
>>> public class ActiveMQBrokerStartListener implements
>>> ServletContextListener {
>>>
>>> BrokerService broker = new BrokerService();
>>> ActiveMQConnection aqc = null ;
>>>
>>> public void contextInitialized(ServletContextEvent arg0) {
>>> try{
>>>
>>> broker.addConnector("tcp://localhost:61616?trace=true&wireFormat.maxInactivityDuration=-1");
>>> broker.start();
>>> InitialContext ic = new InitialContext();
>>> Context ctx = (Context) ic.lookup("java:comp/env");
>>> ActiveMQConnectionFactory acf =
>>>
>>> (ActiveMQConnectionFactory)ctx.lookup("jms/ConnectionFactory");
>>> aqc = (ActiveMQConnection)acf.createQueueConnection();
>>> aqc.start() ;
>>> ActiveMQQueueSession qs =
>>> (ActiveMQQueueSession)aqc.createQueueSession(false,
>>> Session.CLIENT_ACKNOWLEDGE) ;
>>> ActiveMQQueue q = (ActiveMQQueue)ctx.lookup("jms/batch");
>>> ActiveMQQueueReceiver aqr =
>>> (ActiveMQQueueReceiver)qs.createReceiver(q) ; // ERROR LINE
>>> aqr.setMessageListener(new
>>> BatchReceiverTechnicalService()) ;
>>> }catch(Exception e){
>>> System.err.println(e.getMessage());
>>> e.printStackTrace();
>>> throw new RuntimeException(e);
>>> }
>>> }
>>>
>>> public void contextDestroyed(ServletContextEvent arg0) {
>>> try{
>>> aqc.close() ;
>>> //qc.close() ;
>>> broker.stop();
>>> }catch(Exception e){
>>> System.err.println(e.getMessage());
>>> e.printStackTrace();
>>> throw new RuntimeException(e);
>>> }
>>> }
>>> }
>>>
>>> What is wrong ??
>>> Why i can not create a Receiver ?
>>>
>>> Thanks in advance
>>> Regards,
>>> Denez
>>>
>>>
>>>
>>>
>>> denez wrote:
>>>>
>>>> Hi all,
>>>>
>>>> I would like to start a broker and Activate a MessageListener on
>>>> startup of my webApp.
>>>> I made all the needed configuration to have a ServletContextListener.
>>>> I can debug inside my ServletContextListener implementation named :
>>>> ActiveMQBrokerStartListener.
>>>> You can see the code of it below :
>>>>
>>>> public class ActiveMQBrokerStartListener implements
>>>> ServletContextListener {
>>>> BrokerService broker = new BrokerService();
>>>> QueueConnection qc = null ;
>>>>
>>>> public void contextInitialized(ServletContextEvent arg0) {
>>>> try{
>>>>
>>>> broker.addConnector("tcp://localhost:61616?trace=true&wireFormat.maxInactivityDuration=-1");
>>>> broker.start();
>>>> InitialContext ic = new InitialContext();
>>>> Context ctx = (Context) ic.lookup("java:comp/env");
>>>> ActiveMQConnectionFactory cf =
>>>>
>>>> ActiveMQConnectionFactory)ctx.lookup("jms/ConnectionFactory");
>>>> qc = (QueueConnection) cf.createQueueConnection();
>>>> qc.start() ;
>>>> QueueSession qs = qc.createQueueSession(false,
>>>> Session.CLIENT_ACKNOWLEDGE) ;
>>>> Queue q = (Queue)ctx.lookup("jms/batch");
>>>> QueueReceiver qr = qs.createReceiver(q) ;
>>>> qr.setMessageListener(new Receiver()) ;
>>>> }catch(Exception e){
>>>> System.err.println(e.getMessage());
>>>> e.printStackTrace();
>>>> throw new RuntimeException(e);
>>>> }
>>>> }
>>>>
>>>> public void contextDestroyed(ServletContextEvent arg0) {
>>>> try{
>>>> qc.close() ;
>>>> broker.stop();
>>>> }catch(Exception e){
>>>> System.err.println(e.getMessage());
>>>> e.printStackTrace();
>>>> throw new RuntimeException(e);
>>>> }
>>>> }
>>>> }
>>>>
>>>> I place a breakpoint on the line that should create a QueueSession.
>>>> But never enter in it. If i place a breakpoint on the ligne that
>>>> createQueueConnection i have it.
>>>> So the problem is on the qc.start() ;
>>>> If i inspect the QueueConnection i can see that the started=false as
>>>> normal.
>>>>
>>>> What is wrong on my code ?
>>>> Could you help me, or tell me what you think about this ?
>>>>
>>>> Regards,
>>>> Denez
>>>>
>>>
>>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Error-on-starting-QueueConnection-tf4278515s2354.html#a12182222
Sent from the ActiveMQ - User mailing list archive at Nabble.com.