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:

template cache problem (1998) Fw: Webcat followup question (1999) RE: [WebDNA] WebDNA Showcase? (2008) Searching multiple fields (1997) Search probl. since change WebCatalog from 2.1.3 to 3.0 (1998) I got caught! (2003) A question on sub-categories (1997) WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) [WebDNA] HTML [sendmail] revisited (2009) How true is this? (1999) Weird bug, or is there something amiss? (1997) Alternative to Authorize.net (2002) RE: formula.db, adding option prices (1997) Type 2 errors with WebCatalog.acgi (1997) about this server and links to who (1997) Bug alert! (1997) File Upload Problems (HELP!) (2000) Replacing the db file (2000) [BULK] [WebDNA] triggers.db "next execute" fails to update (2012) memory in high traffic servers (2004)