What do I need to do to get my custom external classes working in Servoy Client? They work in Developer just fine.
CONTEXT:
I created my own JTable subclass, put it in a JAR file in the plugins directory, and am able to load in Developer with:
Packages.frah_classes.MyJTable()
It does not load in Client and I get the following error:
JavaPackage frah_classes.MyJTable is not a function
I thought maybe I needed to create a JNLP file, so I created the following file called ‘frah_classes.jar.jnlp’ and put it in the plugins directory along with my JAR file:
1 <?xml version="1.0" encoding="utf-8"?>
2 <jnlp spec="1.0+"
3 codebase="%%serverURL%%"
4 href="/servoy-client/plugins/frah_classes.jar.jnlp">
5 <information>
6 <title>Servoy Client Plugins</title>
7 <vendor>Servoy and Others</vendor>
8 <offline-allowed/>
9 </information>
10 <resources>
11 <jar href="/plugins/frah_classes.jar" download="eager" version="%%version%%"/>
12 </resources>
13 <component-desc/>
14 </jnlp>
Do I need to do this to get my custom classes working in Sevoy Client? Is there something wrong with my JNLP syntax? How can I get my classes to work in Client?
Thanks in advance for any tips.
Tony
You do need to use that .jnlp file in order to get your jar downloaded to the client when they install servoy.
So, what you have so far should work. Try restarting the server, clearing the client’s cache, and testing it again.
-Scott
Thanks for the reply, Scott.
It looks like you need to add an ‘extension’ tag to the Client JNLP file. However, I can only figure out how to do that after the JNLP file is generated and you can edit it locally.
How do you add this to the Client JNLP automatically downloaded from the server?
just by placing it in the plugins folder. Should be like myplugin.jar.jnlp
That’s what I thought, but it’s not working. Cleared my client/browser cache, restarted the server, still no dice. MyClasses.jar and MyClasses.jar.jnlp are both in the plugins directory, but they aren’t being added to the Client JNLP downloaded from the server when I hit http://myserver.com:8080/.
when you go to that page, right click and download the servoy_client.jnlp file. In there, you should see a reference to your jnlp file. (you can open it with a text editor) If you don’t clear your browser cache and try again.
All the ‘extensions’ in the Client JNLP have the root ‘servoy-client’ - which I assume refers to my top level Servoy directory (because the plugins are all referenced in /servoy-client/plugins/ - which I know works if I add the extension after the Client JNLP has been downloaded:
<extension href="/servoy-client/plugins/frah_classes.jar.jnlp" version="1203271764000" name="frah_classes.jar"/>
The Client JNLP has the reference:
href="/servoy-client/servoy_client.jnlp"
But there is no such file in the Servoy root directory (nor anywhere else in the tree), so I assume this is an automatically generated file that I can’t edit directly.
If so, I’m wondering how it’s generated, and why it isn’t adding my class.jar/jnlp from the plugins directory if that’s where it looks.
It is generated automatically. I’m guessing you have some errors in your jnlp file, or the cache isn’t clearing. Take an existing jnlp file, copy it with a different name, then modify accordingly.