• Post Reply Bookmark Topic Watch Topic
  • New Topic

MailServer Class & getNewMailItem()  RSS feed

 
Chan Duller
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having trouble getting the getNewMailItem() method to work. Everything compiles fine, but it returns null every time even if there are multiple mail items in the server. Can anyone help me with this? I have tried using the debugger to step through and do not see any issues, but maybe I'm missing something. Thanks in advance!

 
Knute Snortum
Sheriff
Posts: 4091
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think we need more information. What line of what class is getting the error? Better yet, post the whole stacktrace.

I'm also curious how you run this.

Nice documentation, BTW.
 
Chan Duller
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no error. It just isn't returning the correct results. It is the getNextMailItem() method that is returning null. How it runs is that you create a server object. Then you create mail client objects on that server, and then can send mail items to each other. When I do send one, it is returning null for the getNextMailItem() method for the person it is sent to. Does that make sense?
 
Knute Snortum
Sheriff
Posts: 4091
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at line 82 of MailServer.java:

If who is mixed case, what will who be and what will item.getTo() be?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!