on 05-24-2012 5:06 PM
Hi,
I am trying to access iViews and System objects from the Portal PCD using the code given in the following wiki link:
http://wiki.sdn.sap.com/wiki/display/WDJava/Retrieving+all+iViews+from+PCD
I am getting ClassCastException on the following line of code:
IPcdSearchResult searchResult = (IPcdSearchResult) ne.nextElement();
The complete exception is:
java.lang.ClassCastException: class com.sapportals.portal.pcd.gl.PcdGlSearchResult:service:com.sap.tc.pcd.gl.srv@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@1e071f47@alive incompatible with interface com.sapportals.portal.pcd.gl.IPcdSearchResult:sap.com/home~mdm_framework@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@6dcec96a@alive
I am doing this in NW7.3 Portal. This very code works fine in NW7.0. Please help me to resolve this error.
Thanks & Regards,
Ankur Garg
Hi Ankur,
Have you tried this:
list = initialContext.list(root);
NameClassPair nameClass;
while(list.hasMore()) {
nameClass = (NameClassPair) list.next();
if(nameClass
.getClassName()
.equals("com.sapportals.portal.ivs.iviews.IPortalIview"))
{ //do something }
if(nameClass
.getClassName()
.equals("com.sapportals.iviewserver.systemlandscape.service.ISystemObject"))
{ //do something }
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ankur,
So it looks like the API has changed from 7.0 to 7.3... can you instead cast to the actual correct type (e.g. PcdGISearchResult)... the code here shows how to do this:
I can't find any public Javadocs for PcdGlSearchResult I'm afraid.
Hope this helps,
Simon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.