aspose file tools*
The moose likes Java in General and the fly likes javamail Listner Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "javamail Listner" Watch "javamail Listner" New topic
Author

javamail Listner

sachin roy
Greenhorn

Joined: Jan 30, 2012
Posts: 7
Hi All,

I added MessageCountListener to inbox by using javamail API... but the problem i am facing is after one callback program
is terminating, it is not listing to next added messages.. can you please tell me the solution for resolving this problem..??
my expectation is that, the listener should count or listen each and every messages added to the inbox..!!

Thanks in Advance,
Sanjeev
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10202
    
166

What does the relevant code look like? And are you sure new messages are added after the first callback?


[My Blog] [JavaRanch Journal]
sachin roy
Greenhorn

Joined: Jan 30, 2012
Posts: 7
Hi Jaikiran Pai,

This is the sample program..

As like you said after idle() method it has been continuing for new messages to arrival.. after arrival of new messages
it is successfully getting new messages.. but the problem is if i operate on that message as mentioned in code message.getSubject() it is failing
to get that message and it is terminating from the application.. please give me the solution for this..

thanks in advance..


Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10202
    
166

sachin roy wrote:but the problem is if i operate on that message as mentioned in code message.getSubject() it is failing
to get that message and it is terminating from the application..

The code that you posted shows that you print out the exception stacktrace when something goes wrong while fetching the message. What exception stacktrace are you seeing?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javamail Listner