cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1025
Views
0
Helpful
0
Comments
cdnadmin
Community Member

Subject: RE: New Message from Benek Ozer in Customer Voice Portal (CVP) - CVP - All
Replied by: Ranjana Narayan on 03-02-2010 04:58:55 AM
Moving the jars should suffice.

________________________________

From: Cisco Developer Community Forums
[mailto:[email protected]]
Sent: Wednesday, February 03, 2010 10:25 AM
To: [email protected]
Subject: New Message from Benek Ozer in Customer Voice Portal (CVP) -
CVP - All Versions: RE: ClassCastException - NoClassDefFoundError


Benek Ozer has created a new message in the forum "CVP - All Versions":

--------------------------------------------------------------
Thanks Manoj,

How about the wsdl or xsd files? SHould they be in Tomcat or VXMLServer
common folders?


--
To respond to this post, please click the following link:

<http://developer.cisco.com/web/cvp/forums/-/message_boards/message/1943
728>

or simply reply to this email.
This document was generated from CDN thread

Created by: Benek Ozer on 03-02-2010 03:49:05 AM
Hello,

We are building a CVP Self Service application where we use our custom build java classes to call Web Services. Before we move on to implement classes into call flow logic, we created a simple CVP application where we call our classes to do a very simple web service request and fetch operation.

This operation is successful when tested it standalone but when we call the same class in CVP via action element, the test call/cvp debug fails with the following error:

xx.xx.xx.xx.1264970762992.73.R2HLTCHKV2,02/01/2010 07:46:03.101,A custom element encountered an exception. The error was: java.lang.ClassCastException: java.lang.NoClassDefFoundError
java.lang.ClassCastException: java.lang.NoClassDefFoundError
                at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:266)
                at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:137)
                at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:84)
                at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:172)
                at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:106)
                at $Proxy17.healthCheck(Unknown Source)
                at healthcheck.HealthCheck.getHealth(HealthCheck.java:62)
                at cvpapi.CVPAPI.healthCheck(CVPAPI.java:152)
                at healthCheck.doAction(healthCheck.java:26)
                at com.audium.server.voiceElement.ActionElementBase.service(ActionElementBase.java:384)
                at com.audium.server.controller.Controller.goToAction(Controller.java:2751)
                at com.audium.server.controller.Controller.goToElement(Controller.java:2493)
                at com.audium.server.controller.Controller.continueCall(Controller.java:2317)
                at com.audium.server.controller.Controller.goToElement(Controller.java:2534)
                at com.audium.server.controller.Controller.continueCall(Controller.java:2317)
                at com.audium.server.controller.Controller.goToElement(Controller.java:2534)
                at com.audium.server.controller.Controller.continueCall(Controller.java:2317)
                at com.audium.server.controller.Controller.goToElement(Controller.java:2534)
                at com.audium.server.controller.Controller.continueCall(Controller.java:2317)
                at com.audium.server.controller.Controller.goToElement(Controller.java:2534)
                at com.audium.server.controller.Controller.continueCall(Controller.java:2317)
                at com.audium.server.controller.Controller.doPost(Controller.java:634)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
                at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:834)
                at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:640)
                at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)
                at java.lang.Thread.run(Thread.java:595)
 

We have all the required files in CVP_HOME\common (under lib or class) folder.

How can we pinpoint and solve this issue?

Thank you in advance

Best Regards

Subject: RE: ClassCastException - NoClassDefFoundError
Replied by: Manoj Anantha on 03-02-2010 04:07:08 AM
All the WebService required Jar file goes to Tomcat/Common/Lib and all the custom Java class/jar you have built goes to the VXML/Server/Common/Lib or Classes.
 
After puting the class file ensure to restart the VXMLServer.
 
I guess you have put all the Webservice Jar files in "VXML/Server/Common/Lib". Try moving it to "Tomcat/Common/Lib"
 
If there is any error in your Java class file, it may not load. Can share the custom Java code? I can see if there is  error.
 
-Manoj

Subject: RE: ClassCastException - NoClassDefFoundError
Replied by: Benek Ozer on 03-02-2010 04:55:25 AM
Thanks Manoj,
 
How about the wsdl or xsd files? SHould they be in Tomcat or VXMLServer common folders?
 
 

Subject: RE: ClassCastException - NoClassDefFoundError
Replied by: Manoj Anantha on 03-02-2010 05:07:22 AM
You can create a jar file out of WSDL file. Once you have created a JAR file out of WSDL... you dont require it anymore for the code to run.
 
Are you using Axis tool kit to convert the WSDL to Java?
 
-Manoj

Subject: RE: ClassCastException - NoClassDefFoundError
Replied by: Benek Ozer on 03-02-2010 11:56:23 PM
Thank you for all your inputs.

Here is out detailed situation:


We are using Netbeans 6.7.1 and Java 1.5.0_21 as the development platform. The web service client artifact files were generated with the wsdlimport tool, wrapper classes were written in Java for each web service operation of interest. We have compiled and built a JAR package, this JAR can be run standalone through the command line.

As the first step in the integration of the web service classes with the VXML server, we have created a new package within the project and a class in this package that exposes methods which invoke the web services, this class is called WSAPI. We have tested this API using a standalone JAVA file that uses the API to invoke the web services, the web service operation  is successful. This JAVA class is provided below -

import wsapi.*

class TestWebService {
    public static void main(String[] args) {
         WSAPI wsAPI = new wsAPI();
         wsAPI.setEndpoint(https://1.2.3.4/wsendpoint);
         wsAPI.setTimeout(20);
         wsAPI.setSecurityHeader("blah");

         WSAPITestEndpointResponse wsResponse = new WSAPITestEndpointResponse(); // Prepare and send the WS request
         wsResponse = wsAPI.testEndpoint();

         if (wsResponse != null) {
               // Do something
         }
         else {
              // Do something else.
         }
      }
}

We have used the working sample above to prepare a class for the VXML server -

import com.audium.server.session.*;
import com.audium.server.AudiumException;
import com.audium.server.voiceElement.ActionElementBase;

import wsapi.*

public class testWebService extends ActionElementBase {

    public void doAction(String paramString, ActionElementData paramActionElementData) throws AudiumException {

         WSAPI wsAPI = new wsAPI();
         wsAPI.setEndpoint(https://1.2.3.4/wsendpoint);
         wsAPI.setTimeout(20);
         wsAPI.setSecurityHeader("blah");

         WSAPITestEndpointResponse wsResponse = new WSAPITestEndpointResponse(); // Prepare and send the WS request
         wsResponse = wsAPI.testEndpoint();

         if (wsResponse != null) {
               paramActionElementData.setSessionData("response", wsResponse.transactionState);
         }
         else {
               paramActionElementData.setSessionData("response", 1);
         }
      }
}
 
The web services JAR with the implementation of WSAPI class is placed in VXMLServer\common\lib folder while the class (testWebService.class) is placed in common\classes folder. After placing these files in their respective folders, we have restarted the VXML server. We keep encountering the exception mentioned in the first post. Upon receiving suggestions to move the JAR files used by the web services JAR into Tomcat\common\lib, we copied the JAR files into the folder, restarted the VXML server and we encounter the same exception. When we move the web services JAR file into the Tomcat\common\lib folder, the testWebService.class fails to find the web services JAR (specifying the location of the web services JAR file with the CLASSPATH environment variable does not get rid of the error).

We need some help and guidance in this regard. During the development phase, we have relied on "Programming Guide for Cisco Unified CVP VXML Server and Cisco Unified Call Studio". We have carried out the deployment procedure as detailed above, but failed to have the VXML server to run the class properly.

Subject: RE: ClassCastException - NoClassDefFoundError
Replied by: Manoj Anantha on 04-02-2010 12:50:34 AM
Here is what I did on one of the project. I used AXIS Package to convert WSDL to JAVA and used those Java JAR files to build the VXML custom JAVA class.
 
1) AXIS package has some SOAP, Webservice jar files. I put them on Tomcat/Common/Lib
2) All Custom java I created a JAR file and put them under VXMLServer/Common/Lib
3) WSDL to JAVA converted Jar file VXMLServer/Common/Lib
 
Your procedure is also the same. I think what you are missing is the first one. You need to pick those JAR files that are required for NetBeans to convert WSDL to Java classes. And put them under tomcat/common/lib. The error message also indicates that its not able to find some SOAP classes.
 
Which version of CVP are you using. CVP 4.X doesnt have webservice feature. If you are using CVP 7.X then you have a builting Webservice commponent that would just take the WSDL file and build everything that is required for you.
 
-Manoj

Subject: RE: ClassCastException - NoClassDefFoundError
Replied by: Benek Ozer on 04-02-2010 11:03:31 PM
Hello Manoj,
 
We are looking into your recommendations and comments at this point. I'll post the outcomes.
 
As for CVP Version and Web Service support: we are aware of the build-in Web Service element but we had customized requirements and security measures that is not provided with that element. That's why we needed to build custom classes in the first place.
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links