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.

PB10, JavaVM.CreateJavaInstance

11 posts in EJB Client Last posting was on 2004-08-31 04:51:34.0Z
Markus Posted on 2004-08-25 15:48:36.0Z
From: "Markus" <MarkusNospstieraam@yahoo.com>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: PB10, JavaVM.CreateJavaInstance
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Original-NNTP-Posting-Host: pd9ea114a.dip0.t-ipconnect.de
Message-ID: <412cb643$1@forums-2-dub>
X-Original-Trace: 25 Aug 2004 08:54:43 -0700, pd9ea114a.dip0.t-ipconnect.de
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 25 Aug 2004 08:38:31 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 25 Aug 2004 08:48:36 -0700
X-Trace: forums-1-dub 1093448916 10.22.108.75 (25 Aug 2004 08:48:36 -0700)
X-Original-Trace: 25 Aug 2004 08:48: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:337
Article PK: 424513

Hi there,

I've developed a small tool which calls a function of a java class. It works
perfectly within the PB10 IDE, but not if I deploy it.
The following example is based on a Java_Integer Proxy, which won't do
either.
Example:

---snip----
JavaVM m_vm
m_vm = CREATE JavaVM
int iRes
iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
if iRes < 0 then
messagebox("Error", "Can't create JavaVM. Code: " + string(iRes))
end if
java_integer jint
iRes = m_vm.Createjavainstance( jint, "java_integer") <---Error comes
here!
Messagebox ("cn", jint.classname( ))
---snip----

This works perfectly within PB IDE. When I deploy my application, I get the
following exception as indicated above: "Error calling Method of a PBNI
object".
The JavaVm seems to be initialized correctly.

What am I missig?

Any help would be appreciated

Markus


Gokhan Demir Posted on 2004-08-25 20:12:05.0Z
From: Gokhan Demir <gokhan.demir@igonline.biz>
User-Agent: Mozilla Thunderbird 0.7.2 (Windows/20040707)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: PB10, JavaVM.CreateJavaInstance
References: <412cb643$1@forums-2-dub>
In-Reply-To: <412cb643$1@forums-2-dub>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: adsluser-1165.adsl.ttnet.net.tr
Message-ID: <412cf404@forums-2-dub>
X-Original-Trace: 25 Aug 2004 13:18:12 -0700, adsluser-1165.adsl.ttnet.net.tr
Lines: 43
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 25 Aug 2004 13:01:59 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 25 Aug 2004 13:12:05 -0700
X-Trace: forums-1-dub 1093464725 10.22.108.75 (25 Aug 2004 13:12:05 -0700)
X-Original-Trace: 25 Aug 2004 13:12:05 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:338
Article PK: 424516

Hello,

Does it change the runtime behaviour if you add a try-catch block before
m_vm.CreateJavaVM(...) and after m_vm.CreateJavaInstance( jint, ... ) ?

Regards,
Gokhan

Markus wrote:
> Hi there,
>
> I've developed a small tool which calls a function of a java class. It works
> perfectly within the PB10 IDE, but not if I deploy it.
> The following example is based on a Java_Integer Proxy, which won't do
> either.
> Example:
>
> ---snip----
> JavaVM m_vm
> m_vm = CREATE JavaVM
> int iRes
> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
> if iRes < 0 then
> messagebox("Error", "Can't create JavaVM. Code: " + string(iRes))
> end if
> java_integer jint
> iRes = m_vm.Createjavainstance( jint, "java_integer") <---Error comes
> here!
> Messagebox ("cn", jint.classname( ))
> ---snip----
>
> This works perfectly within PB IDE. When I deploy my application, I get the
> following exception as indicated above: "Error calling Method of a PBNI
> object".
> The JavaVm seems to be initialized correctly.
>
> What am I missig?
>
> Any help would be appreciated
>
> Markus
>
>


Markus Posted on 2004-08-26 09:21:29.0Z
From: "Markus" <MarkusNospstieraam@yahoo.com>
Newsgroups: sybase.public.powerbuilder.ejbclient
References: <412cb643$1@forums-2-dub> <412cf404@forums-2-dub>
Subject: Re: PB10, JavaVM.CreateJavaInstance
Lines: 98
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Original-NNTP-Posting-Host: pd9ea114a.dip0.t-ipconnect.de
Message-ID: <412dad0a$1@forums-2-dub>
X-Original-Trace: 26 Aug 2004 02:27:38 -0700, pd9ea114a.dip0.t-ipconnect.de
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 26 Aug 2004 02:11:20 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 26 Aug 2004 02:21:29 -0700
X-Trace: forums-1-dub 1093512089 10.22.108.75 (26 Aug 2004 02:21:29 -0700)
X-Original-Trace: 26 Aug 2004 02:21:29 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:340
Article PK: 424512

Hi,

actuallly the code is:
-----snip
JavaVM m_vm
String ClassPath
int iRes

ClassPath = ".\classes"

try
m_vm = CREATE JavaVM
iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
if iRes < 0 then
messagebox("Error", "Couldn't create JavaVM. Code: " + string(iRes))
end if
catch (CreateException ce)
MessageBox( "Create Exception", ce.getMessage() )
catch (Throwable t1)
MessageBox("Generic Exception Phase 1", t1.getMessage())
end try

MessageBox ("Classpath", m_vm.getjavaclasspath())

java_integer jint

try
iRes = m_vm.Createjavainstance(jint, "java_integer")
Messagebox ("cn", jint.classname())
catch (Throwable t2)
MessageBox("Generic Exception Phase 2", t2.getMessage())
end try
----snip

The try-catch does not change anything (except that I get my messagebox
instead of system message).
Further tests revealed that it works, if I deploy the application with
default code generation (no machine code). The PBNI exception occurs when I
compile machine code. It doesn't matter if I choose DLL or not for the
libraries.
Is there a limitation for the javavm and machine-code code-generation?

Any idea?


regards
Markus


"Gokhan Demir" <gokhan.demir@igonline.biz> schrieb im Newsbeitrag
news:412cf404@forums-2-dub...

> Hello,
>
> Does it change the runtime behaviour if you add a try-catch block before
> m_vm.CreateJavaVM(...) and after m_vm.CreateJavaInstance( jint, ... ) ?
>
> Regards,
> Gokhan
>
> Markus wrote:
> > Hi there,
> >
> > I've developed a small tool which calls a function of a java class. It
works
> > perfectly within the PB10 IDE, but not if I deploy it.
> > The following example is based on a Java_Integer Proxy, which won't do
> > either.
> > Example:
> >
> > ---snip----
> > JavaVM m_vm
> > m_vm = CREATE JavaVM
> > int iRes
> > iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
> > if iRes < 0 then
> > messagebox("Error", "Can't create JavaVM. Code: " + string(iRes))
> > end if
> > java_integer jint
> > iRes = m_vm.Createjavainstance( jint, "java_integer") <---Error comes
> > here!
> > Messagebox ("cn", jint.classname( ))
> > ---snip----
> >
> > This works perfectly within PB IDE. When I deploy my application, I get
the
> > following exception as indicated above: "Error calling Method of a PBNI
> > object".
> > The JavaVm seems to be initialized correctly.
> >
> > What am I missig?
> >
> > Any help would be appreciated
> >
> > Markus
> >
> >


Gokhan Demir Posted on 2004-08-26 17:26:38.0Z
From: Gokhan Demir <gokhan.demir@igonline.biz>
User-Agent: Mozilla Thunderbird 0.7.2 (Windows/20040707)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: PB10, JavaVM.CreateJavaInstance
References: <412cb643$1@forums-2-dub> <412cf404@forums-2-dub> <412dad0a$1@forums-2-dub>
In-Reply-To: <412dad0a$1@forums-2-dub>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: adsluser-1165.adsl.ttnet.net.tr
X-Original-NNTP-Posting-Host: adsluser-1165.adsl.ttnet.net.tr
Message-ID: <412e1d4e@forums-1-dub>
Date: 26 Aug 2004 10:26:38 -0700
X-Trace: forums-1-dub 1093541198 212.174.52.141 (26 Aug 2004 10:26:38 -0700)
X-Original-Trace: 26 Aug 2004 10:26:38 -0700, adsluser-1165.adsl.ttnet.net.tr
Lines: 112
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:343
Article PK: 424519

AFAIK, machine code cannot use try-catch blocks. So, it should not be
used with clients using javavm.

Regards,
Gokhan

Markus wrote:
> Hi,
>
> actuallly the code is:
> -----snip
> JavaVM m_vm
> String ClassPath
> int iRes
>
> ClassPath = ".\classes"
>
> try
> m_vm = CREATE JavaVM
> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
> if iRes < 0 then
> messagebox("Error", "Couldn't create JavaVM. Code: " + string(iRes))
> end if
> catch (CreateException ce)
> MessageBox( "Create Exception", ce.getMessage() )
> catch (Throwable t1)
> MessageBox("Generic Exception Phase 1", t1.getMessage())
> end try
>
> MessageBox ("Classpath", m_vm.getjavaclasspath())
>
> java_integer jint
>
> try
> iRes = m_vm.Createjavainstance(jint, "java_integer")
> Messagebox ("cn", jint.classname())
> catch (Throwable t2)
> MessageBox("Generic Exception Phase 2", t2.getMessage())
> end try
> ----snip
>
> The try-catch does not change anything (except that I get my messagebox
> instead of system message).
> Further tests revealed that it works, if I deploy the application with
> default code generation (no machine code). The PBNI exception occurs when I
> compile machine code. It doesn't matter if I choose DLL or not for the
> libraries.
> Is there a limitation for the javavm and machine-code code-generation?
>
> Any idea?
>
>
> regards
> Markus
>
>
> "Gokhan Demir" <gokhan.demir@igonline.biz> schrieb im Newsbeitrag
> news:412cf404@forums-2-dub...
>
>>Hello,
>>
>>Does it change the runtime behaviour if you add a try-catch block before
>>m_vm.CreateJavaVM(...) and after m_vm.CreateJavaInstance( jint, ... ) ?
>>
>>Regards,
>>Gokhan
>>
>>Markus wrote:
>>
>>>Hi there,
>>>
>>>I've developed a small tool which calls a function of a java class. It
>
> works
>
>>>perfectly within the PB10 IDE, but not if I deploy it.
>>>The following example is based on a Java_Integer Proxy, which won't do
>>>either.
>>>Example:
>>>
>>>---snip----
>>>JavaVM m_vm
>>>m_vm = CREATE JavaVM
>>> int iRes
>>> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
>>> if iRes < 0 then
>>> messagebox("Error", "Can't create JavaVM. Code: " + string(iRes))
>>> end if
>>> java_integer jint
>>> iRes = m_vm.Createjavainstance( jint, "java_integer") <---Error comes
>>>here!
>>> Messagebox ("cn", jint.classname( ))
>>>---snip----
>>>
>>>This works perfectly within PB IDE. When I deploy my application, I get
>
> the
>
>>>following exception as indicated above: "Error calling Method of a PBNI
>>>object".
>>>The JavaVm seems to be initialized correctly.
>>>
>>>What am I missig?
>>>
>>>Any help would be appreciated
>>>
>>>Markus
>>>
>>>
>
>
>


Jim O'Neil [Sybase] Posted on 2004-08-26 18:22:59.0Z
From: "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: PB10, JavaVM.CreateJavaInstance
Message-ID: <j0asi0d3p1k85uv3iooma6hjp8lk9mgl3b@4ax.com>
References: <412cb643$1@forums-2-dub> <412cf404@forums-2-dub> <412dad0a$1@forums-2-dub> <412e1d4e@forums-1-dub>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: joneilw2k.sybase.com
X-Original-NNTP-Posting-Host: joneilw2k.sybase.com
Date: 26 Aug 2004 11:22:59 -0700
X-Trace: forums-1-dub 1093544579 10.18.63.187 (26 Aug 2004 11:22:59 -0700)
X-Original-Trace: 26 Aug 2004 11:22:59 -0700, joneilw2k.sybase.com
Lines: 118
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:344
Article PK: 424520

That changes in PB10.

On 26 Aug 2004 10:26:38 -0700, Gokhan Demir

<gokhan.demir@igonline.biz> wrote:

>AFAIK, machine code cannot use try-catch blocks. So, it should not be
>used with clients using javavm.
>
>Regards,
>Gokhan
>
>Markus wrote:
>> Hi,
>>
>> actuallly the code is:
>> -----snip
>> JavaVM m_vm
>> String ClassPath
>> int iRes
>>
>> ClassPath = ".\classes"
>>
>> try
>> m_vm = CREATE JavaVM
>> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
>> if iRes < 0 then
>> messagebox("Error", "Couldn't create JavaVM. Code: " + string(iRes))
>> end if
>> catch (CreateException ce)
>> MessageBox( "Create Exception", ce.getMessage() )
>> catch (Throwable t1)
>> MessageBox("Generic Exception Phase 1", t1.getMessage())
>> end try
>>
>> MessageBox ("Classpath", m_vm.getjavaclasspath())
>>
>> java_integer jint
>>
>> try
>> iRes = m_vm.Createjavainstance(jint, "java_integer")
>> Messagebox ("cn", jint.classname())
>> catch (Throwable t2)
>> MessageBox("Generic Exception Phase 2", t2.getMessage())
>> end try
>> ----snip
>>
>> The try-catch does not change anything (except that I get my messagebox
>> instead of system message).
>> Further tests revealed that it works, if I deploy the application with
>> default code generation (no machine code). The PBNI exception occurs when I
>> compile machine code. It doesn't matter if I choose DLL or not for the
>> libraries.
>> Is there a limitation for the javavm and machine-code code-generation?
>>
>> Any idea?
>>
>>
>> regards
>> Markus
>>
>>
>> "Gokhan Demir" <gokhan.demir@igonline.biz> schrieb im Newsbeitrag
>> news:412cf404@forums-2-dub...
>>
>>>Hello,
>>>
>>>Does it change the runtime behaviour if you add a try-catch block before
>>>m_vm.CreateJavaVM(...) and after m_vm.CreateJavaInstance( jint, ... ) ?
>>>
>>>Regards,
>>>Gokhan
>>>
>>>Markus wrote:
>>>
>>>>Hi there,
>>>>
>>>>I've developed a small tool which calls a function of a java class. It
>>
>> works
>>
>>>>perfectly within the PB10 IDE, but not if I deploy it.
>>>>The following example is based on a Java_Integer Proxy, which won't do
>>>>either.
>>>>Example:
>>>>
>>>>---snip----
>>>>JavaVM m_vm
>>>>m_vm = CREATE JavaVM
>>>> int iRes
>>>> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
>>>> if iRes < 0 then
>>>> messagebox("Error", "Can't create JavaVM. Code: " + string(iRes))
>>>> end if
>>>> java_integer jint
>>>> iRes = m_vm.Createjavainstance( jint, "java_integer") <---Error comes
>>>>here!
>>>> Messagebox ("cn", jint.classname( ))
>>>>---snip----
>>>>
>>>>This works perfectly within PB IDE. When I deploy my application, I get
>>
>> the
>>
>>>>following exception as indicated above: "Error calling Method of a PBNI
>>>>object".
>>>>The JavaVm seems to be initialized correctly.
>>>>
>>>>What am I missig?
>>>>
>>>>Any help would be appreciated
>>>>
>>>>Markus
>>>>
>>>>
>>
>>
>>


Markus Posted on 2004-08-30 10:39:13.0Z
From: "Markus" <MarkusNospstieraam@yahoo.com>
Newsgroups: sybase.public.powerbuilder.ejbclient
References: <412cb643$1@forums-2-dub> <412cf404@forums-2-dub> <412dad0a$1@forums-2-dub> <412e1d4e@forums-1-dub> <j0asi0d3p1k85uv3iooma6hjp8lk9mgl3b@4ax.com>
Subject: Re: PB10, JavaVM.CreateJavaInstance
Lines: 133
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: pd9ea1252.dip0.t-ipconnect.de
X-Original-NNTP-Posting-Host: pd9ea1252.dip0.t-ipconnect.de
Message-ID: <413303d1@forums-1-dub>
Date: 30 Aug 2004 03:39:13 -0700
X-Trace: forums-1-dub 1093862353 217.234.18.82 (30 Aug 2004 03:39:13 -0700)
X-Original-Trace: 30 Aug 2004 03:39:13 -0700, pd9ea1252.dip0.t-ipconnect.de
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:345
Article PK: 424523

Can anybody confirm or disprove the behaviour decribed above? Is the JavaVM
class functional only in PCode projects?

Regards,
Markus

"Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> schrieb im Newsbeitrag
news:j0asi0d3p1k85uv3iooma6hjp8lk9mgl3b@4ax.com...

> That changes in PB10.
>
> On 26 Aug 2004 10:26:38 -0700, Gokhan Demir
> <gokhan.demir@igonline.biz> wrote:
>
> >AFAIK, machine code cannot use try-catch blocks. So, it should not be
> >used with clients using javavm.
> >
> >Regards,
> >Gokhan
> >
> >Markus wrote:
> >> Hi,
> >>
> >> actuallly the code is:
> >> -----snip
> >> JavaVM m_vm
> >> String ClassPath
> >> int iRes
> >>
> >> ClassPath = ".\classes"
> >>
> >> try
> >> m_vm = CREATE JavaVM
> >> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
> >> if iRes < 0 then
> >> messagebox("Error", "Couldn't create JavaVM. Code: " + string(iRes))
> >> end if
> >> catch (CreateException ce)
> >> MessageBox( "Create Exception", ce.getMessage() )
> >> catch (Throwable t1)
> >> MessageBox("Generic Exception Phase 1", t1.getMessage())
> >> end try
> >>
> >> MessageBox ("Classpath", m_vm.getjavaclasspath())
> >>
> >> java_integer jint
> >>
> >> try
> >> iRes = m_vm.Createjavainstance(jint, "java_integer")
> >> Messagebox ("cn", jint.classname())
> >> catch (Throwable t2)
> >> MessageBox("Generic Exception Phase 2", t2.getMessage())
> >> end try
> >> ----snip
> >>
> >> The try-catch does not change anything (except that I get my messagebox
> >> instead of system message).
> >> Further tests revealed that it works, if I deploy the application with
> >> default code generation (no machine code). The PBNI exception occurs
when I
> >> compile machine code. It doesn't matter if I choose DLL or not for the
> >> libraries.
> >> Is there a limitation for the javavm and machine-code code-generation?
> >>
> >> Any idea?
> >>
> >>
> >> regards
> >> Markus
> >>
> >>
> >> "Gokhan Demir" <gokhan.demir@igonline.biz> schrieb im Newsbeitrag
> >> news:412cf404@forums-2-dub...
> >>
> >>>Hello,
> >>>
> >>>Does it change the runtime behaviour if you add a try-catch block
before
> >>>m_vm.CreateJavaVM(...) and after m_vm.CreateJavaInstance( jint, ... ) ?
> >>>
> >>>Regards,
> >>>Gokhan
> >>>
> >>>Markus wrote:
> >>>
> >>>>Hi there,
> >>>>
> >>>>I've developed a small tool which calls a function of a java class. It
> >>
> >> works
> >>
> >>>>perfectly within the PB10 IDE, but not if I deploy it.
> >>>>The following example is based on a Java_Integer Proxy, which won't do
> >>>>either.
> >>>>Example:
> >>>>
> >>>>---snip----
> >>>>JavaVM m_vm
> >>>>m_vm = CREATE JavaVM
> >>>> int iRes
> >>>> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
> >>>> if iRes < 0 then
> >>>> messagebox("Error", "Can't create JavaVM. Code: " + string(iRes))
> >>>> end if
> >>>> java_integer jint
> >>>> iRes = m_vm.Createjavainstance( jint, "java_integer") <---Error
comes
> >>>>here!
> >>>> Messagebox ("cn", jint.classname( ))
> >>>>---snip----
> >>>>
> >>>>This works perfectly within PB IDE. When I deploy my application, I
get
> >>
> >> the
> >>
> >>>>following exception as indicated above: "Error calling Method of a
PBNI
> >>>>object".
> >>>>The JavaVm seems to be initialized correctly.
> >>>>
> >>>>What am I missig?
> >>>>
> >>>>Any help would be appreciated
> >>>>
> >>>>Markus
> >>>>
> >>>>
> >>
> >>
> >>
>


Bruce Armstrong [TeamSybase] Posted on 2004-08-30 13:24:51.0Z
From: "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: PB10, JavaVM.CreateJavaInstance
Organization: TeamSybase
Reply-To: NOCANSPAM_bruce.armstrong@teamsybase.com
Message-ID: <i0a6j0ptnqofo3d7o36pc9tu3he0ndq7kf@4ax.com>
References: <412cb643$1@forums-2-dub> <412cf404@forums-2-dub> <412dad0a$1@forums-2-dub> <412e1d4e@forums-1-dub> <j0asi0d3p1k85uv3iooma6hjp8lk9mgl3b@4ax.com> <413303d1@forums-1-dub>
X-Newsreader: Forte Agent 2.0/32.646
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 68-190-226-38.la-cbi.charterpipeline.net
X-Original-NNTP-Posting-Host: 68-190-226-38.la-cbi.charterpipeline.net
Date: 30 Aug 2004 06:24:51 -0700
X-Trace: forums-1-dub 1093872291 68.190.226.38 (30 Aug 2004 06:24:51 -0700)
X-Original-Trace: 30 Aug 2004 06:24:51 -0700, 68-190-226-38.la-cbi.charterpipeline.net
Lines: 176
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:346
Article PK: 424522

I can confirm that exception handling works for PB10 when compiled to
machine code.

The JavaVM class is a PBNI class. I don't know of any issues with
PBNI and machine code.

On 30 Aug 2004 03:39:13 -0700, "Markus" <MarkusNospstieraam@yahoo.com>

wrote:

>Can anybody confirm or disprove the behaviour decribed above? Is the JavaVM
>class functional only in PCode projects?
>
>Regards,
>Markus
>
>"Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> schrieb im Newsbeitrag
>news:j0asi0d3p1k85uv3iooma6hjp8lk9mgl3b@4ax.com...
>> That changes in PB10.
>>
>> On 26 Aug 2004 10:26:38 -0700, Gokhan Demir
>> <gokhan.demir@igonline.biz> wrote:
>>
>> >AFAIK, machine code cannot use try-catch blocks. So, it should not be
>> >used with clients using javavm.
>> >
>> >Regards,
>> >Gokhan
>> >
>> >Markus wrote:
>> >> Hi,
>> >>
>> >> actuallly the code is:
>> >> -----snip
>> >> JavaVM m_vm
>> >> String ClassPath
>> >> int iRes
>> >>
>> >> ClassPath = ".\classes"
>> >>
>> >> try
>> >> m_vm = CREATE JavaVM
>> >> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
>> >> if iRes < 0 then
>> >> messagebox("Error", "Couldn't create JavaVM. Code: " + string(iRes))
>> >> end if
>> >> catch (CreateException ce)
>> >> MessageBox( "Create Exception", ce.getMessage() )
>> >> catch (Throwable t1)
>> >> MessageBox("Generic Exception Phase 1", t1.getMessage())
>> >> end try
>> >>
>> >> MessageBox ("Classpath", m_vm.getjavaclasspath())
>> >>
>> >> java_integer jint
>> >>
>> >> try
>> >> iRes = m_vm.Createjavainstance(jint, "java_integer")
>> >> Messagebox ("cn", jint.classname())
>> >> catch (Throwable t2)
>> >> MessageBox("Generic Exception Phase 2", t2.getMessage())
>> >> end try
>> >> ----snip
>> >>
>> >> The try-catch does not change anything (except that I get my messagebox
>> >> instead of system message).
>> >> Further tests revealed that it works, if I deploy the application with
>> >> default code generation (no machine code). The PBNI exception occurs
>when I
>> >> compile machine code. It doesn't matter if I choose DLL or not for the
>> >> libraries.
>> >> Is there a limitation for the javavm and machine-code code-generation?
>> >>
>> >> Any idea?
>> >>
>> >>
>> >> regards
>> >> Markus
>> >>
>> >>
>> >> "Gokhan Demir" <gokhan.demir@igonline.biz> schrieb im Newsbeitrag
>> >> news:412cf404@forums-2-dub...
>> >>
>> >>>Hello,
>> >>>
>> >>>Does it change the runtime behaviour if you add a try-catch block
>before
>> >>>m_vm.CreateJavaVM(...) and after m_vm.CreateJavaInstance( jint, ... ) ?
>> >>>
>> >>>Regards,
>> >>>Gokhan
>> >>>
>> >>>Markus wrote:
>> >>>
>> >>>>Hi there,
>> >>>>
>> >>>>I've developed a small tool which calls a function of a java class. It
>> >>
>> >> works
>> >>
>> >>>>perfectly within the PB10 IDE, but not if I deploy it.
>> >>>>The following example is based on a Java_Integer Proxy, which won't do
>> >>>>either.
>> >>>>Example:
>> >>>>
>> >>>>---snip----
>> >>>>JavaVM m_vm
>> >>>>m_vm = CREATE JavaVM
>> >>>> int iRes
>> >>>> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
>> >>>> if iRes < 0 then
>> >>>> messagebox("Error", "Can't create JavaVM. Code: " + string(iRes))
>> >>>> end if
>> >>>> java_integer jint
>> >>>> iRes = m_vm.Createjavainstance( jint, "java_integer") <---Error
>comes
>> >>>>here!
>> >>>> Messagebox ("cn", jint.classname( ))
>> >>>>---snip----
>> >>>>
>> >>>>This works perfectly within PB IDE. When I deploy my application, I
>get
>> >>
>> >> the
>> >>
>> >>>>following exception as indicated above: "Error calling Method of a
>PBNI
>> >>>>object".
>> >>>>The JavaVm seems to be initialized correctly.
>> >>>>
>> >>>>What am I missig?
>> >>>>
>> >>>>Any help would be appreciated
>> >>>>
>> >>>>Markus
>> >>>>
>> >>>>
>> >>
>> >>
>> >>
>>
>

Bruce Armstrong [TeamSybase]
http://www.teamsybase.com

TeamSybase blogs:
http://www.teamsybase.net/blogs

Vote for PocketBuilder in the Mobile Village awards
http://www.mobilevillage.com/awards.htm

Two 3rd party books on developing with PowerBuilder
http://www.pb9books.com?source=newsgroups

Need code sample? Check out CodeXchange:
http://www.codexchange.sybase.com

Preach the gospel at all times. If necessary, use words. - Francis of Assisi
http://www.needhim.org

---------------------------------------------------------------------
DISCLAIMER:

This newsgroup message is only intended for the recipient. Given that it
is a posting to a public newsgroup, that means if you can read this
message then you are the recipient. This message may contain information
that is confidential and protected from disclosure. And then again,
it may not.

Given that TeamSybase members are not employees of Sybase, the contents
of this message do not necessarily represent the views or policies of
Sybase. Given that TeamSybase is a diverse group of users of Sybase
products, the contents of this message do not necessarily represent the
views of a significant number of the members of TeamSybase. Given that the
author has multiple personalities and hears voices in his head, the contents
of this message do not necessarily represent his own views.


Jason Vogel <jasonvogel Posted on 2004-08-30 15:16:35.0Z
From: Jason Vogel <jasonvogel@poboxes_dot_com>
Reply-To: jasonvogel@poboxes_dot_com
User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: PB10, JavaVM.CreateJavaInstance
References: <412cb643$1@forums-2-dub> <412cf404@forums-2-dub> <412dad0a$1@forums-2-dub> <412e1d4e@forums-1-dub> <j0asi0d3p1k85uv3iooma6hjp8lk9mgl3b@4ax.com> <413303d1@forums-1-dub> <i0a6j0ptnqofo3d7o36pc9tu3he0ndq7kf@4ax.com>
In-Reply-To: <i0a6j0ptnqofo3d7o36pc9tu3he0ndq7kf@4ax.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: sndmail.ahslink.com
X-Original-NNTP-Posting-Host: sndmail.ahslink.com
Message-ID: <413344d3$1@forums-1-dub>
Date: 30 Aug 2004 08:16:35 -0700
X-Trace: forums-1-dub 1093878995 12.29.8.188 (30 Aug 2004 08:16:35 -0700)
X-Original-Trace: 30 Aug 2004 08:16:35 -0700, sndmail.ahslink.com
Lines: 196
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:347
Article PK: 424521


Bruce Armstrong [TeamSybase] wrote:
> I can confirm that exception handling works for PB10 when compiled to
> machine code.
>
> The JavaVM class is a PBNI class. I don't know of any issues with
> PBNI and machine code.
>
> On 30 Aug 2004 03:39:13 -0700, "Markus" <MarkusNospstieraam@yahoo.com>
> wrote:
>
>
>>Can anybody confirm or disprove the behaviour decribed above? Is the JavaVM
>>class functional only in PCode projects?
>>
>>Regards,
>>Markus
>>
>>"Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> schrieb im Newsbeitrag
>>news:j0asi0d3p1k85uv3iooma6hjp8lk9mgl3b@4ax.com...
>>
>>>That changes in PB10.
>>>
>>>On 26 Aug 2004 10:26:38 -0700, Gokhan Demir
>>><gokhan.demir@igonline.biz> wrote:
>>>
>>>
>>>>AFAIK, machine code cannot use try-catch blocks. So, it should not be
>>>>used with clients using javavm.
>>>>
>>>>Regards,
>>>>Gokhan
>>>>
>>>>Markus wrote:
>>>>
>>>>>Hi,
>>>>>
>>>>>actuallly the code is:
>>>>>-----snip
>>>>>JavaVM m_vm
>>>>> String ClassPath
>>>>> int iRes
>>>>>
>>>>> ClassPath = ".\classes"
>>>>>
>>>>> try
>>>>> m_vm = CREATE JavaVM
>>>>> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
>>>>> if iRes < 0 then
>>>>> messagebox("Error", "Couldn't create JavaVM. Code: " + string(iRes))
>>>>> end if
>>>>> catch (CreateException ce)
>>>>> MessageBox( "Create Exception", ce.getMessage() )
>>>>> catch (Throwable t1)
>>>>> MessageBox("Generic Exception Phase 1", t1.getMessage())
>>>>> end try
>>>>>
>>>>> MessageBox ("Classpath", m_vm.getjavaclasspath())
>>>>>
>>>>> java_integer jint
>>>>>
>>>>> try
>>>>> iRes = m_vm.Createjavainstance(jint, "java_integer")
>>>>> Messagebox ("cn", jint.classname())
>>>>> catch (Throwable t2)
>>>>> MessageBox("Generic Exception Phase 2", t2.getMessage())
>>>>> end try
>>>>> ----snip
>>>>>
>>>>>The try-catch does not change anything (except that I get my messagebox
>>>>>instead of system message).
>>>>>Further tests revealed that it works, if I deploy the application with
>>>>>default code generation (no machine code). The PBNI exception occurs
>>
>>when I
>>
>>>>>compile machine code. It doesn't matter if I choose DLL or not for the
>>>>>libraries.
>>>>>Is there a limitation for the javavm and machine-code code-generation?
>>>>>
>>>>>Any idea?
>>>>>
>>>>>
>>>>>regards
>>>>>Markus
>>>>>
>>>>>
>>>>>"Gokhan Demir" <gokhan.demir@igonline.biz> schrieb im Newsbeitrag
>>>>>news:412cf404@forums-2-dub...
>>>>>
>>>>>
>>>>>>Hello,
>>>>>>
>>>>>>Does it change the runtime behaviour if you add a try-catch block
>>
>>before
>>
>>>>>>m_vm.CreateJavaVM(...) and after m_vm.CreateJavaInstance( jint, ... ) ?
>>>>>>
>>>>>>Regards,
>>>>>>Gokhan
>>>>>>
>>>>>>Markus wrote:
>>>>>>
>>>>>>
>>>>>>>Hi there,
>>>>>>>
>>>>>>>I've developed a small tool which calls a function of a java class. It
>>>>>
>>>>>works
>>>>>
>>>>>
>>>>>>>perfectly within the PB10 IDE, but not if I deploy it.
>>>>>>>The following example is based on a Java_Integer Proxy, which won't do
>>>>>>>either.
>>>>>>>Example:
>>>>>>>
>>>>>>>---snip----
>>>>>>>JavaVM m_vm
>>>>>>>m_vm = CREATE JavaVM
>>>>>>> int iRes
>>>>>>> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
>>>>>>> if iRes < 0 then
>>>>>>> messagebox("Error", "Can't create JavaVM. Code: " + string(iRes))
>>>>>>> end if
>>>>>>>java_integer jint
>>>>>>>iRes = m_vm.Createjavainstance( jint, "java_integer") <---Error
>>
>>comes
>>
>>>>>>>here!
>>>>>>>Messagebox ("cn", jint.classname( ))
>>>>>>>---snip----
>>>>>>>
>>>>>>>This works perfectly within PB IDE. When I deploy my application, I
>>
>>get
>>
>>>>>the
>>>>>
>>>>>
>>>>>>>following exception as indicated above: "Error calling Method of a
>>
>>PBNI
>>
>>>>>>>object".
>>>>>>>The JavaVm seems to be initialized correctly.
>>>>>>>
>>>>>>>What am I missig?
>>>>>>>
>>>>>>>Any help would be appreciated
>>>>>>>
>>>>>>>Markus
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>>
>
> Bruce Armstrong [TeamSybase]
> http://www.teamsybase.com
>
> TeamSybase blogs:
> http://www.teamsybase.net/blogs
>
> Vote for PocketBuilder in the Mobile Village awards
> http://www.mobilevillage.com/awards.htm
>
> Two 3rd party books on developing with PowerBuilder
> http://www.pb9books.com?source=newsgroups
>
> Need code sample? Check out CodeXchange:
> http://www.codexchange.sybase.com
>
> Preach the gospel at all times. If necessary, use words. - Francis of Assisi
> http://www.needhim.org
>
> ---------------------------------------------------------------------
> DISCLAIMER:
>
> This newsgroup message is only intended for the recipient. Given that it
> is a posting to a public newsgroup, that means if you can read this
> message then you are the recipient. This message may contain information
> that is confidential and protected from disclosure. And then again,
> it may not.
>
> Given that TeamSybase members are not employees of Sybase, the contents
> of this message do not necessarily represent the views or policies of
> Sybase. Given that TeamSybase is a diverse group of users of Sybase
> products, the contents of this message do not necessarily represent the
> views of a significant number of the members of TeamSybase. Given that the
> author has multiple personalities and hears voices in his head, the contents
> of this message do not necessarily represent his own views.

Bruce you are probably right, but I swear that I saw a note somewhere that says
that you can only do TRY..CATCH [maybe reliably] via PBDs.

Jason


Markus Posted on 2004-08-30 16:23:05.0Z
From: "Markus" <MarkusNospstieraam@yahoo.com>
Newsgroups: sybase.public.powerbuilder.ejbclient
References: <412cb643$1@forums-2-dub> <412cf404@forums-2-dub> <412dad0a$1@forums-2-dub> <412e1d4e@forums-1-dub> <j0asi0d3p1k85uv3iooma6hjp8lk9mgl3b@4ax.com> <413303d1@forums-1-dub> <i0a6j0ptnqofo3d7o36pc9tu3he0ndq7kf@4ax.com> <413344d3$1@forums-1-dub>
Subject: Re: PB10, JavaVM.CreateJavaInstance
Lines: 237
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: pd9ea1252.dip0.t-ipconnect.de
X-Original-NNTP-Posting-Host: pd9ea1252.dip0.t-ipconnect.de
Message-ID: <41335469@forums-1-dub>
Date: 30 Aug 2004 09:23:05 -0700
X-Trace: forums-1-dub 1093882985 217.234.18.82 (30 Aug 2004 09:23:05 -0700)
X-Original-Trace: 30 Aug 2004 09:23:05 -0700, pd9ea1252.dip0.t-ipconnect.de
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:348
Article PK: 424526

Hi,

see comment below...

"Jason Vogel" <jasonvogel@poboxes_dot_com> schrieb im Newsbeitrag
news:413344d3$1@forums-1-dub...

> Bruce Armstrong [TeamSybase] wrote:
> > I can confirm that exception handling works for PB10 when compiled to
> > machine code.
> >
> > The JavaVM class is a PBNI class. I don't know of any issues with
> > PBNI and machine code.
> >
> > On 30 Aug 2004 03:39:13 -0700, "Markus" <MarkusNospstieraam@yahoo.com>
> > wrote:
> >
> >
> >>Can anybody confirm or disprove the behaviour decribed above? Is the
JavaVM
> >>class functional only in PCode projects?
> >>
> >>Regards,
> >>Markus
> >>
> >>"Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> schrieb im Newsbeitrag
> >>news:j0asi0d3p1k85uv3iooma6hjp8lk9mgl3b@4ax.com...
> >>
> >>>That changes in PB10.
> >>>
> >>>On 26 Aug 2004 10:26:38 -0700, Gokhan Demir
> >>><gokhan.demir@igonline.biz> wrote:
> >>>
> >>>
> >>>>AFAIK, machine code cannot use try-catch blocks. So, it should not be
> >>>>used with clients using javavm.
> >>>>
> >>>>Regards,
> >>>>Gokhan
> >>>>
> >>>>Markus wrote:
> >>>>
> >>>>>Hi,
> >>>>>
> >>>>>actuallly the code is:
> >>>>>-----snip
> >>>>>JavaVM m_vm
> >>>>> String ClassPath
> >>>>> int iRes
> >>>>>
> >>>>> ClassPath = ".\classes"
> >>>>>
> >>>>> try
> >>>>> m_vm = CREATE JavaVM
> >>>>> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
> >>>>> if iRes < 0 then
> >>>>> messagebox("Error", "Couldn't create JavaVM. Code: " +
string(iRes))
> >>>>> end if
> >>>>> catch (CreateException ce)
> >>>>> MessageBox( "Create Exception", ce.getMessage() )
> >>>>> catch (Throwable t1)
> >>>>> MessageBox("Generic Exception Phase 1", t1.getMessage())
> >>>>> end try
> >>>>>
> >>>>> MessageBox ("Classpath", m_vm.getjavaclasspath())
> >>>>>
> >>>>> java_integer jint
> >>>>>
> >>>>> try
> >>>>> iRes = m_vm.Createjavainstance(jint, "java_integer")
> >>>>> Messagebox ("cn", jint.classname())
> >>>>> catch (Throwable t2)
> >>>>> MessageBox("Generic Exception Phase 2", t2.getMessage())
> >>>>> end try
> >>>>> ----snip
> >>>>>
> >>>>>The try-catch does not change anything (except that I get my
messagebox
> >>>>>instead of system message).
> >>>>>Further tests revealed that it works, if I deploy the application
with
> >>>>>default code generation (no machine code). The PBNI exception occurs
> >>
> >>when I
> >>
> >>>>>compile machine code. It doesn't matter if I choose DLL or not for
the
> >>>>>libraries.
> >>>>>Is there a limitation for the javavm and machine-code
code-generation?
> >>>>>
> >>>>>Any idea?
> >>>>>
> >>>>>
> >>>>>regards
> >>>>>Markus
> >>>>>
> >>>>>
> >>>>>"Gokhan Demir" <gokhan.demir@igonline.biz> schrieb im Newsbeitrag
> >>>>>news:412cf404@forums-2-dub...
> >>>>>
> >>>>>
> >>>>>>Hello,
> >>>>>>
> >>>>>>Does it change the runtime behaviour if you add a try-catch block
> >>
> >>before
> >>
> >>>>>>m_vm.CreateJavaVM(...) and after m_vm.CreateJavaInstance( jint,
... ) ?
> >>>>>>
> >>>>>>Regards,
> >>>>>>Gokhan
> >>>>>>
> >>>>>>Markus wrote:
> >>>>>>
> >>>>>>
> >>>>>>>Hi there,
> >>>>>>>
> >>>>>>>I've developed a small tool which calls a function of a java class.
It
> >>>>>
> >>>>>works
> >>>>>
> >>>>>
> >>>>>>>perfectly within the PB10 IDE, but not if I deploy it.
> >>>>>>>The following example is based on a Java_Integer Proxy, which won't
do
> >>>>>>>either.
> >>>>>>>Example:
> >>>>>>>
> >>>>>>>---snip----
> >>>>>>>JavaVM m_vm
> >>>>>>>m_vm = CREATE JavaVM
> >>>>>>> int iRes
> >>>>>>> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
> >>>>>>> if iRes < 0 then
> >>>>>>> messagebox("Error", "Can't create JavaVM. Code: " + string(iRes))
> >>>>>>> end if
> >>>>>>>java_integer jint
> >>>>>>>iRes = m_vm.Createjavainstance( jint, "java_integer") <---Error
> >>
> >>comes
> >>
> >>>>>>>here!
> >>>>>>>Messagebox ("cn", jint.classname( ))
> >>>>>>>---snip----
> >>>>>>>
> >>>>>>>This works perfectly within PB IDE. When I deploy my application, I
> >>
> >>get
> >>
> >>>>>the
> >>>>>
> >>>>>
> >>>>>>>following exception as indicated above: "Error calling Method of a
> >>
> >>PBNI
> >>
> >>>>>>>object".
> >>>>>>>The JavaVm seems to be initialized correctly.
> >>>>>>>
> >>>>>>>What am I missig?
> >>>>>>>
> >>>>>>>Any help would be appreciated
> >>>>>>>
> >>>>>>>Markus
> >>>>>>>
> >>>>>>>
> >>>>>
> >>>>>
> >>>>>
> >
> > Bruce Armstrong [TeamSybase]
> > http://www.teamsybase.com
> >
> > TeamSybase blogs:
> > http://www.teamsybase.net/blogs
> >
> > Vote for PocketBuilder in the Mobile Village awards
> > http://www.mobilevillage.com/awards.htm
> >
> > Two 3rd party books on developing with PowerBuilder
> > http://www.pb9books.com?source=newsgroups
> >
> > Need code sample? Check out CodeXchange:
> > http://www.codexchange.sybase.com
> >
> > Preach the gospel at all times. If necessary, use words. - Francis of
Assisi
> > http://www.needhim.org
> >
> > ---------------------------------------------------------------------
> > DISCLAIMER:
> >
> > This newsgroup message is only intended for the recipient. Given that it
> > is a posting to a public newsgroup, that means if you can read this
> > message then you are the recipient. This message may contain
information
> > that is confidential and protected from disclosure. And then again,
> > it may not.
> >
> > Given that TeamSybase members are not employees of Sybase, the contents
> > of this message do not necessarily represent the views or policies of
> > Sybase. Given that TeamSybase is a diverse group of users of Sybase
> > products, the contents of this message do not necessarily represent the
> > views of a significant number of the members of TeamSybase. Given that
the
> > author has multiple personalities and hears voices in his head, the
contents
> > of this message do not necessarily represent his own views.
> Bruce you are probably right, but I swear that I saw a note somewhere that
says
> that you can only do TRY..CATCH [maybe reliably] via PBDs.
>
> Jason

in UserGuid Powerbuilder 10 page 882:
Machine Code:

"Select this if you want to generate compiled code instead of Pcode.

If your code uses exception handling, you cannot generate

compiled code. For more information about compiled code and

Pcode, see Application Techniques.

Selecting Machine Code enables the other code generation options

in the Project painter. They cannot be set in the wizard."

Might be a relict of Userguide 9.0

Regards
Markus


Bruce Armstrong [TeamSybase] Posted on 2004-08-31 04:51:34.0Z
From: "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: PB10, JavaVM.CreateJavaInstance
Organization: TeamSybase
Reply-To: NOCANSPAM_bruce.armstrong@teamsybase.com
Message-ID: <n908j01b3qtcahsvv992jo0flavrbh40jf@4ax.com>
References: <412cb643$1@forums-2-dub> <412cf404@forums-2-dub> <412dad0a$1@forums-2-dub> <412e1d4e@forums-1-dub> <j0asi0d3p1k85uv3iooma6hjp8lk9mgl3b@4ax.com> <413303d1@forums-1-dub> <i0a6j0ptnqofo3d7o36pc9tu3he0ndq7kf@4ax.com> <413344d3$1@forums-1-dub> <41335469@forums-1-dub>
X-Newsreader: Forte Agent 2.0/32.646
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 68-190-226-38.la-cbi.charterpipeline.net
X-Original-Trace: 30 Aug 2004 21:57:59 -0700, 68-190-226-38.la-cbi.charterpipeline.net
Lines: 278
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 30 Aug 2004 21:40:57 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 30 Aug 2004 21:51:34 -0700
X-Trace: forums-1-dub 1093927894 10.22.108.75 (30 Aug 2004 21:51:34 -0700)
X-Original-Trace: 30 Aug 2004 21:51:34 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:350
Article PK: 424525

As indicated earlier in the thread, PB10 added the capability to use
exception handling in machine code. Prior to PB10, it could only be
used in PCode.

On 30 Aug 2004 09:23:05 -0700, "Markus" <MarkusNospstieraam@yahoo.com>

wrote:

>Hi,
>
>see comment below...
>
>"Jason Vogel" <jasonvogel@poboxes_dot_com> schrieb im Newsbeitrag
>news:413344d3$1@forums-1-dub...
>> Bruce Armstrong [TeamSybase] wrote:
>> > I can confirm that exception handling works for PB10 when compiled to
>> > machine code.
>> >
>> > The JavaVM class is a PBNI class. I don't know of any issues with
>> > PBNI and machine code.
>> >
>> > On 30 Aug 2004 03:39:13 -0700, "Markus" <MarkusNospstieraam@yahoo.com>
>> > wrote:
>> >
>> >
>> >>Can anybody confirm or disprove the behaviour decribed above? Is the
>JavaVM
>> >>class functional only in PCode projects?
>> >>
>> >>Regards,
>> >>Markus
>> >>
>> >>"Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> schrieb im Newsbeitrag
>> >>news:j0asi0d3p1k85uv3iooma6hjp8lk9mgl3b@4ax.com...
>> >>
>> >>>That changes in PB10.
>> >>>
>> >>>On 26 Aug 2004 10:26:38 -0700, Gokhan Demir
>> >>><gokhan.demir@igonline.biz> wrote:
>> >>>
>> >>>
>> >>>>AFAIK, machine code cannot use try-catch blocks. So, it should not be
>> >>>>used with clients using javavm.
>> >>>>
>> >>>>Regards,
>> >>>>Gokhan
>> >>>>
>> >>>>Markus wrote:
>> >>>>
>> >>>>>Hi,
>> >>>>>
>> >>>>>actuallly the code is:
>> >>>>>-----snip
>> >>>>>JavaVM m_vm
>> >>>>> String ClassPath
>> >>>>> int iRes
>> >>>>>
>> >>>>> ClassPath = ".\classes"
>> >>>>>
>> >>>>> try
>> >>>>> m_vm = CREATE JavaVM
>> >>>>> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
>> >>>>> if iRes < 0 then
>> >>>>> messagebox("Error", "Couldn't create JavaVM. Code: " +
>string(iRes))
>> >>>>> end if
>> >>>>> catch (CreateException ce)
>> >>>>> MessageBox( "Create Exception", ce.getMessage() )
>> >>>>> catch (Throwable t1)
>> >>>>> MessageBox("Generic Exception Phase 1", t1.getMessage())
>> >>>>> end try
>> >>>>>
>> >>>>> MessageBox ("Classpath", m_vm.getjavaclasspath())
>> >>>>>
>> >>>>> java_integer jint
>> >>>>>
>> >>>>> try
>> >>>>> iRes = m_vm.Createjavainstance(jint, "java_integer")
>> >>>>> Messagebox ("cn", jint.classname())
>> >>>>> catch (Throwable t2)
>> >>>>> MessageBox("Generic Exception Phase 2", t2.getMessage())
>> >>>>> end try
>> >>>>> ----snip
>> >>>>>
>> >>>>>The try-catch does not change anything (except that I get my
>messagebox
>> >>>>>instead of system message).
>> >>>>>Further tests revealed that it works, if I deploy the application
>with
>> >>>>>default code generation (no machine code). The PBNI exception occurs
>> >>
>> >>when I
>> >>
>> >>>>>compile machine code. It doesn't matter if I choose DLL or not for
>the
>> >>>>>libraries.
>> >>>>>Is there a limitation for the javavm and machine-code
>code-generation?
>> >>>>>
>> >>>>>Any idea?
>> >>>>>
>> >>>>>
>> >>>>>regards
>> >>>>>Markus
>> >>>>>
>> >>>>>
>> >>>>>"Gokhan Demir" <gokhan.demir@igonline.biz> schrieb im Newsbeitrag
>> >>>>>news:412cf404@forums-2-dub...
>> >>>>>
>> >>>>>
>> >>>>>>Hello,
>> >>>>>>
>> >>>>>>Does it change the runtime behaviour if you add a try-catch block
>> >>
>> >>before
>> >>
>> >>>>>>m_vm.CreateJavaVM(...) and after m_vm.CreateJavaInstance( jint,
>... ) ?
>> >>>>>>
>> >>>>>>Regards,
>> >>>>>>Gokhan
>> >>>>>>
>> >>>>>>Markus wrote:
>> >>>>>>
>> >>>>>>
>> >>>>>>>Hi there,
>> >>>>>>>
>> >>>>>>>I've developed a small tool which calls a function of a java class.
>It
>> >>>>>
>> >>>>>works
>> >>>>>
>> >>>>>
>> >>>>>>>perfectly within the PB10 IDE, but not if I deploy it.
>> >>>>>>>The following example is based on a Java_Integer Proxy, which won't
>do
>> >>>>>>>either.
>> >>>>>>>Example:
>> >>>>>>>
>> >>>>>>>---snip----
>> >>>>>>>JavaVM m_vm
>> >>>>>>>m_vm = CREATE JavaVM
>> >>>>>>> int iRes
>> >>>>>>> iRes = m_vm.CreateJavaVM(ClassPath, FALSE)
>> >>>>>>> if iRes < 0 then
>> >>>>>>> messagebox("Error", "Can't create JavaVM. Code: " + string(iRes))
>> >>>>>>> end if
>> >>>>>>>java_integer jint
>> >>>>>>>iRes = m_vm.Createjavainstance( jint, "java_integer") <---Error
>> >>
>> >>comes
>> >>
>> >>>>>>>here!
>> >>>>>>>Messagebox ("cn", jint.classname( ))
>> >>>>>>>---snip----
>> >>>>>>>
>> >>>>>>>This works perfectly within PB IDE. When I deploy my application, I
>> >>
>> >>get
>> >>
>> >>>>>the
>> >>>>>
>> >>>>>
>> >>>>>>>following exception as indicated above: "Error calling Method of a
>> >>
>> >>PBNI
>> >>
>> >>>>>>>object".
>> >>>>>>>The JavaVm seems to be initialized correctly.
>> >>>>>>>
>> >>>>>>>What am I missig?
>> >>>>>>>
>> >>>>>>>Any help would be appreciated
>> >>>>>>>
>> >>>>>>>Markus
>> >>>>>>>
>> >>>>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >
>> > Bruce Armstrong [TeamSybase]
>> > http://www.teamsybase.com
>> >
>> > TeamSybase blogs:
>> > http://www.teamsybase.net/blogs
>> >
>> > Vote for PocketBuilder in the Mobile Village awards
>> > http://www.mobilevillage.com/awards.htm
>> >
>> > Two 3rd party books on developing with PowerBuilder
>> > http://www.pb9books.com?source=newsgroups
>> >
>> > Need code sample? Check out CodeXchange:
>> > http://www.codexchange.sybase.com
>> >
>> > Preach the gospel at all times. If necessary, use words. - Francis of
>Assisi
>> > http://www.needhim.org
>> >
>> > ---------------------------------------------------------------------
>> > DISCLAIMER:
>> >
>> > This newsgroup message is only intended for the recipient. Given that it
>> > is a posting to a public newsgroup, that means if you can read this
>> > message then you are the recipient. This message may contain
>information
>> > that is confidential and protected from disclosure. And then again,
>> > it may not.
>> >
>> > Given that TeamSybase members are not employees of Sybase, the contents
>> > of this message do not necessarily represent the views or policies of
>> > Sybase. Given that TeamSybase is a diverse group of users of Sybase
>> > products, the contents of this message do not necessarily represent the
>> > views of a significant number of the members of TeamSybase. Given that
>the
>> > author has multiple personalities and hears voices in his head, the
>contents
>> > of this message do not necessarily represent his own views.
>> Bruce you are probably right, but I swear that I saw a note somewhere that
>says
>> that you can only do TRY..CATCH [maybe reliably] via PBDs.
>>
>> Jason
>in UserGuid Powerbuilder 10 page 882:
>Machine Code:
>
>"Select this if you want to generate compiled code instead of Pcode.
>
>If your code uses exception handling, you cannot generate
>
>compiled code. For more information about compiled code and
>
>Pcode, see Application Techniques.
>
>Selecting Machine Code enables the other code generation options
>
>in the Project painter. They cannot be set in the wizard."
>
>Might be a relict of Userguide 9.0
>
>Regards
>Markus
>

Bruce Armstrong [TeamSybase]
http://www.teamsybase.com

TeamSybase blogs:
http://www.teamsybase.net/blogs

Vote for PocketBuilder in the Mobile Village awards
http://www.mobilevillage.com/awards.htm

Two 3rd party books on developing with PowerBuilder
http://www.pb9books.com?source=newsgroups

Need code sample? Check out CodeXchange:
http://www.codexchange.sybase.com

Preach the gospel at all times. If necessary, use words. - Francis of Assisi
http://www.needhim.org

---------------------------------------------------------------------
DISCLAIMER:

This newsgroup message is only intended for the recipient. Given that it
is a posting to a public newsgroup, that means if you can read this
message then you are the recipient. This message may contain information
that is confidential and protected from disclosure. And then again,
it may not.

Given that TeamSybase members are not employees of Sybase, the contents
of this message do not necessarily represent the views or policies of
Sybase. Given that TeamSybase is a diverse group of users of Sybase
products, the contents of this message do not necessarily represent the
views of a significant number of the members of TeamSybase. Given that the
author has multiple personalities and hears voices in his head, the contents
of this message do not necessarily represent his own views.


Markus Posted on 2004-08-30 16:26:17.0Z
From: "Markus" <MarkusNospstieraam@yahoo.com>
Newsgroups: sybase.public.powerbuilder.ejbclient
References: <412cb643$1@forums-2-dub> <412cf404@forums-2-dub> <412dad0a$1@forums-2-dub> <412e1d4e@forums-1-dub> <j0asi0d3p1k85uv3iooma6hjp8lk9mgl3b@4ax.com> <413303d1@forums-1-dub> <i0a6j0ptnqofo3d7o36pc9tu3he0ndq7kf@4ax.com>
Subject: Re: PB10, JavaVM.CreateJavaInstance
Lines: 21
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: pd9ea1252.dip0.t-ipconnect.de
X-Original-NNTP-Posting-Host: pd9ea1252.dip0.t-ipconnect.de
Message-ID: <41335529$1@forums-1-dub>
Date: 30 Aug 2004 09:26:17 -0700
X-Trace: forums-1-dub 1093883177 217.234.18.82 (30 Aug 2004 09:26:17 -0700)
X-Original-Trace: 30 Aug 2004 09:26:17 -0700, pd9ea1252.dip0.t-ipconnect.de
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:349
Article PK: 424524

Hi,

"Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
schrieb im Newsbeitrag news:i0a6j0ptnqofo3d7o36pc9tu3he0ndq7kf@4ax.com...

> I can confirm that exception handling works for PB10 when compiled to
> machine code.
>
> The JavaVM class is a PBNI class. I don't know of any issues with
> PBNI and machine code.
>

doesn't anybody access Java classes using JavaVM?
I'd really like to see a working example for that in PB10.

regards
Markus