• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

adding "org.omg.stub" to my classpath

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi... I am experiencing a rather weird problem when trying to retrieve a CMP named "Url" as in the following code:
ArrayList urls = new ArrayList();
Collection c = getEBUrlHome().findAllUrl();
for(Iterator itr = c.iterator();itr.hasNext() ;) {
urls.add(((EBUrl)PortableRemoteObject.narrow(itr.next(), Class.forName("com.develop.app.common.EBUrl"))).getUrl());
}
The exception is:
java.lang.ClassCastException: Unable to load class: org.omg.stub.com.develop.app.common._EBUrl_Stub
at com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:269)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:136)
....
The thing is my classpath is com.develop.app.common but the exception thrown show it has a "org.omg.stub" prefixed in front of it. I looked high and low but I cannot find a "org.omg.stub" added in my codes. I have also confirmed that the finder "findAllUrl()" actually returns a collection of 25. Can anyone help to resolve the exception?
[ March 30, 2002: Message edited by: Jacqueline Qin ]
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
get a element from the collection and cast it to the remote interface and then return the interface in the findallURL method. becoz i had the same problem and i did this only.
otherwise read this thread, i tried to mail u but the option is not there try searching for this
posted November 10, 2001 08:08 AM
--------------------------------------------------------------------------------
Hello all,
I need to have a finder method which will bring the result by joining of two tables.
Eg select T1.*, T2.* from Order T1 Customer T2 where T1.id = T2.id
Is there a facility to write such a finder in websphere 4.0?
Thanks & Have a nice day,
Samir
IP: Logged

Kyle Brown
bartender posted November 10, 2001 12:15 PM
--------------------------------------------------------------------------------
Not in Container Managed Persistence, there isn't. In Bean Managed Persistence, of course you can write any SQL you like in your ejbFind... methods.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
IP: Logged

Samir Bhagwat
greenhorn posted November 10, 2001 11:59 PM
--------------------------------------------------------------------------------
Thanks Kyle, your suggestions are really valuable.
IP: Logged

Samir Bhagwat
greenhorn posted November 11, 2001 12:27 AM
--------------------------------------------------------------------------------
Hi Kyle,
One last question about finder methods to you. We were using powertier application server and we are planning to shift to websphere 4.0.
In powertier one writes custom finder method in home interface and one implements that in Bean class. I don't see this in websphere 4.0 here one has to use finder helper classes for it. But we have currently implemented custom finder method which takes custom object as inputs and it returns Enumeration of Custom objects which are not EJBObject.
For e.g. Consider custom finder method declared in home interface as follows:
Enumeration findByFilter(FilterObject f).
Now this enumeration contains Objects of class Table which is not EJBObject.
First I don't see this type of implementation in websphere. Am I right? So to accomplish this feature I have to create another layer before calling Entity bean which will do this functionality. Am I right or webshepere will provide this funciotnality?
Thanks a lot,
Samir
IP: Logged

Kyle Brown
bartender posted November 11, 2001 01:21 PM
--------------------------------------------------------------------------------
You are right, WebSphere will not provide that functionality (finders that don't return the type of the remote interface). That is not in compliance with the EJB spec. So yes, you'll have to write another layer of software to be in compliance with the spec and make it work in WebSphere.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
That's a very big dog. I think I want to go home now and hug this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic