<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>VXML error: xyz is not a valid Action Elemnt Class</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_category?p_l_id=10572&amp;mbCategoryId=0" />
  <subtitle>VXML error: xyz is not a valid Action Elemnt Class</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_category?p_l_id=10572&amp;mbCategoryId=0</id>
  <updated>2013-05-23T06:37:48Z</updated>
  <dc:date>2013-05-23T06:37:48Z</dc:date>
  <entry>
    <title>Automatic reply: New Message from Asher Schweigart in Customer Voice Portal</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=10572&amp;messageId=7751619" />
    <author>
      <name>Amlan Das</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=10572&amp;messageId=7751619</id>
    <updated>2012-10-17T17:00:33Z</updated>
    <published>2012-10-17T17:00:33Z</published>
    <summary type="html">I am off on personal-day today and will reply to your email tomorrow.</summary>
    <dc:creator>Amlan Das</dc:creator>
    <dc:date>2012-10-17T17:00:33Z</dc:date>
  </entry>
  <entry>
    <title>RE: New Message from Justine Joubran in Customer Voice Portal (CVP) - CVP -</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=10572&amp;messageId=4177038" />
    <author>
      <name>Amlan Das</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=10572&amp;messageId=4177038</id>
    <updated>2011-07-06T21:52:14Z</updated>
    <published>2011-07-06T21:52:14Z</published>
    <summary type="html">You have set maxwait="1000". 
This seems a little short if your DB is located in a different network. DB operations over different networks can be time consuming.
Try setting it to a larger value (eg. "5000" or "10000"); and see if this works.</summary>
    <dc:creator>Amlan Das</dc:creator>
    <dc:date>2011-07-06T21:52:14Z</dc:date>
  </entry>
  <entry>
    <title>RE: Run Time error:- java.lang.ClassCastException: ModularDBbackup. Need he</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=10572&amp;messageId=4097467" />
    <author>
      <name>Amlan Das</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=10572&amp;messageId=4097467</id>
    <updated>2011-06-22T03:31:50Z</updated>
    <published>2011-06-22T03:31:50Z</published>
    <summary type="html">I have found the solution to this. I would rather say I was acting stupid. For the benefit of all those whose viewed this post - 
I was calling the Action class as a Dynamic configuration class from the Cisco ready-made Database element.
Using a separate Action class above the Database element has resolved the issue.</summary>
    <dc:creator>Amlan Das</dc:creator>
    <dc:date>2011-06-22T03:31:50Z</dc:date>
  </entry>
  <entry>
    <title>Run Time error:- java.lang.ClassCastException: ModularDBbackup. Need help</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=10572&amp;messageId=4026538" />
    <author>
      <name>Amlan Das</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=10572&amp;messageId=4026538</id>
    <updated>2011-06-09T14:23:23Z</updated>
    <published>2011-06-09T14:21:39Z</published>
    <summary type="html">I have a number of configuration databases installed (MS SQL Server 2008), which have the same tables and values and have replication enabled among them. I read values from these tables and in my CVP Studio application "Master.app" and perform actions.
Currently, for DB connection in Studio app "Master.app", I statically mention the JNDI name for connection to DB. So, I do not have a redundancy in place for the database connection from my app.
To resolve this, I have created an Action Class to read JNDI names entered in an XML file, perform a connection test, and return the JNDI name as a session variable to the "Master.app" studio application. This action class is called right after the "CVP Subdialog Start" element in the Master application.
But, when I ran my code, I get the run tim error -  java.lang.ClassCastException: ModularDBbackup
I then tried to run the application using "StartCallInterface" and method "OnStartCall"; and calling the ModularDBbackup at the start of the Master application, but face the same error - classcastexception.
Does anyone have any idea why is this happening?
 
The error is given below ----
 
10.204.3.134.1307453348333.0.MS2,06/07/2011 13:29:08.395,There was a problem instantiating the dynamic configuration class ModularDBbackup. The error was: java.lang.ClassCastException: ModularDBbackup
java.lang.ClassCastException: ModularDBbackup
	at com.audium.server.voiceElement.ActionElementBase.determineConfig(ActionElementBase.java:486)
	at com.audium.server.voiceElement.ActionElementBase.service(ActionElementBase.java:358)
	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.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)
 
 
 
My actual source code is given below -------------------------------------
 

/*  ********************************************/
/* @author AmlanDas
/*  ********************************************/
 
 
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
 
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;
 
import org.igfay.jfig.JFig;
import org.igfay.jfig.JFigConstants;
import org.igfay.jfig.JFigException;
import org.igfay.jfig.JFigIF;
import org.igfay.jfig.JFigLocator;
 
import com.audium.server.AudiumException;
import com.audium.server.session.ActionElementData;
import com.audium.server.voiceElement.ActionElementBase;
//import com.audium.server.voiceElement.ElementInterface;
import org.apache.log4j.*;
 
 
public class ModularDBbackup extends ActionElementBase
{
	String logFilename = "/Cisco/CVP/VXMLServer/logs/ModularDBbackup.log";
	String maxFileSize = "20MB";
	int maxNumFiles = 20;
	String logLevel = "TRACE";
	public static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(ModularDBbackup.class);
	
	JFigLocator configLocator;
	static String configFileName = "DBconfig.xml";
	String configPath;
	JFigIF config;
	public void	doAction(String name, ActionElementData actionData) throws AudiumException
    {
		actionData.addToLog("Entered the ", "ModularDBbackup class");
		try
		{
//			 Initialize the log4j Loggers
 
			PatternLayout logFileLayout = new PatternLayout("%d{dd-MMM-yyyy HH:mm:ss,SSS} [%t] %-5p %c{1}.%m%n");
			RollingFileAppender appender = new RollingFileAppender(logFileLayout, logFilename);
 
			//appender.setFile(Filename.generateTimestampFilename(logFolderPath, strLogFileName, ".log"));
			appender.setMaxFileSize(maxFileSize);
			appender.setMaxBackupIndex(maxNumFiles);
			appender.activateOptions();
			logger.addAppender(appender);
			logger.setLevel(org.apache.log4j.Level.toLevel(logLevel));
			
			// Load JNDI name search configuration
			// This is used to load the JNDI name configuration stored in
			// the DBconfig.xml file.
			BasicConfigurator.configure();
			try 
			{
				logger.debug("Entered the config loader space");
				// Configure the LF5Appender using the DefaultLF5Configurator.  
				configLocator = new JFigLocator(configFileName);
			    Map&lt;String, String&gt; env = System.getenv();
			    configPath = env.get("JNDI_Search_Path");
 
			    if (configPath != null)
			    {
			    	if (!configPath.endsWith("\\"))
			    	{
			    		configPath = configPath.concat("\\");
			    	}	
			    	configLocator.setConfigDirectory(configPath);
					configLocator.setConfigLocation(JFigConstants.FILE);
					logger.debug("Read the config from system variables");
			    }
			    else
			    {
			    	// Write Error message and continue. 
			    	logger.error("Environment Variable JNDI_Search_Path not set. Can't get applicaiton configuration");
			    }
				
				JFig.initialize(configLocator);
				config = JFig.getInstance();
 
			} 
			catch (JFigException jfEx) {
			logger.error(jfEx.getMessage());
			}
			
			
		}
		catch (Exception Ex)
		{
			logger.error(Ex.getMessage());
		}
 
		String method = "getJNDIname";
		boolean rowFound = false;
		String value = null;
		String key = "JNDI_";
		String JNDIValue = "ModularA";
		List JNDI_list = JFig.getInstance().getValuesStartingWith("Modular_DB_JNDI_names", key);
		ListIterator JNDI_listIterator = JNDI_list.listIterator();
		logger.debug("Populated list with DB information values");
		// Make sure we have at least one entry in the iterator
		if (JNDI_listIterator.hasNext())
			{	
				while(JNDI_listIterator.hasNext()&amp;&amp; !rowFound)
				{
					value = (String)JNDI_listIterator.next();
					if ((value != null) &amp;&amp; (value.compareTo("") != 0))
					{
						try
						{
							Context initialContext = new InitialContext();
							if(initialContext == null )
							{
								logger.error(method  + "Error - No DB Naming Context created, cannot continue insert.");
							}
							else
							{
								for(int i=0; i&lt;10; i++)
								{
									Context envContext  = (Context)initialContext.lookup("java:/comp/env");
									DataSource ds = (DataSource)envContext.lookup(value);
									if (ds != null) 
									{
										try
										{
											Connection tempcon = ds.getConnection();
											Statement stmt = tempcon.createStatement();
											String sqlstmt = "Select * from Modular.dbo.Customers";
											ResultSet rs = null;
											rs=stmt.executeQuery(sqlstmt);
											if(rs.next())
											{
												JNDIValue = value;
												i = 10;
											}
											else
											{
												if (JNDI_listIterator.hasNext())
												{
													value = (String)JNDI_listIterator.next();
												}
												else{
													logger.debug("There are no active DB connections. Please check the DB status");
												}
											}
										}
										catch (SQLException ex)
										{
											logger.debug("Caught SQL exception " + ex );
										}
									}
								}
							}
						}
						catch (Exception x)
						{
							logger.debug("Caught SQL exception " + x );
						}
					}
					else
					{
						logger.debug("The value returned for JNDI name lookup is NULL");
					}
				}
			}		
		//JNDIValue = this.getJNDIName();
		actionData.setSessionData("JNDI_name", JNDIValue);
		actionData.addToLog("ModularDBbackup", "getJNDIName: JNDI name returned is" + JNDIValue);
	}
}</summary>
    <dc:creator>Amlan Das</dc:creator>
    <dc:date>2011-06-09T14:21:39Z</dc:date>
  </entry>
  <entry>
    <title>VXML error: xyz is not a valid Action Elemnt Class</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=10572&amp;messageId=2757292" />
    <author>
      <name>Amlan Das</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=10572&amp;messageId=2757292</id>
    <updated>2010-11-19T11:27:40Z</updated>
    <published>2010-11-19T11:27:40Z</published>
    <summary type="html">I have written an Action Element Class that creates objects out of a custom class and does some DB dip, and updates session variables.
 
But when I run the call studio app, I get an error in the custom element that says - xyz is not a valid Action Element Class.
 
But when I had exported the code to a jar file, it did not give any errors.
 
In the code, I am setting the element name, description, folder name of the custom element. Then I define the settings of the element, create dependency for linking the method calls. Then in doAction method, I create an object of the custom class and then call the method that is ndescribed in the custom class.
 
Has anybody ever encountered anything similar to this? If so, what could be the possible reason? Am I missing anything basic?</summary>
    <dc:creator>Amlan Das</dc:creator>
    <dc:date>2010-11-19T11:27:40Z</dc:date>
  </entry>
</feed>

