john renfrew Posted November 15, 2016 Posted November 15, 2016 Been tearing my ears off most of the afternoon and there is an issue between 15 client and 15 server on Windows Simplest case load Java Mail 1.4.7 jar use the following function import javax.mail.* import javax.mail.internet.* fis = new FileInputStream(fm_fileIn) mimeMessage = new MimeMessage(null, fis) return mimeMessage.getContent().getContentType() and send it the path an EML mail file. Run from a client ON the server you get : >>multipart/alternative; boundary="B_3517403371_9455676" Run as PSOS from the same server with the same single jar loaded you get: >>No signature of method: javax.mail.util.SharedByteArrayInputStream.getContentType() is applicable for argument types: () values: [] Something weird in the neighbourhood........
David Wikström Posted November 15, 2016 Posted November 15, 2016 Are you sure that this isn't a simple permissions issue due to FMS being sandboxed? What's the location of the EML mail file?
john renfrew Posted November 15, 2016 Author Posted November 15, 2016 (edited) It's in the FMServer documents folder, BUT to be fair it happens if you turn a container field into a stream too, just didn't want to confuse the issue.. The issue is with the stream (FileInputStream or ContainerStream ) not being converted to the MAilMessage object correctly between the two JVMs john Edited November 15, 2016 by john renfrew
David Wikström Posted November 15, 2016 Posted November 15, 2016 And if you do something else with the InputStream (like set a FileMaker field or save a file), it works fine? Have you had the possibility to test on FMS running on a Mac?
Jesse Barnum Posted November 15, 2016 Posted November 15, 2016 Check the Java extensions directory on the server. Sounds like there may be a different version of mail.jar or activation.jar that is taking precedence over the jars you're loading with ScriptMaster.
john renfrew Posted November 15, 2016 Author Posted November 15, 2016 (edited) Will look when I in there later this week..... Given that the behaviour is both from the server and the client on the same machine, surely the JVM attached to the script master object uses the same JRE, which is why I don't get the difference in behaviour - same file, same jars and functions loaded, nothing added to the JRE permanently. john Edited November 15, 2016 by john renfrew
john renfrew Posted November 18, 2016 Author Posted November 18, 2016 I can confirm this issue is the same on a Mac, in this case running server 14...
john renfrew Posted November 18, 2016 Author Posted November 18, 2016 The issue seems to be that for the mail functions, you need to explicitly re-load the jars files required AND the function, each time you use it. Given that the default behaviour is that once a jar or a function is loaded it is available to all script until reminded or the script engine is restarted, this is not 'expected' behaviour.
john renfrew Posted November 18, 2016 Author Posted November 18, 2016 Is this a change of behaviour in Server 15??????? if each PSOS was running anew session that knew nothing of the original server session that would make sense, except it only appears to affect Mail functions....
Recommended Posts
This topic is 3018 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now