Re: Has ANYONE gotten the [object] context to work with Java(OSX) ??? HELP!

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 43666
interpreted = N
texte = Okay, now that the engine is loading the java VM libs, there are a couple other issues to consider. First, your JavaClassPath pref should contain all the paths needed for your java class/jar files. In your case, it seems that the path is setup correctly. Second, the [Object] context can only call Java methods that fit this particular 'signature' (prototype):public static String MyJavaFunction(String[] args, int []type)So this should work... public class WebDNAJava{ public static String TestMethod(String []args, int []type) { return Hello from java!!!!!!!!; } }And in your tpl file.... [object objname=WebDNAJava&call=TestMethod&type=1&classpath=][/object] Also, the method you are trying to call can not be the 'main' method.In some cases the method you wish to invoke may not 'fit' that prototype. In that case, you can create a new java method that acts as a 'middle man'. So the [object] context would call your 'middle man' method, and you 'middle man' method would then call the desired method.> -----Original Message----- > From: WebCatalog Talk > [mailto:WebDNA-Talk@talk.smithmicro.com]On Behalf > Of Sage Hobbs > Sent: Friday, September 20, 2002 1:32 PM > To: WebCatalog Talk > Subject: Re: Has ANYONE gotten the [object] context to work with Java > (OSX) ??? HELP! > > > Thanks, Le that's definitely the right Java path, but > now I'm getting > the error: > > Error:Could not locate the java method (readFromURL) with the > signature > '([Ljava/lang/String;[I)Ljava/lang/String' in the java class > (URLGetter). > > I stripped down my class to just the single method, to > test basic > functionality. The method returns and accepts a java.lang.String, so > what's the error about? > > ========================================== > public class URLGetter > { > public String readFromURL(String params) { > return new String(Hurray, it worked.); > } > } > > ----------------------- > Sage Hobbs > shobbs@nwaonline.net > Internet Administrator, The Morning News > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://search.smithmicro.com/------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Has ANYONE gotten the [object] context to work with Java(OSX) ??? HELP! (Sage Hobbs 2002)
  2. Re: Has ANYONE gotten the [object] context to work with Java(OSX) ??? HELP! (Scott Anderson 2002)
  3. Re: Has ANYONE gotten the [object] context to work with Java(OSX) ??? HELP! (Sage Hobbs 2002)
  4. Re: Has ANYONE gotten the [object] context to work with Java(OSX) ??? HELP! (Le Pham 2002)
  5. Re: Has ANYONE gotten the [object] context to work with Java(OSX) ??? HELP! (Scott Anderson 2002)
  6. Re: Has ANYONE gotten the [object] context to work with Java(OSX) ??? HELP! (Sage Hobbs 2002)
  7. Re: Has ANYONE gotten the [object] context to work with Java(OSX) ??? HELP! (Sage Hobbs 2002)
  8. Re: Has ANYONE gotten the [object] context to work with Java(OSX) ??? HELP! (Scott Anderson 2002)
  9. Re: Has ANYONE gotten the [object] context to work with Java(OSX) ??? HELP! (Dan Strong 2002)
Okay, now that the engine is loading the java VM libs, there are a couple other issues to consider. First, your JavaClassPath pref should contain all the paths needed for your java class/jar files. In your case, it seems that the path is setup correctly. Second, the [object] context can only call Java methods that fit this particular 'signature' (prototype):public static String MyJavaFunction(String[] args, int []type)So this should work... public class WebDNAJava{ public static String TestMethod(String []args, int []type) { return Hello from java!!!!!!!!; } }And in your tpl file.... [object objname=WebDNAJava&call=TestMethod&type=1&classpath=][/object] Also, the method you are trying to call can not be the 'main' method.In some cases the method you wish to invoke may not 'fit' that prototype. In that case, you can create a new java method that acts as a 'middle man'. So the [object] context would call your 'middle man' method, and you 'middle man' method would then call the desired method.> -----Original Message----- > From: WebCatalog Talk > [mailto:WebDNA-Talk@talk.smithmicro.com]On Behalf > Of Sage Hobbs > Sent: Friday, September 20, 2002 1:32 PM > To: WebCatalog Talk > Subject: Re: Has ANYONE gotten the [object] context to work with Java > (OSX) ??? HELP! > > > Thanks, Le that's definitely the right Java path, but > now I'm getting > the error: > > Error:Could not locate the java method (readFromURL) with the > signature > '([Ljava/lang/String;[I)Ljava/lang/String' in the java class > (URLGetter). > > I stripped down my class to just the single method, to > test basic > functionality. The method returns and accepts a java.lang.String, so > what's the error about? > > ========================================== > public class URLGetter > { > public String readFromURL(String params) { > return new String(Hurray, it worked.); > } > } > > ----------------------- > Sage Hobbs > shobbs@nwaonline.net > Internet Administrator, The Morning News > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://search.smithmicro.com/------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Scott Anderson

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

No luck with taxes (1997) Help! WebCat2 bug (1997) Major Security Hole IIS NT (1998) ConvertChars (2000) Searching multiple fields from one form field (1997) Email Problems on 4.0 (2000) [WebDNA] Middle Question (2015) Online reference (1997) Problem with encrypted cookies (2000) changing order number (1998) Math Context (1998) Only charge card when product shipped ? (1997) itools webcat atartup (2000) NT IIS number of files limit (2003) Max Record length restated as maybe bug (1997) [WebDNA] Securing form input on WEBDNA (2018) PCS Frames (1997) Replace with Producteditor.tpl (2000) apparent variable variable display? (2000) Email Line Breaks (2003)