HELP - No way to find a Java class from AS extension

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
Pippoflash
Posts: 135
Joined: 30 Jan 2006, 17:16
Contact:

HELP - No way to find a Java class from AS extension

Post by Pippoflash »

Hi,
I have tried in any way, but I always get the same error:
21:28:44.595 - [ WARNING ] > Error in extension [ _pippoExt.as ]: TypeError: [JavaPackage test.SimpleClass] is not a function, it is org.mozilla.javascript.NativeJavaPackage. (_pippoExt.as#1580) Internal: 5 -- Line number: 4 in file: _pippoExt.as

Here is the scenario:
- I created a java class called SimpleClass which lives in the javaExtensions/test/ folder.
- The class works, and it can be correctly instantiated from a java extension, but I do need to instantiate it from an AS extension.
- Path has been added to start.bat (both path to the folder containing .class file, and I tried also creating a .jar and adding the jar)

In the AS extension init() :

var test = Packages.test
var c = new test.SimpleClass()
trace("Hello from the Simple Extension Example!"+c)

I am going nuts.
There is no way to have the AS see the java class...
can anybody help?

thanks
F
-----------------------
www.pippoflash.com
-----------------------
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Your code snippet looks file to me.

Not sure what could be wrong. Could be due to invalid path definition or bad placing of .jars.

So, try start again from scratch using the following example as a guide. http://www.smartfoxserver.com/docs/docP ... /index.htm.
Smartfox's forum is my daily newspaper.
Post Reply