I have just updated my server to 5.13 from 5.01,
the mail plugin now crashes out when i try to create an attachment.
The following line works in 5.01 and 3.5 before it:
var attachment = plugins.mail.createBinaryAttachment('report_'+id+'.pdf',medleg_client_to_so_appointments.rw_final_report);
where medleg_client_to_so_appointments.rw_final_report is pdf in a blob field.
I now get the error:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/mail/MessagingException
at com.servoy.extensions.plugins.mail.MailPlugin.getScriptObject(MailPlugin.java:68)
at com.servoy.j2db.scripting.Zk.get(Zk.java:22)
at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1641)
at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1429)
at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1418)
at org.mozilla.javascript.gen.c33._c0(DISPATCH_1_REPORT:1244)
at org.mozilla.javascript.gen.c33.call(DISPATCH_1_REPORT)
at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:101)
at org.mozilla.javascript.gen.c32._c0(DISPATCH:906)
at org.mozilla.javascript.gen.c32.call(DISPATCH)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127)
at org.mozilla.javascript.gen.c32.call(DISPATCH)
at com.servoy.j2db.scripting.Ztb.executeFunction(Ztb.java:122)
at com.servoy.j2db.Zwb.Za(Zwb.java:946)
at com.servoy.j2db.Zwb.Za(Zwb.java:953)
at com.servoy.j2db.Zcc.Za(Zcc.java:2)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:23)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:19)
at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:68)
at com.servoy.j2db.dataui.Zab.actionPerformed(Zab.java:1)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6348)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3255)
at java.awt.Component.processEvent(Component.java:6113)
at java.awt.Container.processEvent(Container.java:2085)
at java.awt.Component.dispatchEventImpl(Component.java:4714)
at java.awt.Container.dispatchEventImpl(Container.java:2143)
at java.awt.Component.dispatchEvent(Component.java:4544)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
at java.awt.Container.dispatchEventImpl(Container.java:2129)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4544)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.ClassNotFoundException: javax.mail.MessagingException
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at com.sun.jnlp.JNLPClassLoader.findClass(JNLPClassLoader.java:257)
at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
... 46 more
So I can no longer create pdf attachments to mail?
Is this a bug in Java, the mail plugin, or was my code just bad and Servoy has just got stricter?
So now i cant use servoy 5.01 as my machines are updated, i cannot delete one space on a mac and can no longer send email attachments! Ill just sit here and Hmm that song from the life of brian, lifes a lump of … when you look at it!
David