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 On Tuesday, May 27, 2014 1:54:05 PM UTC+5:30, Artem Orobets wrote: > > 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 Technologiesthe Company behind OrientDB* > > > 2014-05-27 8:34 GMT+03:00 Gaurav Dhiman <[email protected]<javascript:> > >: > >> 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 >> >> >> >> On Thursday, May 15, 2014 3:40:55 PM UTC+5:30, Gaurav Dhiman wrote: >>> >>> Anyone faced this Null pointer exception ? >>> Any solution or work around ? >>> >>> Regards, >>> Gaurav >>> >>> >>> On Tuesday, May 13, 2014 11:54:58 PM UTC+5:30, Gaurav Dhiman wrote: >>>> >>>> Did anyone face this issue - Null pointer exception while sending email >>>> from OrientDB >>>> >>>> I did same what has been explained here https://github.com/ >>>> orientechnologies/orientdb/wiki/Mail-Plugin >>>> 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="<<*[email protected] >>>> <javascript:>>>*" /> >>>> <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: "*<<[email protected] <javascript:>>>*", >>>> cc: "*<<[email protected] <javascript:>>>*", >>>> 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 >>>> >>>> >>>> >>>> >>>> On Tuesday, March 4, 2014 6:14:53 PM UTC+5:30, Gaurav Dhiman wrote: >>>>> >>>>> Hi, >>>>> >>>>> I tried to send the email from server side JS function on localhost as >>>>> explained on below link: >>>>> https://github.com/orientechnologies/orientdb/wiki/Mail-Plugin >>>>> >>>>> 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 >>>>> >>>>> -- >> >> --- >> 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 [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- --- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
