Jacqueline Qin

Greenhorn
+ Follow
since Jan 11, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Jacqueline Qin

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 ]
22 years ago
For the EJB QL part, you can find it in InfoCenter under
"6.6.0.15.5: Implementing custom finder helpers for CMP entity beans". It shows some examples of using EJB query language. I couldn't get it to work though so I used Where Clause instead. Anyway, these methods are not really EJB 2.0-specific and I am not sure if it will be provided for in future version of WebSphere
22 years ago
I think if I am not wrong, you just need to put jdbc b2 bname where dbname is your database name. You also need to create this connection in your DB2 Control Center. Go to your Control Center, expand to the databases node and right-click. Select "Add" and select the database.
22 years ago
Thanks, Susil, for your contribution. It could be a DB2 issue as you mentioned. I noticed that DB2 is more case-sensitive than Oracle. Can anyone else confirmed this case-sensitivity issue?
22 years ago
Hi, all. In WebSphere 4.0 Infocenter 6.6.0.15.5: Implementing custom finder helpers for CMP entity beans, I noticed that all the select statements are in upper-case but there is no mention that it has to be in upper-case. So I am wondering if the statements are to be in upper-case?
You see, I was using the where clause when I entered "(T1.userID = ?) AND (T1.companyid =?)" and this gave me a nullpointer exception which I traced it to the find method that is calling the above where clause. After trying all ways to resolve this issue, the last resort I took was to change the above where clause statement to all upper case and this is resolved.
Can anyone confirm or disprove this? For your info, I am running on Win 2000, WebSphere Advanced Edition Server and DB2. Thanks
22 years ago
I have a child home class that extends a parent home class. Basically, this class has three find methods. One of them extends from the parent . The thing is, during deployment, there is an error message that said that this extend-from-parent find method is not defined in the home class. Does that mean I cannot use a find method that is extended from parent?
22 years ago
Hi I have kinda asked in my other post but I think I should use a separate post.
Have anyone try using a java.lang.Long argument in a find method? I used a whereclause="T1.USERID = ?" where userid is a java.lang.Long. It will give me a "The method setLong(int, long) in the type java.sql.PreparedStatement is not applicable for the arguments (int, java.lang.Long)". I have this method declared in home interface as public Collection findByUserID(Long userID) throws FinderException, RemoteException.
If I change the method to a primitive long, there will not be error. Does anyone know what went wrong?
22 years ago
Thanks for the tip. Ok, so I tried with FullSelectFinderDescriptor using the selectStatement="SELECT T1.USERID FROM T1.MYTABLE".
Hmm.... I noticed one thing. In the Inforcenter, it mentioned it supported 4 custom finders which includes SQL SELECT, SQL WHERE, SQL Method, EJB query language. However in AAT, only the SQL Where (whereClause) option is available to help you generate the finder descriptor codes in the ibm-ejb-jar-ext.xmi. Does that means if I want to use the other methods, I have select the user option, jar the file (save it) and modify the generated ibm-ejb-jar-ext.xmi file, right? I try that but it keep throwing a "Must implement Method in Bean class". I am wondering if I need to implement a finder helper interface for the SQL SELECT, SQL Method, and EJB query? I mean SQL Where is the only working one now without a finder helper.
Can anyone verify what I have just written? Or give me the correct step of using the find methods without using finder helper interface.
22 years ago
Hi all. I am wondering if anyone can give me some pointers on using EJB QL in WebSphere. I understand that WebSphere currently support only 1.1 but it supposedly also support EJB QL in the ibm-ejb-jar-ext.xmi file. I try adding my own finder descriptor text as follow :

finderDescriptors xsi:type="ejbext:EjbqlFinderDescriptor" mi:id="findbyowner" ejbqlQueryString="SELECT OBJECT(o) FROM MYTABLE AS o WHERE (o.userID = ?1) AND (o.NAME = ?2)"
finderMethodElements xmi:id="MethodElement_2" name="findByOwnerIDandType" parms="java.lang.Long java.lang.Integer " type="Home"

I also have this two methods in my home interface.
But this doesn't seems to work. So I used the the "where clause" via the AAT, which only work if I use "long" instead of "java.lang.Long". If I use "java.lang.Long", it will give me a SQLPreparedStatement "setLong" error. What I don't understand is, in my previous declaration of java.lang.Long, WebSphere is smart enuff to add a longValue() to my java.lang.Long variable in the setLong methods. Can anyone help on this?
22 years ago