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.

Returning a Collection of "Foo" objects to PB from Java

2 posts in EJB Client Last posting was on 2008-10-10 13:23:54.0Z
HG97TJ Posted on 2008-07-21 20:35:54.0Z
From: HG97TJ <hguarini@yahoo.com>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Returning a Collection of "Foo" objects to PB from Java
Date: Mon, 21 Jul 2008 13:35:54 -0700 (PDT)
Organization: http://groups.google.com
Lines: 100
Message-ID: <1d3fed9d-a43f-445d-a4a9-18764eb4e7d4@d45g2000hsc.googlegroups.com>
NNTP-Posting-Host: 204.86.42.50
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1216672554 3522 127.0.0.1 (21 Jul 2008 20:35:54 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 21 Jul 2008 20:35:54 +0000 (UTC)
Cc: Daniel.Bush@us.ing.com, howie.guarini@us.ing.com
Complaints-To: groups-abuse@google.com
Injection-Info: d45g2000hsc.googlegroups.com; posting-host=204.86.42.50; posting-account=wBytywkAAAD1mZUpkwS_dSDQGfndD4FF
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16,gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!newsfeed.yul.equant.net!novia!novia!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!d45g2000hsc.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:790
Article PK: 424885

I have an object in Java, "Foo", that I can successfully return to my
PB Client app as a method return type using the EJBClient proxy. I
can also successfully call a method in the Java class from PB to
return a Collection of String values: getFooListSimple(). However
when I try to return a Collection of "Foo" objects from Java to PB I
get the following error message:

"Failed to find the proxy to represent the Java class: Foo.
It implements the following interfaces: java.io.Serializable.

So PB knows about the Foo object since it can return just a single
instance of the Foo object and return a List of Strings from the Foo
object, but why not a List of Foo's? The proxy clearly has a "Foo"
type defined in it's ejb_mapping. And I'm assuming since the
successful return of a single instance of Foo rules out any classpath
issues.

PB: version 9.01 b7066
jdk: 1.4

Any help is appreciated:


--------------------------------------------------------------------------------------------------------------------------------
Here's the code ...

//-----------------------
JAVA
//-----------------------

public class Foo implements Serializable {

private String firstName;
private String lastName;

public Foo (String first, String last) {
firstName = first;
lastName = last;
}

public String getLastName() {
return lastName;
}

public String getFirstName() {
return firstName;
}

public List getFooList() {
// *** this method call DOES NOT WORK from PB ***
List l = new ArrayList();
l.add(new Foo("Danny","Briere"));
l.add(new Foo("Simon","Gagne"));
l.add(new Foo("Martin","Biron"));
l.add(new Foo("Riley","Cote"));
return l;
}

public List getFooListSimple() {
// *** this method call DOES WORK from PB ***
List l = new ArrayList();
l.add("Danny Briere");
l.add("Simon Gagne");
l.add("Martin Biron");
l.add("Riley Cote");
return l;
}

}

//-----------------------
PB code
//-----------------------

lEJBConn = CREATE EJBConnection
lEJBConn.CreateJavaInstance(lConv, "Converter")

try
Foo f1, f2
List px_List
Iterator pbx_iterator
string firstName, lastName

f1 = lConv.getfoo()

px_List = f1.getfoolist()
pbx_iterator = px_List.iterator()

do while pbx_iterator.hasNext()
f2 = pbx_iterator.next_j()

firstName = f2.getfirstname()
lastName = f2.getlastname()
loop

catch (Exception e)
ls_cause = e.getmessage()
MessageBox("Exception", ls_cause)

end try


bede Posted on 2008-10-10 13:23:54.0Z
From: bede <bedenosp@msofico.be>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Returning a Collection of "Foo" objects to PB from Java
Message-ID: <MPG.235975d35bee6b7a9898c0@forums.sybase.com>
References: <1d3fed9d-a43f-445d-a4a9-18764eb4e7d4@d45g2000hsc.googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
User-Agent: MicroPlanet-Gravity/2.70.2067
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 10 Oct 2008 06:23:54 -0700
X-Trace: forums-1-dub 1223645034 10.22.241.152 (10 Oct 2008 06:23:54 -0700)
X-Original-Trace: 10 Oct 2008 06:23:54 -0700, vip152.sybase.com
Lines: 55
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:800
Article PK: 424893

wrap the collection in a (single) class & provide public methods to manipulate the data


In article <1d3fed9d-a43f-445d-a4a9-18764eb4e7d4@d45g2000hsc.googlegroups.com>,
hguarini@yahoo.com says...

> I have an object in Java, "Foo", that I can successfully return to my
> PB Client app as a method return type using the EJBClient proxy. I
> can also successfully call a method in the Java class from PB to
> return a Collection of String values: getFooListSimple(). However
> when I try to return a Collection of "Foo" objects from Java to PB I
> get the following error message:
>
> "Failed to find the proxy to represent the Java class: Foo.
> It implements the following interfaces: java.io.Serializable.
>
> So PB knows about the Foo object since it can return just a single
> instance of the Foo object and return a List of Strings from the Foo
> object, but why not a List of Foo's? The proxy clearly has a "Foo"
> type defined in it's ejb_mapping. And I'm assuming since the
> successful return of a single instance of Foo rules out any classpath
> issues.
>
> PB: version 9.01 b7066
> jdk: 1.4
>
> Any help is appreciated:
>
>
> --------------------------------------------------------------------------------------------------------------------------------
> Here's the code ...
>
> //-----------------------
> JAVA
> //-----------------------
>
> public class Foo implements Serializable {
>
> private String firstName;
> private String lastName;
>
> public Foo (String first, String last) {
> firstName = first;
> lastName = last;
> }
>
> public String getLastName() {
> return lastName;
> }
>
> public String getFirstName() {
> return firstName;
> }
>
> public List getFooList() {
> // *** this method call DOES NOT WORK from PB ***