Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Scriptmaster 3.0 woes on FM Server 10

Featured Replies

I worked up some scripts that call some Scriptmaster java functions that have been registered with RegisterGroovy. One is mail with authentication and the other is MD5 hash. My scripts were fully debugged and were able to send out email with MD5 hash value of text when run on FM Pro 8.5 connected to database being served by FM Server 10.

When i asked the admin of the FM serving service to add Scriptmaster 3.0 they did and then i had them set up an automatic execution at 1am every day of the same script i can run manually. This is where the trouble starts.

1. The MD5 hash returns a '?' not a value.

2. The email function says it was successful but the mail never arrives.

The admin of the FM server says he has had some problems with Scriptmaster and memory loss. The strange thing is that he is NOT seeing the java functions being registered with RegisterGroovy in his logs.

Has anyone run into this or has any ideas as to what might be causing java functions that i register with RegisterGroovy that work on FM Pro fail when running on FM Server?

Any clues appreciated.

There are a few points here where this could be going wrong, so please double check these points and let me know if any of these are the issue.

1. Is ScriptMaster installed in the server's Extensions directory? The plugin must be placed in this location, your server restarted, and then the plugin activated from your server's admin console. Please make sure that ScriptMaster shows up in your server's plugin list and is checked as active.

2. You must call the RegisterGroovy function in your script (or a script which is called by your script) in order to use ScriptMaster functions in a scheduled script. Oftentimes people will put their RegisterGroovy functions in their database's startup script. This will make the functions work in FileMaker Pro, but the server will not call the opening script when running its schedules, and so the functions will not work on the server. You must call the RegisterGroovy function in the script which is being run on the server in order for ScriptMaster functions to work. Please make sure the the RegisterGroovy functions are being correctly called in the script which the server is running.

Please let me know if this does not resolve your issue.

Whoops! A correction to my reply:

FileMaker Server will run opening scripts when running a scheduled script, so you will be ok if your RegisterGroovy function is there. If it is not, you will need to make sure that you call Register Groovy somewhere in your script which is running.

Another issue which may be the culprit:

3. FileMaker server keeps these modules in its memory until you restart the server, so if you call the RegisterGroovy function on your server, make a correction in your scriptmaster module, and then call RegisterGroovy again, your correction will not be loaded in with the RegisterGroovy function. You will need to restart the server before FileMaker server will re-register your module and take your corrections.

Also, could you please post your logs? This may help diagnose where your issue is coming from.

  • Author

Dear Smef,

Thanks for your responses. I already made changes based on server not running startup script which will not get in the way if startup script running.

Are you sure server does run the startup script? I ask since the issue is that the server logs don't show the registering of the java functions. My script for registering would only take place if some vars were set to a certain value in the startup script; now i check to see if running on server and set the vars when main script runs to force to register each time.

Hummm... so a function is registered until server is restarted; that seems to imply that there should be a "ReregisterGroovy()" func to allow redefining, if that is even possible in the Groovvy environment.

Question: Is a function registered in just that one database environment or does that register it for the whole server?

I do not have access to the server since running on hosting service so i don't know if i will be able to provide logs. Will try.

Thanks for your help so far. I have yet still to get a test run since i made changes, though your second message would indicate that i have not fixed the problem by not relying on startup script running on server.

Will let you know what happens.

Peace,

Isis

  • Author

Problem solved. Let me repeat something before i tell how. The text of the java function that was being registered with RegisterGroovy() on a FM 8.5 client registered and worked just fine; the same text would not register on the FM 10 Server Windows.

So what was the problem? There was a hard return character right after the opening quote and right before the close quote of the function text, like this:

RegisterGroovy( "xxx_SendEmail( from ; to ; subject ; body ; smtpHost ; port)" ;

"

import javax.mail.*;¶

import javax.mail.internet.*;¶

...

Transport.send(msg);¶

return true;¶

"

)

When you change it to:

RegisterGroovy( "xxx_SendEmail( from ; to ; subject ; body ; smtpHost ; port)" ;

"import javax.mail.*;¶

import javax.mail.internet.*;¶

...

Transport.send(msg);¶

return true;¶"

)

now it works on both client (FM Pro 8.5 on Mac OS X) and server (FM 10 Server on Windows)

End of story. Thanks for responses. I hope this helps someone else find this strange issue. I bet 360Works would like to know about this.

Peace,

isis

Hi Isis - I was not able to reproduce the problem on a Mac running FM Advanced 10. We are checking on Windows now.

We've tested now on Mac and Windows, in client as well as server with version 10, and cannot reproduce the problem. Could you please try reproducing the problem again? Then, without quitting FileMaker, go to plugin preferences and use the 'report a bug' feature. This will send us your log file for troubleshooting.

  • Author

Hi Jesse,

It wouldn't produce a problem on Mac FM Pro 8.5 advanced (not server) so i can't reproduce on my Mac.

The problem would only happen on Windows FM Server 10. I do not have access to the server. The solution is hosted at a FM Server host service. In this case, if i change the Java code to break it, what can the admin at the hosting service do to send you something that would help, if any?

Remember, the problem on the server is that with the hard return in the java code it would not register and would not show up in the Scriptmaster log file as registering. So it seems like there would be nothing to send you.

Would the windows server config help? I don't know what version of windows they are running.

One thing i'll throw in that might possibly help is that i copied the code from your template db to the solution i was working on while in Mac. The problem shows up on Windows. Could it be some eol issue in the java parser?

I would like to help you solve this bug since this caused many hours of debugging.

Peace,

isis

Hello Isis - maybe the cross-platform line endings are the culprit, I'm really not sure.

The plugin log file on the server is located at:

Documents and SettingsDefault UserMy Documents360Plugin Logs

These logs get overwritten each time FileMaker Server is started, so be sure to reproduce the problem and then immediately get the log file from the hosting provider.

  • 1 month later...

I had a similar problem with some custom mail scripts that I wrote. I solved the problem by loading mail.jar before registering the function.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.