is not a function, org.mozilla.javascript.NativeJavaPackage

Hi all,

I am trying to use “org.apache.wicket.util.crypt.Base64” in my globals file. I instantiate it like this:

var base64 = new Packages.org.apache.wicket.util.crypt.Base64();

This works when I run it in the Servoy developer, but when I deploy it in the application server the following is displayed:

[Packages.org.apache.wicket.util.crypt.Base64] is not a function, it is org.mozilla.javascript.NativeJavaPackage

Can anybody help me on this? Thanks!

Is this smartClient? I think the wicket is not send to client in smartClient. In the developer you have it as a side effect.

Thanks for the reply.

I am calling it inside the method that is called by the plugins.busy.block using Smart Client.

If it is not sent to the client, how do I add the library to the Smart Client then?

Wicket shouldn’t be on the smart client, it is a webclient library, it has no use on a smart client.
Also i even don’t know if that class is even public api of Wicket, so it even could if we upgrade the lib that that is changed… (so breaks your solution)
Why do you want it?

Thanks for the input.

I am just decoding a base64 input parameter. If the library is the issue, if I move to org.apache.commons.codec.binary.Base64 will it work? Or what function does Servoy recommend to use for this?

You can use Packages.org.apache.commons.codec.binary.Base64
“lib/commons-codec.jar” which contains this class is pushed to the client by the http plugin so it will be available.

I’ve solved the problem.

I removed all references to the library and created our own base64 conversion in our plugin.

It already worked when deployed in the server. Thanks for the replies.