« Back to General Discussion - All Versions

RE: Custom element error logs

Combination View Flat View Tree View
Threads [ Previous | Next ]
I have a custom element that I can't get to load in call studio. I have found the issue in the element, it is a single line fo code that it must not like, because when I comment it out the element loads fine. 
Is there a place I can look to see what error is causing the element not to load? I checked workspace/.metadata/.log, but I'm not seeing anything in there, and I don't know where else to look.
 
Here is the offending code in case anyone can help on that end:
    URL url = new URL(<http://someXmlFile.xml);
 
    URLConnection conn = url.openConnection();
    conn.setRequestProperty("Authorization", "Basic "+cred);
    conn.connect();
    InputStream sn = conn.getInputStream();
 
    SaxTicketReader ticketReader = new SaxTicketReader();
    SAXParserFactory factory = SAXParserFactory.newInstance();
    try {
        SAXParser parser = factory.newSAXParser();
        parser.parse(new InputSource(sn), ticketReader);  <------- this is the line that is causing the issue.
    } catch....
 
 
This code works fine when I test it outside of call studio.

Are you adding this as a class file or bundling it a jar and then adding it ?
Do one thing, call this code from action element within studio and see what if it give you an error.
Hemal

From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Tuesday, November 13, 2012 11:33 AM
To: cdicuser@developer.cisco.com
Subject: New Message from Asher Schweigart in Customer Voice Portal (CVP) - General Discussion - All Versions: Custom element error logs

Asher Schweigart has created a new message in the forum "General Discussion - All Versions": -------------------------------------------------------------- I have a custom element that I can't get to load in call studio. I have found the issue in the element, it is a single line fo code that it must not like, because when I comment it out the element loads fine.
Is there a place I can look to see what error is causing the element not to load? I checked workspace/.metadata/.log, but I'm not seeing anything in there, and I don't know where else to look.

Here is the offending code in case anyone can help on that end:
URL url = new URL(<http://someXmlFile.xml);

URLConnection conn = url.openConnection();
conn.setRequestProperty("Authorization", "Basic "+cred);
conn.connect();
InputStream sn = conn.getInputStream();

SaxTicketReader ticketReader = new SaxTicketReader();
SAXParserFactory factory = SAXParserFactory.newInstance();
try {
SAXParser parser = factory.newSAXParser();
parser.parse(new InputSource(sn), ticketReader); <------- this is the line that is causing the issue.
} catch....


This code works fine when I test it outside of call studio.
--
To respond to this post, please click the following link: http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/8529570 or simply reply to this email.

Asher, If the element doesn't show up in studio, you should be able to go to Window > Show View > Call Studio Error Log.
 

Thank you both, both ways showed the info I needed. Error was caused because it could not find my custom classes, which I wrote as subclasses of the element class.
I was using the compiled class file, i switched to using a jar, and that fixed it. Seems I need to work on my ant build file to get this working right!

I have seen cases where it does not show with class and works with jar. Good it worked for you.
Hemal

From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Tuesday, November 13, 2012 1:17 PM
To: cdicuser@developer.cisco.com
Subject: New Message from Asher Schweigart in Customer Voice Portal (CVP) - General Discussion - All Versions: RE: Custom element error logs

Asher Schweigart has created a new message in the forum "General Discussion - All Versions": -------------------------------------------------------------- Thank you both, both ways showed the info I needed. Error was caused because it could not find my custom classes, which I wrote as subclasses of the element class.
I was using the compiled class file, i switched to using a jar, and that fixed it. Seems I need to work on my ant build file to get this working right!
--
To respond to this post, please click the following link: http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/8533271 or simply reply to this email.

Yeah, I looked into it more, and what happended was just a stupid mistake on my part.
I was unfamiliar with how java compiled classes.
I had my ant build file set to auto copy the class file into call studio, and when I started adding subclasses to the main class, I did not realize that the subclasses would be in seperate files.
I figured that since they were part of the main class, they would be in the same class file. Oops.