Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Struggling with OVS (ClassCast Exception)

I've been struggling with my first OVS implementation for the past few days and am needing some help. I've attempted to implement it per the Tutorial but I've obviously overlooked something as I'm getting a ClassCast Exception after my query. Below are the details.

Thanks in advance.

[code]

/**** OVSSearch (Controller) Context: ****/

+ OVSCustomeQueryOutput (M)

- City

- Kunnr

- ...

+ Z_Mv_Possible_Cust_Values_Input (M)

+ Output

+ Cust_List

- City

- ...

- Kunnr

- Name

- ...

+ OVSCustomerQueryInput (V)

- Kunnr

- Name

- ...[/code]

[code]/**** Code from OVSSearch (Controller) ****/

public com.sap.tc.webdynpro.progmodel.api.IWDOVSContextNotificationListener getOVSListner( )

{ return ovsListener; }

public com.sap.tc.webdynpro.progmodel.api.IWDNode getOVSInputNode( )

{ return wdContext.nodeOVSCustomerQueryInput(); }

public com.sap.tc.webdynpro.progmodel.api.IWDNode getOVSOutputNode( )

{ return wdContext.nodeOVSCustomeQueryOutput(); }

private class OVSCustomerNotificationListener implements IWDOVSContextNotificationListener {

private String attributeName;

public OVSCustomerNotificationListener(String attributeName) {

super();

this.attributeName = attributeName;

}

public void onQuery(IWDNodeElement queryInputNodeElement, IWDNode queryOutputNode) {

-


> IPublicOVSSearch.IZ_Mv_Possible_Cust_Values_InputElement ovsInput =

(IPublicOVSSearch.IZ_Mv_Possible_Cust_Values_InputElement ) queryInputNodeElement;

IPublicOVSSearch.ICust_ListNode ovsOutput = (IPublicOVSSearch.ICust_ListNode) queryOutputNode;

try {

ovsInput.modelObject().execute();

ovsInput.node().getChildNode("Output", 0).invalidate();

} catch (Exception e) { .. }

}

public void applyResult(IWDNodeElement applicationNodeElement, IWDNodeElement queryOutputNodeElement) {

IPrivateRFQHeaderView.IHeaderElement ovsCallerNodeElement =

(IPrivateRFQHeaderView.IHeaderElement) applicationNodeElement;

IPublicOVSSearch.IOVSCustomeQueryOutputElement output =

(IPublicOVSSearch.IOVSCustomeQueryOutputElement) queryOutputNodeElement;

ovsCallerNodeElement.setKunnr( output.getKunnr() );

ovsCallerNodeElement.setName( output.getName() );

}

public void applyInputValues(

IWDNodeElement applicationNodeElement,

IWDNodeElement queryInputNodeElement) {

Object initialValue = applicationNodeElement.getAttributeValue("Kunnr");

queryInputNodeElement.setAttributeValue("Name", initialValue);

}

}

private IWDOVSContextNotificationListener OVSCustomerListener;

private IWDOVSContextNotificationListener ovsListener = new OVSCustomerNotificationListener("Kunnr");[/code]

[code]

Stack Trace:

java.lang.ClassCastException

at com.intv.it.mini_vc.dc.OVSSearch$OVSCustomerNotificationListener.onQuery(OVSSearch.java:184)

at com.sap.tc.webdynpro.progmodel.valuehelp.OVSCMIQuery.onQuery(OVSCMIQuery.java:160)

at com.sap.tc.webdynpro.components.ovs.OVSComponent.query(OVSComponent.java:181)

at com.sap.tc.webdynpro.components.ovs.wdp.InternalOVSComponent.query(InternalOVSComponent.java:159)

at com.sap.tc.webdynpro.components.ovs.views.MainView.onActionGoSearch(MainView.java:152)

at com.sap.tc.webdynpro.components.ovs.views.wdp.InternalMainView.wdInvokeEventHandler(InternalMainView.java:146)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:304)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:659)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)

at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:251)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)[/code]

Former Member
Not what you were looking for? View more on this topic or Ask a question