RE: java classloader
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
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
java classloader
Oh man I'm missing something here.. 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... Suggestions welcomed.. Dan ~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288371 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
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: SPAM - java classloader
you tried putting the jar in your lib directory and cycling that instance? ~Simon Simon Horwith Adobe Community Expert Adobe Certified Master Instructor http://www.horwith.com Daniel Baughman wrote: Oh man I'm missing something here.. 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... Suggestions welcomed.. Dan ~| 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:288388 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
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
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
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
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
Java ClassLoader / JavaLoader.cfc Question
Was wondering if anyone had worked with JavaLoader.cfc (see: www.compoundtheory.com) or the Java ClassLoaders in general. I am working with Apache Lucene and Coldfusion. I've written some Java classes that extend some of Lucene's. When I try to load my classes with JavaLoader.cfc I get an error back around an abstract class in Lucene. If I put everything in the Coldfusion classpath it works fine. I've tried changing up the parent ClassLoader to no avail. Anyone work through this sort of issue? Regards, Matthew Lesko ~| 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:255268 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
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
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
CFCProxy and Java Classloader
I've had this conversation with a member of the community for a few days and it's been going in a circle without resolve. Here's the issue. The CFCProxy documentation says that To call a CFC, you need to be within the ColdFusion web application. This means that ColdFusion's classloader must be the current classloader. When I asked how does one start a class with CF's classloader as the current classloader, the answer was that the Java Class has to be loaded with the same J2EE context. So I then asked how does one load a class with the same J2EE context as ColdFusion. Bottom line from all this is that my understanding is that you can only use CFCProxy in a Java class that is called from ColdFusion. This seems a waste to me as your using CF to call a Java class that will in turn call a CFC. I hope I'm wrong. I hope there's a way to call a java class making use of a CFCProxy from outside of CF. That would be both super cool and useful as hell. Can anyone comment on this? Can a java class be called with CF's classloader without it being called from within CF? ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219844 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54