Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

main method

5 posts in EJB Client Last posting was on 2006-05-10 02:56:35.0Z
CL Posted on 2006-04-27 05:07:44.0Z
From: "CL" <CL@somewhere.org>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: main method
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 203186061051.ctinets.com
X-Original-NNTP-Posting-Host: 203186061051.ctinets.com
Message-ID: <445051a0$1@forums-1-dub>
Date: 26 Apr 2006 22:07:44 -0700
X-Trace: forums-1-dub 1146114464 203.186.61.51 (26 Apr 2006 22:07:44 -0700)
X-Original-Trace: 26 Apr 2006 22:07:44 -0700, 203186061051.ctinets.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:637
Article PK: 424756

I'm learning how to call java in PB 10.2.1. I copied the code in
http://www.sybase.com/detail?id=1037085

Adding main method in class JavaPBTest:
public static void main(String args[]) {
System.out.println("Hello World");
}

Changing the Powerscript of the Try/Catch block to:
TRY
String ls_args[]
ls_args[1] = 'A'
l_javapbtest.main(ls_args)
CATCH( Throwable t )
MessageBox( "method call failed", t.getMessage() )
END TRY

When I run it, error occurs:
Error calling method of a PBNI object

What's the problem?


Bede <bede_nosp Posted on 2006-04-27 11:32:36.0Z
From: Bede <bede_nosp@m_sofico.be>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: main method
Message-ID: <MPG.1ebab969c7a7ee349897ae@forums.sybase.com>
References: <445051a0$1@forums-1-dub>
Organization: Sofico
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
User-Agent: MicroPlanet-Gravity/2.70.2067
X-Original-NNTP-Posting-Host: uu194-7-38-226.unknown.uunet.be
X-Original-Trace: 27 Apr 2006 03:20:55 -0700, uu194-7-38-226.unknown.uunet.be
Lines: 46
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 27 Apr 2006 03:20:58 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 27 Apr 2006 04:32:36 -0700
X-Trace: forums-1-dub 1146137556 10.22.108.75 (27 Apr 2006 04:32:36 -0700)
X-Original-Trace: 27 Apr 2006 04:32:36 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:638
Article PK: 424757

sorry, but that's far too less information to work with.

=> have the right proxies been generated? are the JVM & JavaPBTest class
instantiated properly, what J.D.K. version, are you using a ejb server
or not? if so -> which type (EAServer or not), what's the classpath, ...

also, try to activate logging when instantiating the JVM and check it's
vm.out output for debug info. and verify which classes are loaded after
instantiating JVM, e.g.:

If inv_JavaVM.createJavaVM(ls_classPath, True /* VM.OUT loggin */ ) = 0
Then
of_log("Java VM version " + inv_JavaVM.getJavaVMVersion() +
"~r~n~r~nCLASSPATH=" + inv_JavaVM.getJavaClasspath())
Else
of_log("Error instantiating JVM")
End If

Ben


In article <445051a0$1@forums-1-dub>, CL@somewhere.org says...

> I'm learning how to call java in PB 10.2.1. I copied the code in
> http://www.sybase.com/detail?id=1037085
>
> Adding main method in class JavaPBTest:
> public static void main(String args[]) {
> System.out.println("Hello World");
> }
>
> Changing the Powerscript of the Try/Catch block to:
> TRY
> String ls_args[]
> ls_args[1] = 'A'
> l_javapbtest.main(ls_args)
> CATCH( Throwable t )
> MessageBox( "method call failed", t.getMessage() )
> END TRY
>
> When I run it, error occurs:
> Error calling method of a PBNI object
>
> What's the problem?
>
>
>


CL Posted on 2006-04-28 02:37:22.0Z
From: "CL" <CL@somewhere.org>
Newsgroups: sybase.public.powerbuilder.ejbclient
References: <445051a0$1@forums-1-dub> <MPG.1ebab969c7a7ee349897ae@forums.sybase.com>
Subject: Re: main method
Lines: 66
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-Original-NNTP-Posting-Host: 203186061051.ctinets.com
Message-ID: <44516f12$1@forums-2-dub>
X-Original-Trace: 27 Apr 2006 18:25:38 -0700, 203186061051.ctinets.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 27 Apr 2006 18:25:39 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 27 Apr 2006 19:37:22 -0700
X-Trace: forums-1-dub 1146191842 10.22.108.75 (27 Apr 2006 19:37:22 -0700)
X-Original-Trace: 27 Apr 2006 19:37:22 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:640
Article PK: 424758

I follow the all the steps in the webpage, except adding the main method. In
the javapbtest proxy, there is "main (string_1[]) returns (none)" under
functions.

l_jvm.createJavaVM( "c:\myjava", FALSE ) returns 1 and
l_EJBConnection.createJavaInstance( l_javapbtest, "javapbtest" ) returns 0.
I'm using JDK 1.4.2; the classpath "c:\myjava" is correct.

Does createJavaInstance go through the constructor of the java class? I
didn't write any constructor for JavaPBTest. Any difference between calling
static and non-static methods? In pure java, static method can be called
without creating an instance.

Thanks,
CL

"Bede" <bede_nosp@m_sofico.be> wrote in message
news:MPG.1ebab969c7a7ee349897ae@forums.sybase.com...
> sorry, but that's far too less information to work with.
>
> => have the right proxies been generated? are the JVM & JavaPBTest class
> instantiated properly, what J.D.K. version, are you using a ejb server
> or not? if so -> which type (EAServer or not), what's the classpath, ...
>
> also, try to activate logging when instantiating the JVM and check it's
> vm.out output for debug info. and verify which classes are loaded after
> instantiating JVM, e.g.:
>
> If inv_JavaVM.createJavaVM(ls_classPath, True /* VM.OUT loggin */ ) = 0
> Then
> of_log("Java VM version " + inv_JavaVM.getJavaVMVersion() +
> "~r~n~r~nCLASSPATH=" + inv_JavaVM.getJavaClasspath())
> Else
> of_log("Error instantiating JVM")
> End If
>
> Ben
>
>
> In article <445051a0$1@forums-1-dub>, CL@somewhere.org says...
>> I'm learning how to call java in PB 10.2.1. I copied the code in
>> http://www.sybase.com/detail?id=1037085
>>
>> Adding main method in class JavaPBTest:
>> public static void main(String args[]) {
>> System.out.println("Hello World");
>> }
>>
>> Changing the Powerscript of the Try/Catch block to:
>> TRY
>> String ls_args[]
>> ls_args[1] = 'A'
>> l_javapbtest.main(ls_args)
>> CATCH( Throwable t )
>> MessageBox( "method call failed", t.getMessage() )
>> END TRY
>>
>> When I run it, error occurs:
>> Error calling method of a PBNI object
>>
>> What's the problem?
>>
>>
>>


Li-xiang.Sun Posted on 2006-05-10 02:56:35.0Z
From: Li-xiang.Sun@sybase.com
Subject: Re: main method
Newsgroups: sybase.public.powerbuilder.ejbclient
MIME-Version: 1.0
References: <445051a0$1@forums-1-dub> <MPG.1ebab969c7a7ee349897ae@forums.sybase.com>
X-Newsreader: Lotus Notes Release 6.5 September 26, 2003
X-MIMETrack: Serialize by Notes Client on Li-xiang Sun/SYBASE(Release 6.5|September 26, 2003) at 05/10/2006 10:56:22 AM, Serialize complete at 05/10/2006 10:56:22 AM
Content-Type: multipart/alternative; boundary="=_alternative 001025AC4825716A_="
NNTP-Posting-Host: li-xiangsun.sybase.com
X-Original-NNTP-Posting-Host: li-xiangsun.sybase.com
Message-ID: <44615663@forums-1-dub>
Date: 9 May 2006 19:56:35 -0700
X-Trace: forums-1-dub 1147229795 10.42.14.211 (9 May 2006 19:56:35 -0700)
X-Original-Trace: 9 May 2006 19:56:35 -0700, li-xiangsun.sybase.com
Lines: 12
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:648
Article PK: 424766


Yes,as Gokhan said,now PB have issue with call static method through pbni


Gokhan Demir Posted on 2006-04-27 20:30:42.0Z
From: Gokhan Demir <gokhan.demir@igonline.biz>
User-Agent: Thunderbird 1.5 (Windows/20051201)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: main method
References: <445051a0$1@forums-1-dub>
In-Reply-To: <445051a0$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 85.105.196.163
X-Original-NNTP-Posting-Host: 85.105.196.163
Message-ID: <445129f2$1@forums-1-dub>
Date: 27 Apr 2006 13:30:42 -0700
X-Trace: forums-1-dub 1146169842 85.105.196.163 (27 Apr 2006 13:30:42 -0700)
X-Original-Trace: 27 Apr 2006 13:30:42 -0700, 85.105.196.163
Lines: 31
X-Authenticated-User: EAServer
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:639
Article PK: 424759

According to my experience, Powerbuilder is not able to call static
methods. My workaround is to wrap the static methods with non-static
methods and call the wrapper method.

HTH,
Gokhan

CL wrote:
> I'm learning how to call java in PB 10.2.1. I copied the code in
> http://www.sybase.com/detail?id=1037085
>
> Adding main method in class JavaPBTest:
> public static void main(String args[]) {
> System.out.println("Hello World");
> }
>
> Changing the Powerscript of the Try/Catch block to:
> TRY
> String ls_args[]
> ls_args[1] = 'A'
> l_javapbtest.main(ls_args)
> CATCH( Throwable t )
> MessageBox( "method call failed", t.getMessage() )
> END TRY
>
> When I run it, error occurs:
> Error calling method of a PBNI object
>
> What's the problem?
>
>