Copy link to clipboard
Copied
Hi,
I am trying to implement CyberSource Simple Order API and I am getting an error on CFobject
Object Instantiation Exception. | |
An exception occurred when instantiating a Java object. The class must not be an interface or an abstract class. Error: com/cybersource/ws/client/ClientException. |
So far I've placed the .jar file into :\ColdFusion8\wwwroot\WEB-INF\lib directory and on my cfpage I got:
<cfobject action="create" type="Java" class="CyberSource" name="auth">
Does anyone have any experience with CyberSource or the source of the error code?
Thanks in advance!
Copy link to clipboard
Copied
dcsonka wrote:
Yes, my sysadmin installed the java API client on the server, and did some
test API transactions to the test cybersource server, which were successful.
The Java API client has some script files to run the pure Java version of
the API to send a transaction to Cybersource. I was able to log into the
Cybersource business center to confirm that the transactions were received.
Hmm.. was the java version tested with the same jre used by ColdFusion? It is a long shot, but I was wondering if the certificates (etcetera) were properly installed from ColdFusion's point of view.
Copy link to clipboard
Copied
Yeah, I couldn't find anything referencing a "caused by" in the preceding error reports.
The server that the java client and coldfusion code is running on, all uses the same JRE. That server is only used for coldfusion, and has just the one JRE installed.
If only thr Cybersource support staff was as responsive and helpful as you, you've been an awesome help, I just wish they could chime in and give some insight too.
Copy link to clipboard
Copied
Yes, sometimes it is tough dealing with Tech Support. Perhaps they just do not have much familarity they have with CF. Though I was surprised to see they had any CF examples.
It is a real long shot, but have you tried running the pure java examples from CF. In other words, create a wrapper class. Then call that from ColdFusion. Unfortunately, I do not have an account with them. So I could only test the code up to a point.
Copy link to clipboard
Copied
That is an interesting idea! I'm going to see what they have to tell me,
unfortunately they are also 3 hours behind me in timezone. If they have no
credible solution, I may try your idea as a last resort. I'll keep updating
this thread.
Copy link to clipboard
Copied
Yes, I do not know if it will work. But since you say it works from java, it might be worth a shot. Just be sure to use the same jars from java and CF so you are likely to get the same results. (I would also be curious exactly which jars are needed to successfully run the project from java).
I will keep an eye out for any updates.
Copy link to clipboard
Copied
So, the customer support group said to update the jvm.config file to have
the class path reference the JAR files, for it to work. I figured having
them in WEB-INF/lib would have been sufficient, but they insisted it needed
to be done.
The sysadmin updated the jvm.config file and the preceding error did not
occur (so I guess that is a small victory).
Now however, we are getting a new error, relating to a certificate:
Exception Message: sun.security.validator.ValidatorException: PKIX path
building failed: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
This doesn't look like a colfusion issue, offhand, but I'm not sure.
Copy link to clipboard
Copied
dcsonka wrote:
... I figured havingthem in WEB-INF/lib would have been sufficient, but they insisted it needed
to be done.
Exception Message: sun.security.validator.ValidatorException: PKIX path
building failed: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
...
I thought that too. But obviously not if it resolved the error.
I am not familiar with that last error. But it sounds like an issue with how the certificate was installed.
http://forums.java.net/jive/message.jspa?messageID=133547
Copy link to clipboard
Copied
The sysadmin got instructions from Cybersource on the certificate matter:
Copy link to clipboard
Copied
Was it different than what is described in the manual? Is it working now?
Copy link to clipboard
Copied
It looks like it all basically came down to some steps that the sysadmin
neglected to do during installation.1) Proper updating of the class path to
point to the necessary jar files
2) Proper installation of the root certificate for Cybersource
Once those two things were done, I was able to make an API call from
coldfusion.
Copy link to clipboard
Copied
Well, thanks for posting the follow-up (and I am glad you finally got it working!).
Copy link to clipboard
Copied
Thanks to you as well- your help was most appreciated!
Copy link to clipboard
Copied
You are very welcome.