Copy link to clipboard
Copied
Intermittently i am getting the below error.
An exception occurred while instantiating a Java object. The class must not be an interface or an abstract class. If the class has a constructor that accepts an argument, you must call the constructor explicitly using the init(args) method. Error
I have an web service and using the java i am invkoing it. in CF i am creating object and calling the menthod which in turn invoke the web service. but i am getting the above error.
i was getting the error because it cant able to find the proporties file from the given location. once i gave the physical path its working fine.
Copy link to clipboard
Copied
Hi vkunirs,
I am also getting the same error message. I am trying to call API written in java by some trird party. It seems that you are passing some wrong parameter(I want say type mismatch) when you are calling init() method of the function.
Thanks,
Saurav
Copy link to clipboard
Copied
When working with Java Objects directly, its generally a good idea to use the JavaCast() method to force your CF data into the correct corresponding Java data type. If you are not already doing that, I would recommend trying that and let us know what happens
Copy link to clipboard
Copied
> Object instantiation exception.
Also post the full stack trace. With java objects the relevant error is usually contained in the stack trace, not the generic header you see.
-Leigh
Copy link to clipboard
Copied
i was getting the error because it cant able to find the proporties file from the given location. once i gave the physical path its working fine.
Copy link to clipboard
Copied
Make sure u pass not empty value. I had same problem with this function and my IDS var was empty :
FUNCTION ISEVEN(IDS){
EVENS = FALSE;
QO = createObject('java', 'java.math.BigInteger').init(IDS);
QB = precisionEvaluate((QO/2)).toString();
TRY{
QO = createObject('java', 'java.math.BigInteger').init(QB);
EVENS = TRUE;
}CATCH(any e){
}
RETURN EVENS;
}
When empty value pass to this function it's create error. Hope it will help to some one there.