cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5216
Views
5
Helpful
10
Replies

Unable to load UCCX script with custom java class

lohjintiam
Level 4
Level 4

Hi all,

I'm currently running 8.5.1.10000-37 and have developed several custom java classes for web services integration with a CRM system. Majority of the custom java classes are working fine except 1. This java class (Cons_Prima) has 2 methods (i.e. method A, getCons_AccountID) in there. There's no issue with method A.

a) The script (Script2.aef) with uses this java class is able to be validated in uccx editor without issues

b) This script is able to run in debug, reactive script mode as well as normal mode without issues

c) However when trying to associate this script to my application (Application->Application Management->App Name->Cisco Script Application), it is popping up an error saying this script cant be loaded. In MADM logs, "Exception=java.io.IOException: undefined method: getCons_AccountID for class: Cons_Prima". Somehow here it doesn't recognize this method.

d) Once i remove this method from my script, the script can be loaded without issues.

e) What i'm doing now is to associate the script to the application (without this method) -> modify this script directly (script respository) from script editor to add in this method in to be able to run it in reactive & normal mode.

f) I'm not facing any security/IIS related issues as mentioned in other post

Is there any known issues around this? Is there a restriction where 1 java class can only have 1 method?

Thanks!

-JT-

10 Replies 10

Tanner Ezell
Level 4
Level 4

In your jar file are you packaging both classes into it? This is common problem when the jars are packaged manually. You can verify this by unzip'ing your jar file and verifying you see a class file for both (or going a step furthur and actually checking to see the methods are in their via decompilation).

Failing that it may be beneficial for you to post the relevent java code, logs and script for us to take a look at.

Tanner Ezell www.ctilogic.com

For this jar file, only a single class exist. Within this single class, there are 2 methods in there. Both methods are visible & usable to script editor but somehow only the 1st method is recognized by MADM-SCRIPT_MGR (if that makes sense)

I also have another jar file having 2 methods. But i'm only calling 1 of them in script editor while the other is being used as a sub method to the 1st one.

Thanks!

-JT-

Hi JT,

I too am facing a similar issue. I have a script which is using a custom jar, All the changes i make in my application/jar file are getting reflected in my Logs so i assume that both my script and jar files are working fine.

But i am not able to map my application in Application manager (Applications->Application Management). I am getting a message stating unable to load the script please check the logs.

Also the logs show the below message.

1751082: Feb 04 12:06:06.265 IST %MADM-SCRIPT_MGR-3-UNABLE_LOAD_SCRIPT:Unable to load script: Script=/BinnyDemo/BinnyUccxDemo.aef,Exception=java.io.IOException: undefined method: getCallFlowData for class: com.db.QueryDatabase

1751083: Feb 04 12:06:06.265 IST %MADM-SCRIPT_MGR-3-EXCEPTION:java.io.IOException: undefined method: getCallFlowData for class: com.db.QueryDatabase

If you have resolved the same please do let me know how did you resolved it or if any solutions for this.

Rgds/Binny

Hi,

the error message is quite clear on this. Your script references a class (com.db.QueryDatabase), more precisely, its method, getCallFlowData and it was not found (and thus is undefined).

Are you sure this method is available in the class? Is it public?

G.

Yes the method [getCallFlowData] is public and as i mentioned the class exists and also the changes that i am doing in this file is also getting reflected.

Rgds/Binny

Apparently, there is a problem there. As I said, the error message is quite clear on this, plus the simple fact that UCCX won't let you use the application suggests it's something funny going on there.

What do you mean by "All the changes i make in my application/jar file are getting reflected in my Logs". What logs? Also, did you reload the CCX engine after you uploaded the new custom JAR?

G.

By Changes  i mean if i change some parameter values in my method in my Custom Jar and the changes in my script as in adding/removing nodes they are getting reflected.

By logs i mean, I am writing cutom logs using log4j by which i come to know what my method is returning by that i make sure that the changes that i make in my custom jar are getting reflected. As custom jars are mean to undergo changes as and when we find some issues and fix them accordingly.

Hope you got the point and have answered to your context.

Rgds/Binny

Hi,

no, not really, but it seems I can't help you out here, sorry about that.

G.

Yeah, it's difficult to help in cases like this. Posting up 'my custom jar doesn't work, here's the logs which say X is the problem, but X is definately not the problem' doesn't leave much scope for discussion.

If you are absolutely certain there's nothing else in the logs to indicate why it fails, simplify your code. If you think there is a problem with a particular method, remove some code, leaving dummy methods with the same signatures. if that works, build it up slowly till you find the issue.

It can be tricky to work out what's going on with this stuff, if all else fails consider running it off-box, especially if you feel the need to change the code frequently. I've found that just swapping the jars isn't good enough - often you need to reboot the whole box or at least restart the Node Manager in order for things to work or changes to apply.

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

This thread is a bit stale but I thought it might help to clarify one point about custom jar files on UCCX.

To properly load a custom jar:

  1. Upload it into the classpath directory in the document repository. 
  2. Select it under System | Custom Classes Configuration
  3. Finally you need to restart the CCX Engine and the CCX Administration services.  If you have HA you need to restart them on both servers. 

Other notes:

When referencing your class in the CCX Editor, use the fully qualified name of the class.  Lots of other classes use things like Element or Document so you need to be explicit. The editor only knows about the 20 native classes by their object names.  If you create a Document object in the editor you are really creating a com.cisco.doc.Document object.  If you loaded jdom.jar and you wanted a jdom document then you need to create an object of type org.jdom.Document.

When compiling your custom jar files, be sure to compile for the version of Java that the CCX Engine runs.  In general UCCX 7.X and older use Java 1.4.  UCCX 8.X and higher use Java 1.6.  Several of the core Java classes had significant changes between 1.4 and 1.6. If you ran your code on UCCX 7 or earlier and now it fails in UCCX 8.X or higher, recomplile for Java 1.6 and you classes will likely work again.

Finally, check for security violations in UCCX 8.X or higher.  Cisco has restricted some of the things you can do.  These URL's have more information:

http://docwiki.cisco.com/wiki/Engine

http://docwiki.cisco.com/wiki/Troubleshooting_Tips_for_Unified_CCX_8.0

-Steven


Please help us make the communities better.  Rate helpful posts!

Please help us make the communities better. Rate helpful posts!