3

I am creating an application using the linkedin-j Java library and JavaLoader, and I am finding that whenever I drop it into a server running ColdFusion 9.0.1, I start getting the following error:

coldfusion.util.DumpHelper
(java.lang.ClassNotFoundException)

I am not doing anything crazy with the library. I have narrowed it down to being caused by the following code:

var l_user = api_client.getProfileForCurrentUser();

api_client is an instance of the client object in linkedin-j. I don't know a whole lot of Java, but I don't see anything in there that should break ColdFusion's utils.

Upon testing, this doesn't appear to happen when using Railo.

Dave Long
  • 9,569
  • 14
  • 59
  • 89
  • To clarify, just invoking api_client.getProfileForCurrentUser() causes the exception OR doing something else like trying to dump the instance? Also 1) What is the full stack trace? The true error is often buried further down. and 2) How are you instantiating the javaLoader? Specifically, are you using the second argument `loadColdFusionClassPath`? – Leigh May 03 '12 at 17:25
  • It happens when after I use that if I try to dump anything out (either from linkedin-j or anything else like the Application scope). My code to instantiate the JavaLoader is as follows: `Variables.javaloader.init(classes);` classes being an array of paths to the jars for linkedin-j. – Dave Long May 03 '12 at 17:35
  • I do not know if linkedin-j has any other dependencies, but you might try setting `loadColdFusionClassPath=true` in the javaLoader. Also can you update your question with the full stack trace? That is usually where the true error message lies. – Leigh May 03 '12 at 17:45
  • I don't get a full stacktrace, but the error. I have CF debugging enabled and see other error stack traces, but nothing here. I will give the other argument a try though. – Dave Long May 03 '12 at 18:05
  • Weird. I cannot test it right now, but maybe it is related to the dump object problem. Check the error logs too on the off chance they contain the full trace. – Leigh May 03 '12 at 18:26
  • Adding loadColdFusionClassPath did work. Would you mind changing your comment to an answer, so I can mark it as such? – Dave Long May 03 '12 at 18:34

1 Answers1

3

(From the comments ...)

You might try setting loadColdFusionClassPath=true when you instantiate the javaLoader.

Leigh
  • 28,765
  • 10
  • 55
  • 103