RE: java classloader

2007-09-14 Thread Daniel Baughman
Kris, Dan,

Thanks for feedback. I'm understanding that the javaloader.cfc and the
classloader .jar should be in the working directory of the script, right?

I have classloader-20070406174551.jar, JavaLoader.cfc, and
metadata-extractor-2.3.1.jar all in the same directory as the script and I'm
using the following code to use them:

 photoFile = createObject(java,java.io.File).init(photo);
 //set the path
 paths = ArrayNew(1);
 paths[1] = expandPath(metadata-extractor-2.3.1.jar);
 //create the loader
 loader = createObject(component, JavaLoader).init(paths);
 //create the JpegMetadataReader instace 
 JpegMetadataReader =
loader.create(com.drew.imaging.jpeg.JpegMetadataReader);
 //Read jpg file
 JpegMetadata = JpegMetadataReader.readMetadata(photoFile);
 //get directory iterator
 JpegDirectories = jpegMetadata.getDirectoryIterator();
 
Does the classloader jar need to be in the lib/ext dirs or soemthing? I've
tried a few different things on two different servers.

Regards,
 

-Original Message-
From: Mark Mandel [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 13, 2007 4:00 PM
To: CF-Talk
Subject: Re: java classloader


Dan -

You shouldn't move the JavaLoader .jar files around, they should stay in the
way they were originally downloaded in.

Mark

On 9/14/07, Kris Jones [EMAIL PROTECTED] wrote:
 Did the java classpath on the machine change?

  I'm using the javaclass loader to load a meta-data reader for some
jpegs.
  It seems no matter where I put the .jar for the class loader I get 
  the following exception:
 
  message: com.compoundtheory.classloader.NetworkClassLoader
  type: java.lang.ClassNotFoundException
 
  I am trying to do it like this page describes:
  http://www.leavethatthingalone.com/blog/index.cfm/2006/5/16/Using-Co
  ldFusion -to-Read-EXIF-Information-from-JPEGs
 
  the line throwing the exception:
  networkClassLoaderClass =
  getServerURLClassLoader().loadClass(com.compoundtheory.classloader.
  NetworkC
  lassLoader);
 
  I have the classloader-20070406174551.jar in the same directory as 
  the script.  Whats really wierd is this was working and stopped!  
  I'm banging my head against the desk on this one...

 



~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288480
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: java classloader

2007-09-14 Thread Mark Mandel
Dan -

You shouldn't be messing around with the structure of the cfc's and
the .jar files for JavaLoader.

This is why it isn't working for you.

The best option is to put Javaloader in your web root, and invoke it
as per normal.

Mark

On 9/15/07, Daniel Baughman [EMAIL PROTECTED] wrote:
 Kris, Dan,

 Thanks for feedback. I'm understanding that the javaloader.cfc and the
 classloader .jar should be in the working directory of the script, right?

 I have classloader-20070406174551.jar, JavaLoader.cfc, and
 metadata-extractor-2.3.1.jar all in the same directory as the script and I'm
 using the following code to use them:

  photoFile = createObject(java,java.io.File).init(photo);
  //set the path
  paths = ArrayNew(1);
  paths[1] = expandPath(metadata-extractor-2.3.1.jar);
  //create the loader
  loader = createObject(component, JavaLoader).init(paths);
  //create the JpegMetadataReader instace
  JpegMetadataReader =
 loader.create(com.drew.imaging.jpeg.JpegMetadataReader);
  //Read jpg file
  JpegMetadata = JpegMetadataReader.readMetadata(photoFile);
  //get directory iterator
  JpegDirectories = jpegMetadata.getDirectoryIterator();

 Does the classloader jar need to be in the lib/ext dirs or soemthing? I've
 tried a few different things on two different servers.

 Regards,


 -Original Message-
 From: Mark Mandel [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 13, 2007 4:00 PM
 To: CF-Talk
 Subject: Re: java classloader


 Dan -

 You shouldn't move the JavaLoader .jar files around, they should stay in the
 way they were originally downloaded in.

 Mark

 On 9/14/07, Kris Jones [EMAIL PROTECTED] wrote:
  Did the java classpath on the machine change?
 
   I'm using the javaclass loader to load a meta-data reader for some
 jpegs.
   It seems no matter where I put the .jar for the class loader I get
   the following exception:
  
   message: com.compoundtheory.classloader.NetworkClassLoader
   type: java.lang.ClassNotFoundException
  
   I am trying to do it like this page describes:
   http://www.leavethatthingalone.com/blog/index.cfm/2006/5/16/Using-Co
   ldFusion -to-Read-EXIF-Information-from-JPEGs
  
   the line throwing the exception:
   networkClassLoaderClass =
   getServerURLClassLoader().loadClass(com.compoundtheory.classloader.
   NetworkC
   lassLoader);
  
   I have the classloader-20070406174551.jar in the same directory as
   the script.  Whats really wierd is this was working and stopped!
   I'm banging my head against the desk on this one...
 
 



 

~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288517
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: java classloader

2007-09-13 Thread Kris Jones
Did the java classpath on the machine change?

 I'm using the javaclass loader to load a meta-data reader for some jpegs.
 It seems no matter where I put the .jar for the class loader I get the
 following exception:

 message: com.compoundtheory.classloader.NetworkClassLoader
 type: java.lang.ClassNotFoundException

 I am trying to do it like this page describes:
 http://www.leavethatthingalone.com/blog/index.cfm/2006/5/16/Using-ColdFusion
 -to-Read-EXIF-Information-from-JPEGs

 the line throwing the exception:
 networkClassLoaderClass =
 getServerURLClassLoader().loadClass(com.compoundtheory.classloader.NetworkC
 lassLoader);

 I have the classloader-20070406174551.jar in the same directory as the
 script.  Whats really wierd is this was working and stopped!  I'm banging my
 head against the desk on this one...

~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288382
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: java classloader

2007-09-13 Thread Mark Mandel
Dan -

You shouldn't move the JavaLoader .jar files around, they should stay
in the way they were originally downloaded in.

Mark

On 9/14/07, Kris Jones [EMAIL PROTECTED] wrote:
 Did the java classpath on the machine change?

  I'm using the javaclass loader to load a meta-data reader for some jpegs.
  It seems no matter where I put the .jar for the class loader I get the
  following exception:
 
  message: com.compoundtheory.classloader.NetworkClassLoader
  type: java.lang.ClassNotFoundException
 
  I am trying to do it like this page describes:
  http://www.leavethatthingalone.com/blog/index.cfm/2006/5/16/Using-ColdFusion
  -to-Read-EXIF-Information-from-JPEGs
 
  the line throwing the exception:
  networkClassLoaderClass =
  getServerURLClassLoader().loadClass(com.compoundtheory.classloader.NetworkC
  lassLoader);
 
  I have the classloader-20070406174551.jar in the same directory as the
  script.  Whats really wierd is this was working and stopped!  I'm banging my
  head against the desk on this one...

 

~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288426
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Java ClassLoader / JavaLoader.cfc Question

2006-10-04 Thread Matthew Lesko
Going to try Dan's suggestion. If that still doesn't work I will post some 
code. 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255385
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Java ClassLoader / JavaLoader.cfc Question

2006-10-04 Thread Dan Plesse
It's the only logical solution. I think my code is out there on the net and
it might have cost me some
dollars because the problem had to do with JDBC drivers and I am assuming
the other classloaders still can't do JDBC but maybe they can do it now,
darn.

Wishlist for CF 8: A way report a JDBC connection socket error while inside
a CFML page.  Right
now the only way to do that via the Admin.



On 10/4/06, Matthew Lesko [EMAIL PROTECTED] wrote:

 Going to try Dan's suggestion. If that still doesn't work I will post some
 code.

 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255462
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Java ClassLoader / JavaLoader.cfc Question

2006-10-04 Thread Dan Plesse
I retest of javaloader version 2

HelloWorld = loader.create(org.hsqldb.jdbcDriver);
hello = HelloWorld.init();

loads fine and I can see the object but

class = createObject(java, java.lang.Class).forName(
org.hsqldb.jdbcDriver);

still blows up

 class = createObject(java, java.lang.Class);
 class.forName(org.hsqldb.jdbcDriver);

still blows up!

Good I am still safe.


~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255474
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Java ClassLoader / JavaLoader.cfc Question

2006-10-03 Thread Dan Plesse
It could be the order in which you loaded everything. You have to load the
jars first then the classes.

The second issue could be the level or depth of the classloader might be too
shallow.


~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255299
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Java ClassLoader / JavaLoader.cfc Question

2006-10-03 Thread Mark Mandel
Without the error, and/or some sort of testbed to look at, it becomes
hard to debug.

Regards,

Mark

On 10/4/06, Dan Plesse [EMAIL PROTECTED] wrote:
 It could be the order in which you loaded everything. You have to load the
 jars first then the classes.

 The second issue could be the level or depth of the classloader might be too
 shallow.


 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255304
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4