Cannot create an Appointment - NullPointerException

The following code works on Windows 7, but it fails on Windows Server 2003 (Tomcat)

Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
Date startDate = calendar.getTime();
calendar.add(Calendar.HOUR, 1);
Date endDate = calendar.getTime();

MailAddressCollection attendees = new MailAddressCollection();
attendees.add(...);
MailAddress organizer = new MailAddress(..., ...);
Appointment app = new Appointment("", "", messageBody, startDate, endDate, organizer, attendees);

This is the exception I get on the last line:
at com.aspose.email.Appointment.resetTimeZone(Unknown Source)
at com.aspose.email.Appointment.(Unknown Source)
at com.aspose.email.Appointment.(Unknown Source)
at com.aspose.email.Appointment.(Unknown Source)
at com.aspose.email.Appointment.(Unknown Source)


I need some help ASAP as it happens in production.

Thanks,
Mariusz

Hi Mariusz,

Can you please more details about your production environment, as I was unable to reproduce this issue at my end using the latest version of Aspose.Email for Java 2.7.0. Please provide complete information about your server, tomcat installed, and your application. It'll be of added benefit if you could provide us some test project to reproduce this issue at our end, as with my sample code I am unable to reproduce this issue. We'll look into these details and assist you further as soon as possbile.

Well, the problem is that I have no idea how to reproduce that on my PC when I run it from Eclipse.

It fails only on my server which is Windows Server 2003 R2 SP2, Tomcat 6.0.35
Because the code is obfuscated I’m not able to provide you a line number where it fails. Can you provide me some debug version of that library so I can use it to reproduce this issue? In the original post there is a method mentioned which fails, so if you could add some debug in there that could help investigating this issue.

Thanks,
Mariusz

Hi Mariusz,


Thank you for the quick feedback.

Can you please turn off the Tomcat server on your production server for some time and run the following code to see if it is still generating the exception (i.e. on a bare minimum windows server 2003 OS)? This way, we’ll be able to narrow down the issue to OS only and will be in a better position to do further investigation. Also, please tell us which version of Java are you using?


Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone(“GMT”));

Date startDate = calendar.getTime();

calendar.add(Calendar.HOUR, 1);

Date endDate = calendar.getTime();

MailAddressCollection attendees = new MailAddressCollection();

attendees.add("attendee@gmail.com");

MailAddress organizer = new MailAddress("organizer@domain.com");

Appointment app = new Appointment(“location”, “summary”, “Message body”, startDate, endDate, organizer, attendees);

I tried running this code with JRE5, JRE6 and JRE7 with Aspose Emails 2.7.0.0 jre4 and jre6, but every time I get:


Exception in thread “main” java.lang.NullPointerException
at com.aspose.email.Appointment.resetTimeZone(Unknown Source)
at com.aspose.email.Appointment.(Unknown Source)
at com.aspose.email.Appointment.(Unknown Source)
at com.aspose.email.Appointment.(Unknown Source)
at com.aspose.email.Appointment.(Unknown Source)
at test.Test.main(Test.java:43)

I have the same issue on another server Windows Server Enterprise 2007

Are you able to provide any date when this issue can be fixed? We need to update our customers.


Thanks,
Mariusz

Hi Mariusz,


Fixing an issue needs us to reproduce it at our end first. I am afraid that I am unable to reproduce this issue at my end on two machines having Windows server 2003 R2 SP2. I am further investigating this issue, and in case of continued failure towards reproducing it at my end, I’ll contact the development team for looking into this issue and assist further.

I’ll soon write back here and share my findings in this regard and appreciate your patience till then.

Well, if you could send me some debug build it would speed up that process. I think it’s a question about which line extactly fails with NullPointerException and then it should be easy to find the cause of it. Feel free to contact me by email.


Regards,
Mariusz

Hi Mariusz,

mariuszpala:


I think it’s a question about which line extactly fails with NullPointerException



I’m afraid providing a version that contains debug information may take some time and is considered the last resort at our end. Can you confirm to us if you are getting the exception at the following line (leave internal details for now):

Appointment app = new Appointment(“location”, “summary”, “Message body”, startDate, endDate, organizer, attendees);

I suggest to please write the code execution log after execution of each line so that we can known exactly where the exception arises. This way our development team will be in a much better position to assist further.

It fails on that line exaxtly. In the stack trace I sent you can see it’s fails in Appointment.resetTimeZone method which is executed in Appointment class contructor.

Hi Mariusz,

I have provided the details of this issue to our development team to sought help/guidance in this regard, and will update you here once I have any information. The common information that we need from our valuable users include the exact JDK version that they are using, and the OS details. I have forwarded these details, as you provided earlier, to our development team. But if there is still anything that is missing, please let us know, so that we can suggest more useful assistance in this regard.

Hi Mariusz,

Can you please run the following lines of code on your production machine and let us know the output?


System.out.println(java.util.Locale.getDefault().toString());

System.out.println(TimeZone.getDefault().getID());

Also, as I mentioned earlier, please provide us any missing information about your production server that you may have missed in the details above.

Result:


en_US
GWT-05:00

Regards,
Mariusz

Hi Mariusz,


I have repeatedly tried to re-produce the issue but could not succeed.

I have forwarded all the information to the development team along with sample code and environment details. Development team will schedule this activity and will provide feedback after detailed analysis. I will write back here as soon as some information is received from the developers.

This issue is logged in our issue tracking system as as NETWRKJAVA-33226.

The issues you have found earlier (filed as NETWRKJAVA-33226) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi Mariusz,


Could you please tell us if your problem is solved with Aspose.Email for Java 2.8.0 or you still facing this issue? As this issue couldn’t be reproduced at our end, we need your feedback to close the ticket associated with this thread.

Unfortunately it still fails.


With aspose-email-2.8.0.0-jdk14.jar I get:

java.lang.NullPointerException
at com.aspose.email.kC.a(Unknown Source)
at com.aspose.email.kC.a(Unknown Source)
at com.aspose.email.Appointment.a(Unknown Source)
at com.aspose.email.Appointment.a(Unknown Source)
at com.aspose.email.Appointment.requestApointment(Unknown Source)
at com.aspose.email.Appointment.requestApointment(Unknown Source)

Hi Mariusz,


Thank you for the feedback.

I was able to observe this exception at my end using the latest version of Aspose.Email for Java 2.8.0, and have logged it in our issue tracking system as: NETWRKJAVA-33236. Development team will look into it and we’ll update you here once the fix is available. We are sorry for the inconvenience caused.

The issues you have found earlier (filed as NETWRKJAVA-33236) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.