Hi,
I'm trying to import a java file in to a as1 Extension file..
which i was able call it successfully in my local server(in my system). but there occurs an error in the main server as follows :
Error in extension [ example.as ]: TypeError: [Java
Package RefNumberTest] is not a function, it is org.mozilla.javascript.NativeJavaPackage.
please help me in this issue...
import java in as1 (Extension) file
-
- Posts: 7
- Joined: 10 Mar 2011, 09:48
- Location: India
Hi. Don't forget that you have to add the jar file to the classpath.
For more information check this.
For more information check this.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
-
- Posts: 7
- Joined: 10 Mar 2011, 09:48
- Location: India
rjgtav wrote:Hi. Don't forget that you have to add the jar file to the classpath.
For more information check this.
yeah the jar files are added to the classpath already,
&
i had noticed the wrapper doesn't contain the "javaExtensions" in the class paths. & i added tat as well already...Even then it is not recognizing ...
Sasank
Hum... does it load the jars? for example, when you start the server, does it show "processing new jar... blablabla"
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
-
- Posts: 7
- Joined: 10 Mar 2011, 09:48
- Location: India
yeah..
and now the progress is i'm able to call the class file.. i'm getting the print statement which is written in the constructor ..
but if i try to access the function in it .. it is throwing err..
FYR:
// this is the function in the java class that i try to access..
public String getName(){
return "hai";
}
//when i try to access that file as
HelloWorldApp.getName();
// it is throwing Err as follows ..
Java class "HelloWorldApp" has no public instance field or method named "getName".
and now the progress is i'm able to call the class file.. i'm getting the print statement which is written in the constructor ..
but if i try to access the function in it .. it is throwing err..
FYR:
// this is the function in the java class that i try to access..
public String getName(){
return "hai";
}
//when i try to access that file as
HelloWorldApp.getName();
// it is throwing Err as follows ..
Java class "HelloWorldApp" has no public instance field or method named "getName".
Sasank
-
- Posts: 7
- Joined: 10 Mar 2011, 09:48
- Location: India
BigFIsh wrote:is getName a static method? If not, you need to create a new instance of HelloWorldApp then call getName.
If you're new to Java or OOP, I would suggest doing some readings as use a different approach than AS1/2.
getName is not a static method. u can see the function which i mention in my previous post.
Note: I'm able to call the class in my local system.
The problem is when i place the class file in some other system and access it,
i'm able to get the instance of the class but while i call a method it throws error as
TypeError: getName
is not a function, it is org.mozilla.javascript.NativeJavaPackage
Sasank
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 51 guests