Issue while sending email from OrientDB

109 views
Skip to first unread message

Gaurav Dhiman

unread,
Mar 4, 2014, 7:44:53 AM3/4/14
to orient-...@googlegroups.com
Hi,

I tried to send the email from server side JS function on localhost as explained on below link:

Got below error:
Error on parsing script at position #0: Error on execution of the script
Script: sendEMail
------^
sun.org.mozilla.javascript.internal.WrappedException: Wrapped java.lang.NullPointerException (<Unknown source>#20) in <Unknown source> at line number 20
Wrapped java.lang.NullPointerException (<Unknown source>#20)
null

Mail plugin loaded successfully and even default profile is identified as shown on server start.

Any clue, why this error ? Error says null pointer, but where is the null pointer ?

Best Regards,
Gaurav

Gaurav Dhiman

unread,
May 13, 2014, 2:24:58 PM5/13/14
to orient-...@googlegroups.com
Did anyone face this issue - Null pointer exception while sending email from OrientDB

Still getting Null pointer exception.

Reproduce this issue:

1. Set email profile as below in config fileorientdb-server-config.xml
              <!-- MAIL, TO TURN ON SET THE 'ENABLED' PARAMETER TO 'true' -->
<handler 
class="com.orientechnologies.orient.server.plugin.mail.OMailPlugin">
 <parameters>
<parameter name="enabled" value="true" />
<!-- CREATE MULTIPLE PROFILES WITH profile.<name>... -->
<parameter name="profile.default.mail.smtp.host" value="smtp.gmail.com"/>
<parameter name="profile.default.mail.smtp.port" value="465" />
<parameter name="profile.default.mail.smtp.auth" value="true" />
<parameter name="profile.default.mail.smtp.starttls.enable" value="true" />
<parameter name="profile.default.mail.smtp.user" value="<<your...@gmail.com>>" />
<parameter name="profile.default.mail.smtp.password" value="<<yourpassword>>" />
<parameter name="profile.default.mail.date.format" value="yyyy-MM-dd HH:mm:ss" />
 </parameters>
</handler>

2. Restart the OrientDB server.
3. Write JS function in OrientDB with below code to send email:

mail.send({
  profile: "default",
  to: "<<toE...@gmail.com>>",
  cc: "<<alterna...@gmail.com>>",
  subject: "The EMail plugin works",
  message : "Sending email from OrientDB Server is so powerful to build real web applications!"
});
return "Sent email";

In above code, replace text in <<>> with your suitable emails.

4. Invoke the JS function over REST, you will see the null pointer exception.

Kindly suggest the root cause and possible solution or workaround.

Regards,
Gaurav

Gaurav Dhiman

unread,
May 15, 2014, 6:10:55 AM5/15/14
to orient-...@googlegroups.com
Anyone faced this Null pointer exception ?
Any solution or work around ?

Regards,
Gaurav

Gaurav Dhiman

unread,
May 27, 2014, 1:34:09 AM5/27/14
to orient-...@googlegroups.com
I will appreciate if some can share pointers to resolve this null pointer issue.
I am using version 1.7-rc1 with mail plugin enabled.

Regards,
Gaurav

Artem Orobets

unread,
May 27, 2014, 4:24:05 AM5/27/14
to orient-...@googlegroups.com
Hi Gaurav,

Sorry for delay. 

Could you create a ticket on github to track the issue?

It looks like the JS binding were not initialized correctly.
Have you tried to check if mail variable is injected correctly?

What JS engine do you use? What Java version do you use?


Best regards,
Artem Orobets

Orient Technologies

the Company behind OrientDB



--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gaurav Dhiman

unread,
May 27, 2014, 7:13:53 AM5/27/14
to orient-...@googlegroups.com
Hi,

I am not using Java.
As explained, I defined JS function in OrientDB and just invoked it through REST/HTP to send email, but it results in null pointer.

I will create ticket for it in bug system.

Thanks,
Gaurav

Gaurav Dhiman

unread,
May 27, 2014, 7:20:00 AM5/27/14
to orient-...@googlegroups.com
Filed a bug. Here is the link:

Regards,
Gaurav

Artem Orobets

unread,
May 27, 2014, 9:40:31 AM5/27/14
to orient-...@googlegroups.com
Hi Gaurav,

I meant what Java version is used to run OrientDB? You can check that by running `java -version` in terminal.

Could you try to check what is the value of `mail` variable, is it initialized?


Best regards,
Artem Orobets

Orient Technologies

the Company behind OrientDB



Gaurav Dhiman

unread,
May 29, 2014, 8:14:41 AM5/29/14
to orient-...@googlegroups.com
Please find my responses inlined


On Tuesday, May 27, 2014 7:10:31 PM UTC+5:30, Artem Orobets wrote:
Hi Gaurav,

I meant what Java version is used to run OrientDB? You can check that by running `java -version` in terminal.

Java version on my system is 1.7.0_45
 

Could you try to check what is the value of `mail` variable, is it initialized?

Value of 'mail' variable is com.orientechnologies.orient.server.plugin.mail.OMailPlugin@15df229a

Luca Garulli

unread,
May 29, 2014, 10:16:03 AM5/29/14
to orient-database
Fixed!

Lvc@

Gaurav Dhiman

unread,
May 29, 2014, 1:51:33 PM5/29/14
to orient-...@googlegroups.com

To try, which version I need to download ?

Gaurav

You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/s4QcZM6J-78/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

Luca Garulli

unread,
May 29, 2014, 2:07:03 PM5/29/14
to orient-database
Get the 1.7.1-SNAPSHOT.

Lvc@

Gaurav Dhiman

unread,
Jun 1, 2014, 6:30:42 AM6/1/14
to orient-...@googlegroups.com
Thanks.
I confirmed, its working with 1.7.1 snapshot.

Regards,
Gaurav
Reply all
Reply to author
Forward
0 new messages