custom class working in Developer but not in Client

Questions, answers, tips and ideas on Servoy Client

custom class working in Developer but not in Client

Postby yekinabud » Fri Apr 04, 2008 3:35 am

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:

Code: Select all
Packages.frah_classes.MyJTable()


It does not load in Client and I get the following error:

Code: Select all
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:

Code: Select all
  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
yekinabud
 
Posts: 30
Joined: Wed Dec 05, 2007 10:06 pm

Postby sbutler » Fri Apr 04, 2008 7:14 am

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
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Postby yekinabud » Fri Apr 04, 2008 4:51 pm

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?
yekinabud
 
Posts: 30
Joined: Wed Dec 05, 2007 10:06 pm

Postby sbutler » Fri Apr 04, 2008 4:54 pm

just by placing it in the plugins folder. Should be like myplugin.jar.jnlp
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Postby yekinabud » Fri Apr 04, 2008 5:28 pm

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/.
yekinabud
 
Posts: 30
Joined: Wed Dec 05, 2007 10:06 pm

Postby sbutler » Fri Apr 04, 2008 5:31 pm

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.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Postby yekinabud » Fri Apr 04, 2008 5:51 pm

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:

Code: Select all
<extension href="/servoy-client/plugins/frah_classes.jar.jnlp" version="1203271764000" name="frah_classes.jar"/>


The Client JNLP has the reference:

Code: Select all
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.
yekinabud
 
Posts: 30
Joined: Wed Dec 05, 2007 10:06 pm

Postby sbutler » Fri Apr 04, 2008 11:14 pm

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.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH


Return to Servoy Client

Who is online

Users browsing this forum: No registered users and 16 guests

cron