LS2J: Passing int causes "Error 304: LS2J Error: Java constructor failed to execute"

Hello,

Java Class in “script” library:

public URL( String strProxyProtocol, String strProxyName, int iProxyPort, String strURL )

My call from LotusScript:

Set jc = jsession.GetClass(“URL”)

Set jo = jc.CreateObject( “(Ljava/lang/String;Ljava/lang/String;I;Ljava/lang/String;)V”, “http”, “1.1.1.1”, 8080, “http://2.2.2.2/” )

Error:

Error 304: LS2J Error: Java constructor failed to execute

Any ideas? I’m able to pass one String parameter without problems but this combination of String and int does not work. I’ll probably try a workaround where I pass the int as string but it would be nice to get the int passing to work too.

Thanks,

Panu

Subject: LS2J: Passing int causes “Error 304: LS2J Error: Java constructor failed to execute”

Panu,

Instead of “I;” just have “I” so those last two parameters would appear as “ILjava/lang/String;”. The semicolon is not a separator, it is part of the name “java/lang/String;”. There is no separator between the arguments passed to your Java class.

Ken

Subject: LS2J: Passing int causes “Error 304: LS2J Error: Java constructor failed to execute”: WORKS!

Thanks, it works! I used an example from here:

which is incorrect. Looking at the Notes help it is described there correctly but in a bit cryptic way.

Panu