VMware Cloud Community
SamWolf
Enthusiast
Enthusiast
Jump to solution

5.5 SQL plugin error

Hello,

My team has recently upgraded a VCO server from 5.1 to 5.5 and have run into an error around code that previously executed without issue.

We are using the SQL plugin to make writes of various data to a SQL table, but since the 5.5 upgrade we are running into the following error.

"java.sql.SQLException: Unable to convert between org.mozilla.javascript.ConsString and NUMERIC."

Is this simply a type mismatch that requires a recasting of the VCO variable before it is passed off to SQL?

Any input is appreciated.

Thanks,

Sam

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

This looks like the issue with string concatenation being of type ConsString instead of type string in the latest Rhino js engine (vCO 5.5 uses Rhino 1.7R4, vCO 5.1 uses Rhino 1.7R3).

var x = "some string";

var y = "another string";

var z = x + y; // this is of type ConsString in Rhino 1.7R4; used to be string in Rhino 1.7R3

func(z); // will be passed as ConsString parameter

func(z.valueOf()); // should be passed as plain string parameter

I think this is fixed vCO 5.5U1, so you should either upgrade, or check your scripting code for possible string concatenations and 'flatten' them manually.

Hope this helps.

View solution in original post

0 Kudos
1 Reply
iiliev
VMware Employee
VMware Employee
Jump to solution

This looks like the issue with string concatenation being of type ConsString instead of type string in the latest Rhino js engine (vCO 5.5 uses Rhino 1.7R4, vCO 5.1 uses Rhino 1.7R3).

var x = "some string";

var y = "another string";

var z = x + y; // this is of type ConsString in Rhino 1.7R4; used to be string in Rhino 1.7R3

func(z); // will be passed as ConsString parameter

func(z.valueOf()); // should be passed as plain string parameter

I think this is fixed vCO 5.5U1, so you should either upgrade, or check your scripting code for possible string concatenations and 'flatten' them manually.

Hope this helps.

0 Kudos