Note that there are some explanatory texts on larger screens.

plurals
  1. POJMS implementation using JNDI in spring application
    primarykey
    data
    text
    <p>I am trying to implement JMS in my spring application. I have defined the JNDI name + queue name in applicationContext.xml as follows:</p> <pre><code>&lt;bean id="emailQueueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="true"&gt; &lt;property name="jndiName" value="java:comp/env/jms/&lt;&lt;Name of JNDI of connection factory&gt;&gt;" /&gt; &lt;/bean&gt; &lt;bean id="emailQueueDestination" class="org.springframework`enter code here`.jndi.JndiObjectFactoryBean" lazy-init="true"&gt; &lt;property name="jndiName" value="java:comp/env/jms/&lt;&lt;JNDI name of queue&gt;&gt;" /&gt; &lt;/bean&gt; &lt;bean id="emailQueueTemplate" class="org.springframework.jms.core.JmsTemplate" lazy-init="true"&gt; &lt;property name="connectionFactory" ref="emailQueueConnectionFactory" /&gt; &lt;property name="defaultDestination" ref="emailQueueDestination" /&gt; &lt;/bean&gt; &lt;bean id="emailSender" class="&lt;&lt;Package&gt;&gt;.EmailSender" lazy-init="true"&gt; &lt;property name="jmsTemplate"&gt; &lt;ref bean="emailQueueTemplate" /&gt; &lt;/property&gt; &lt;/bean&gt; </code></pre> <p>Now my controller makes a call to the emailSender bean using the following code:</p> <pre><code>ApplicationContext context = new ClassPathXmlApplicationContext("/applicationContext.xml"); EmailSender sender =(EmailSender)context.getBean("emailSender"); </code></pre> <p>The exception I get is: Error 404: Request processing failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist</p> <p>I am loading the applicationContext.xml at serevr start-up still my code is not able to locate this file.</p> <p>Can anyone please help.?? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload