Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Object Instantiation Exception. Creating Java Object

Participant ,
Apr 07, 2009 Apr 07, 2009

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!

TOPICS
Advanced techniques
30.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 22, 2009 Jul 22, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 22, 2009 Jul 22, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 22, 2009 Jul 22, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 22, 2009 Jul 22, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 22, 2009 Jul 22, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 23, 2009 Jul 23, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 23, 2009 Jul 23, 2009

dcsonka wrote:

... I figured having

them 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 27, 2009 Jul 27, 2009

The sysadmin got instructions from Cybersource on the certificate matter:

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 27, 2009 Jul 27, 2009

Was it different than what is described in the manual? Is it working now?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 27, 2009 Jul 27, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 27, 2009 Jul 27, 2009

Well, thanks for posting the follow-up (and I am glad you finally got it working!).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 27, 2009 Jul 27, 2009

Thanks to you as well- your help was most appreciated!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 27, 2009 Jul 27, 2009
LATEST

You are very welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources