can u post JmsEmailSender bean code to !!
Then only i can check that !! bcz u have sending mail !!
Main Topics
Browse All TopicsI have created an emailing service in spring. Since i need to allow e-mails persistence etc.. i need to put this on JMS. With the help of another question here, i found the way to configure weblogic (hopefully correct) and create the proper structure. This thing works every second time though!!!
The first time i send an e-mail, the receiver receives nothing (checked this with breakpoint). The second time, it receives a message-(MimeMessage or SimpleMaiMessagel) and transmits it. The third time it is ignored, the forth time it is send and so on...
I have the feeling, that i must have done something in Spring bean configuration, can someone check it for me? I am desperate...
I also attach the class that implements MessageListener, in case there is the problem...
Do i also need to make something on web.xml?
If this information does not help, but someone has experience on JMS/Spring/Weblogic please provide with ideas or request further info.
If you believe this could be a weblogic configuration problem, i can provide with a step by step info of how i have configured it, already done so as to provide this to the rest of the team in my work.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hello,
Thanx for the fast response. Below you can find my files that consern the problem.
The EmailMessageSender, uses the JmsEmailSender to send the email (mime or single).
The EmailMessageReceiver (receiver.txt) uses jmsReceiver.txt to get the e-mail and send it.
the host name is correct, before adding JMS, i could send emails normally.
I now think something is going on with the jmsTemplate.convertAndSend
and Object email=jmsTemplate.receiveA
This is because, i noticed that on Object email=jmsTemplate.receiveA
Do you know if Object jmsTemplate.receiveAndConv
I hope i am not asking silly things, but i am kind of new to J2EE....
I changed the following:
<bean id="jmsTemplate" class="org.springframework
<property name="connectionFactory" ref="connectionFactory"/>
<property name="defaultDestination" ref="sendDestination"/>
</bean>
public class JmsEmailReceiver
{
@Autowired
protected JmsTemplate102 jmsTemplate;
......
@Component("JmsEmailSender
public class JmsEmailSender
{
SimpleMessageConverter smc=new SimpleMessageConverter();
@Autowired
protected JmsTemplate102 jmsTemplate;
......
But it still fails on Object email=jmsTemplate.receiveA
public void recieveMessage() throws GenericJmsEmailException
{
Object email=jmsTemplate.receiveA
.....
If i got you correct, you mean to have
email=jmsTemplate102.recei
instead of
email=jmsTemplate.receiveA
BUT the jmsTemplate is now of type jmsTemplate102 (see above.. protected JmsTemplate102 jmsTemplate;)
so when i type email=jmsTemplate.receiveA
It is exacly the same! :-(. I frunkly have no idea what is the case.
I also tried this one:
Message message=jmsTemplate.receiv
Object email=jmsTemplate.doConver
but still no use.
Do you know if MimeMessage and SimpleMailMessage can be used on receiveAndConvert? could this be the problem?
yes. the Object email=jmsTemplate.doConver
I kind of think it is acknowledgement problem. i have got the jmsTemplate.getSessionAckn
and returns 1. do you know how/where i should handle receive acknowledgments? i am looking for something like jmsTemplate.sendAcknowledg
SOLUTION FOUND
REQUEST FOR EXPLANATION...
i did (with try and error..) the following and it works:
public void recieveMessage() throws GenericJmsEmailException
{
Object email=null;
do
{
try
{
email=jmsTemplate.receiveA
if (email instanceof MimeMessage)
{
syncJavaMailSenderImpl.sen
}
else if (email instanceof SimpleMailMessage)
{
syncJavaMailSenderImpl.sen
}
else if (email instanceof String)
{
String x=(String)email;
x=">"+x;
}
}catch(Exception e)
{
e.printStackTrace();
}
}while(email!=null);
}
This works... but is it ok/fine? and... why?? I thought onMessage is called every time a message is put on the queue. So if i call jmsTemplate.convertAndSend
Business Accounts
Answer for Membership
by: dravidnsrPosted on 2009-09-08 at 03:30:29ID: 25280302
check ur host name !!
i think that only refuse ur mail sending !! so check that !