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.

Error when calling java method returning Object

5 posts in EJB Client Last posting was on 2005-04-07 20:46:43.0Z
jcsmonda Posted on 2003-11-28 09:49:50.0Z
Sender: 35ac.3fc71a2c.1804289383@sybase.com
From: jcsmonda
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Error when calling java method returning Object
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <3fc71a3e.35ae.846930886@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 28 Nov 2003 01:49:50 -0800
X-Trace: forums-1-dub 1070012990 10.22.241.41 (28 Nov 2003 01:49:50 -0800)
X-Original-Trace: 28 Nov 2003 01:49:50 -0800, 10.22.241.41
Lines: 67
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:205
Article PK: 424394

When I call a java method which the returned type in the
prototype is Object,
I have the following Error (in the case when the real type
of the returned object is StringBuffer) :
Failed to find the proxy to represent the java class:
java.lang.StringBuffer.
It implements the following interfaces:
java.io.Serializable;

Have anybody the same problem ?
Or, can anyone successfully call such a method ?

I use the EJBConnection method to access to java.
My version of PB is PB9.01 build 6533.

Thanks for your help.


Sample code:
Java class:
public class MyClass {
public Object getObject() {
return new StringBuffer("hello in getObject");
}

public StringBuffer getStringBuffer() {
return new StringBuffer("hello in
getStringBuffer");
}
}

Powerbuilder:
JavaVM l_JavaVM
EJBConnection l_EJBConn
String ls_classPath

ls_classPath = "C:\HOMEWARE\JCS\ejbtest\bin"
l_JavaVM = CREATE JavaVM
l_JavaVM.CreateJavaVM(ls_classPath, True)
l_EJBConn = CREATE EJBConnection

myclass l_myclass
l_EJBConn.CreateJavaInstance(l_myclass, "myclass")

stringbuffer l_stringbuffer
Try
// No problem here
l_stringbuffer = l_myclass.getStringBuffer()
MessageBox("Success getStringBuffer",
l_stringbuffer.toString())
Catch (Exception e1)
MessageBox("Error getStringBuffer", e1.getMessage(),
Exclamation!)
End Try

Any la_result
Try
// Error here
la_result = l_myclass.getObject()
MessageBox("Success getObject", "")
Catch (Exception e2)
MessageBox("Error getObject", e2.getMessage(),
Exclamation!)
End Try


JC Smondack


Gökhan Demir Posted on 2003-11-28 16:09:22.0Z
Message-ID: <3FC77197.ACE7D43F@igonline.biz>
From: =?iso-8859-1?Q?G=F6khan?= Demir <gokhan.demir@igonline.biz>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Error when calling java method returning Object
References: <3fc71a3e.35ae.846930886@sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: adsluser-1165.adsl.ttnet.net.tr
X-Original-NNTP-Posting-Host: adsluser-1165.adsl.ttnet.net.tr
Date: 28 Nov 2003 08:09:22 -0800
X-Trace: forums-1-dub 1070035762 212.174.52.141 (28 Nov 2003 08:09:22 -0800)
X-Original-Trace: 28 Nov 2003 08:09:22 -0800, adsluser-1165.adsl.ttnet.net.tr
Lines: 83
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:206
Article PK: 424393

Hi,

Your sample code successfully runs on my environment. I have PB9.0.1
Build 6533, Sun JDK 1.4.2_02, w2k machine on a P3-800. Besides for your
information, I have many other Java methods returning objects, I face
the objects and wrap them into appropriate java classes within
Powerbuilder code succesfully.

You can contact me offline to give your e-mail address and I can send
you the generated proxies for your java class and java.lang.StringBuffer
in case you want to compare with yours.

HTH,
Gokhan

jcsmonda wrote:

> When I call a java method which the returned type in the
> prototype is Object,
> I have the following Error (in the case when the real type
> of the returned object is StringBuffer) :
> Failed to find the proxy to represent the java class:
> java.lang.StringBuffer.
> It implements the following interfaces:
> java.io.Serializable;
>
> Have anybody the same problem ?
> Or, can anyone successfully call such a method ?
>
> I use the EJBConnection method to access to java.
> My version of PB is PB9.01 build 6533.
>
> Thanks for your help.
>
> Sample code:
> Java class:
> public class MyClass {
> public Object getObject() {
> return new StringBuffer("hello in getObject");
> }
>
> public StringBuffer getStringBuffer() {
> return new StringBuffer("hello in
> getStringBuffer");
> }
> }
>
> Powerbuilder:
> JavaVM l_JavaVM
> EJBConnection l_EJBConn
> String ls_classPath
>
> ls_classPath = "C:\HOMEWARE\JCS\ejbtest\bin"
> l_JavaVM = CREATE JavaVM
> l_JavaVM.CreateJavaVM(ls_classPath, True)
> l_EJBConn = CREATE EJBConnection
>
> myclass l_myclass
> l_EJBConn.CreateJavaInstance(l_myclass, "myclass")
>
> stringbuffer l_stringbuffer
> Try
> // No problem here
> l_stringbuffer = l_myclass.getStringBuffer()
> MessageBox("Success getStringBuffer",
> l_stringbuffer.toString())
> Catch (Exception e1)
> MessageBox("Error getStringBuffer", e1.getMessage(),
> Exclamation!)
> End Try
>
> Any la_result
> Try
> // Error here
> la_result = l_myclass.getObject()
> MessageBox("Success getObject", "")
> Catch (Exception e2)
> MessageBox("Error getObject", e2.getMessage(),
> Exclamation!)
> End Try
>
> JC Smondack


jcsmonda Posted on 2003-12-01 11:50:26.0Z
Sender: 25a1.3fcb1f9a.1804289383@sybase.com
From: jcsmonda
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Error when calling java method returning Object
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <3fcb2c8b.25fc.846930886@sybase.com>
References: <3fc71a3e.35ae.846930886@sybase.com><3FC77197.ACE7D43F@igonline.biz>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 1 Dec 2003 03:56:59 -0800, 10.22.241.42
Lines: 91
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 1 Dec 2003 03:39:34 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 1 Dec 2003 03:50:26 -0800
X-Trace: forums-1-dub 1070279426 10.22.108.75 (1 Dec 2003 03:50:26 -0800)
X-Original-Trace: 1 Dec 2003 03:50:26 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:208
Article PK: 424395

Thanks for your answer.

I will try to contact you offline.

JC Smondack

> Hi,
>
> Your sample code successfully runs on my environment. I
> have PB9.0.1 Build 6533, Sun JDK 1.4.2_02, w2k machine on
> a P3-800. Besides for your information, I have many other
> Java methods returning objects, I face the objects and
> wrap them into appropriate java classes within
> Powerbuilder code succesfully.
>
> You can contact me offline to give your e-mail address and
> I can send you the generated proxies for your java class
> and java.lang.StringBuffer in case you want to compare
> with yours.
>
> HTH,
> Gokhan
>
> jcsmonda wrote:
>
> > When I call a java method which the returned type in the
> > prototype is Object,
> > I have the following Error (in the case when the real
> > type of the returned object is StringBuffer) :
> > Failed to find the proxy to represent the java
> > class: java.lang.StringBuffer.
> > It implements the following interfaces:
> > java.io.Serializable;
> >
> > Have anybody the same problem ?
> > Or, can anyone successfully call such a method ?
> >
> > I use the EJBConnection method to access to java.
> > My version of PB is PB9.01 build 6533.
> >
> > Thanks for your help.
> >
> > Sample code:
> > Java class:
> > public class MyClass {
> > public Object getObject() {
> > return new StringBuffer("hello in
> > getObject"); }
> >
> > public StringBuffer getStringBuffer() {
> > return new StringBuffer("hello in
> > getStringBuffer");
> > }
> > }
> >
> > Powerbuilder:
> > JavaVM l_JavaVM
> > EJBConnection l_EJBConn
> > String ls_classPath
> >
> > ls_classPath = "C:\HOMEWARE\JCS\ejbtest\bin"
> > l_JavaVM = CREATE JavaVM
> > l_JavaVM.CreateJavaVM(ls_classPath, True)
> > l_EJBConn = CREATE EJBConnection
> >
> > myclass l_myclass
> > l_EJBConn.CreateJavaInstance(l_myclass,
> "myclass") >
> > stringbuffer l_stringbuffer
> > Try
> > // No problem here
> > l_stringbuffer =
> > l_myclass.getStringBuffer()
> > MessageBox("Success getStringBuffer",
> > l_stringbuffer.toString()) Catch (Exception e1)
> > MessageBox("Error getStringBuffer",
> > e1.getMessage(), Exclamation!)
> > End Try
> >
> > Any la_result
> > Try
> > // Error here
> > la_result = l_myclass.getObject()
> > MessageBox("Success getObject", "")
> > Catch (Exception e2)
> > MessageBox("Error getObject",
> > e2.getMessage(), Exclamation!)
> > End Try
> >
> > JC Smondack
>


Vlad Zlotskiy Posted on 2004-04-22 20:10:31.0Z
From: "Vlad Zlotskiy" <vladz@imsi.com>
Newsgroups: sybase.public.powerbuilder.ejbclient
References: <3fc71a3e.35ae.846930886@sybase.com> <3FC77197.ACE7D43F@igonline.biz>
Subject: Re: Error when calling java method returning Object
Lines: 109
Organization: IMS
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: exit.imsi.com
X-Original-NNTP-Posting-Host: exit.imsi.com
Message-ID: <408826b7$1@forums-1-dub>
Date: 22 Apr 2004 13:10:31 -0700
X-Trace: forums-1-dub 1082664631 199.253.174.9 (22 Apr 2004 13:10:31 -0700)
X-Original-Trace: 22 Apr 2004 13:10:31 -0700, exit.imsi.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:275
Article PK: 424456

I have exact same problem when attempting to call nextElement() on
Enumeration, which suppose to return Object into my any variable. Under the
hood I guess PowerBuilder tries to immediately implicitly cast my any
variable into existing proxy that corresponds to the real underlying class
under the returned Object and produces an error in my case it is :

Failed to find the proxy to represent the java.class:
com.ibm.jms.JMSTextMessage. It implements the following interfaces:
javax.jms.TextMessage.

What puzzles me is that I have proxies for both classes in my PBL, in fact I
have a variable declared in the script of the corresponding proxy type.
I guess my question is there anything special about the way proxies are
located at runtime based on the underlying class and implemented interface.
From what I understand PB Proxy has no notion of interface all it knows is
the underlying class name and its ancestors.

I greately appreciate any help

Vlad

"Gökhan Demir" <gokhan.demir@igonline.biz> wrote in message
news:3FC77197.ACE7D43F@igonline.biz...
> Hi,
>
> Your sample code successfully runs on my environment. I have PB9.0.1
> Build 6533, Sun JDK 1.4.2_02, w2k machine on a P3-800. Besides for your
> information, I have many other Java methods returning objects, I face
> the objects and wrap them into appropriate java classes within
> Powerbuilder code succesfully.
>
> You can contact me offline to give your e-mail address and I can send
> you the generated proxies for your java class and java.lang.StringBuffer
> in case you want to compare with yours.
>
> HTH,
> Gokhan
>
> jcsmonda wrote:
>
> > When I call a java method which the returned type in the
> > prototype is Object,
> > I have the following Error (in the case when the real type
> > of the returned object is StringBuffer) :
> > Failed to find the proxy to represent the java class:
> > java.lang.StringBuffer.
> > It implements the following interfaces:
> > java.io.Serializable;
> >
> > Have anybody the same problem ?
> > Or, can anyone successfully call such a method ?
> >
> > I use the EJBConnection method to access to java.
> > My version of PB is PB9.01 build 6533.
> >
> > Thanks for your help.
> >
> > Sample code:
> > Java class:
> > public class MyClass {
> > public Object getObject() {
> > return new StringBuffer("hello in getObject");
> > }
> >
> > public StringBuffer getStringBuffer() {
> > return new StringBuffer("hello in
> > getStringBuffer");
> > }
> > }
> >
> > Powerbuilder:
> > JavaVM l_JavaVM
> > EJBConnection l_EJBConn
> > String ls_classPath
> >
> > ls_classPath = "C:\HOMEWARE\JCS\ejbtest\bin"
> > l_JavaVM = CREATE JavaVM
> > l_JavaVM.CreateJavaVM(ls_classPath, True)
> > l_EJBConn = CREATE EJBConnection
> >
> > myclass l_myclass
> > l_EJBConn.CreateJavaInstance(l_myclass, "myclass")
> >
> > stringbuffer l_stringbuffer
> > Try
> > // No problem here
> > l_stringbuffer = l_myclass.getStringBuffer()
> > MessageBox("Success getStringBuffer",
> > l_stringbuffer.toString())
> > Catch (Exception e1)
> > MessageBox("Error getStringBuffer", e1.getMessage(),
> > Exclamation!)
> > End Try
> >
> > Any la_result
> > Try
> > // Error here
> > la_result = l_myclass.getObject()
> > MessageBox("Success getObject", "")
> > Catch (Exception e2)
> > MessageBox("Error getObject", e2.getMessage(),
> > Exclamation!)
> > End Try
> >
> > JC Smondack
>


Mark Knight Posted on 2005-04-07 20:46:43.0Z
Sender: 814.4255872e.846930886@sybase.com
From: Mark Knight
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Error when calling java method returning Object
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <42559c33.a88.1681692777@sybase.com>
References: <408826b7$1@forums-1-dub>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 7 Apr 2005 13:46:43 -0700
X-Trace: forums-1-dub 1112906803 10.22.241.41 (7 Apr 2005 13:46:43 -0700)
X-Original-Trace: 7 Apr 2005 13:46:43 -0700, 10.22.241.41
Lines: 118
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:520
Article PK: 424653

I have exactly the same problem as described below. If
anyone out there knows the answer to this riddle then please
tell me the answer as it is driving me nuts.
Thanks.

> I have exact same problem when attempting to call
> nextElement() on Enumeration, which suppose to return
> Object into my any variable. Under the hood I guess
> PowerBuilder tries to immediately implicitly cast my any
> variable into existing proxy that corresponds to the real
> underlying class under the returned Object and produces an
> error in my case it is :
>
> Failed to find the proxy to represent the java.class:
> com.ibm.jms.JMSTextMessage. It implements the following
> interfaces: javax.jms.TextMessage.
>
> What puzzles me is that I have proxies for both classes in
> my PBL, in fact I have a variable declared in the script
> of the corresponding proxy type. I guess my question is
> there anything special about the way proxies are located
> at runtime based on the underlying class and implemented
> interface. From what I understand PB Proxy has no notion
> of interface all it knows is the underlying class name and
> its ancestors.
>
> I greately appreciate any help
>
> Vlad
>
>
> "Gökhan Demir" <gokhan.demir@igonline.biz> wrote in
> message news:3FC77197.ACE7D43F@igonline.biz...
> > Hi,
> >
> > Your sample code successfully runs on my environment. I
> > have PB9.0.1 Build 6533, Sun JDK 1.4.2_02, w2k machine
> > on a P3-800. Besides for your information, I have many
> > other Java methods returning objects, I face the objects
> > and wrap them into appropriate java classes within
> Powerbuilder code succesfully. >
> > You can contact me offline to give your e-mail address
> > and I can send you the generated proxies for your java
> > class and java.lang.StringBuffer in case you want to
> compare with yours. >
> > HTH,
> > Gokhan
> >
> > jcsmonda wrote:
> >
> > > When I call a java method which the returned type in
> > > the prototype is Object,
> > > I have the following Error (in the case when the real
> > > type of the returned object is StringBuffer) :
> > > Failed to find the proxy to represent the java
> > > class: java.lang.StringBuffer.
> > > It implements the following interfaces:
> > > java.io.Serializable;
> > >
> > > Have anybody the same problem ?
> > > Or, can anyone successfully call such a method ?
> > >
> > > I use the EJBConnection method to access to java.
> > > My version of PB is PB9.01 build 6533.
> > >
> > > Thanks for your help.
> > >
> > > Sample code:
> > > Java class:
> > > public class MyClass {
> > > public Object getObject() {
> > > return new StringBuffer("hello in
> > > getObject"); }
> > >
> > > public StringBuffer getStringBuffer() {
> > > return new StringBuffer("hello in
> > > getStringBuffer");
> > > }
> > > }
> > >
> > > Powerbuilder:
> > > JavaVM l_JavaVM
> > > EJBConnection l_EJBConn
> > > String ls_classPath
> > >
> > > ls_classPath = "C:\HOMEWARE\JCS\ejbtest\bin"
> > > l_JavaVM = CREATE JavaVM
> > > l_JavaVM.CreateJavaVM(ls_classPath, True)
> > > l_EJBConn = CREATE EJBConnection
> > >
> > > myclass l_myclass
> > > l_EJBConn.CreateJavaInstance(l_myclass,
> > "myclass") >
> > > stringbuffer l_stringbuffer
> > > Try
> > > // No problem here
> > > l_stringbuffer =
> > > l_myclass.getStringBuffer()
> > > MessageBox("Success getStringBuffer",
> > > l_stringbuffer.toString()) Catch (Exception
> > > e1) MessageBox("Error getStringBuffer"
> > > , e1.getMessage(), Exclamation!)
> > > End Try
> > >
> > > Any la_result
> > > Try
> > > // Error here
> > > la_result = l_myclass.getObject()
> > > MessageBox("Success getObject", "")
> > > Catch (Exception e2)
> > > MessageBox("Error getObject",
> > > e2.getMessage(), Exclamation!)
> > > End Try
> > >
> > > JC Smondack
> >
>
>