Thanks that helped, book marked that web page.
Sorry, this is the first time I have tried to use jar files.
Only other is for <CFX>.
The error messages being generated don't help much.
Object Instantiation Exception.
An exception occurred when instantiating a java object. The cause of this
exception was that: .
For this line of code:
<cfset pngpath = "e:\temp\tempimage.png">
<cfset pngfile = expandpath(pngpath)>
<!---error is for this line---><cfset ostream = createObject("java",
"java.io.FileOutputStream").init(pngFile) />
If I remove "e:\temp\" , it works, but does that mean I can't tell it to
place the image in any other dir, besides the current one?
When I do remove the dir and get past that error I get:
500 org/apache/batik/dom/svg/ExtensibleSVGDOMImplementation
org/apache/batik/dom/svg/ExtensibleSVGDOMImplementation
For:
<cfset MakeImage.transcode(input, output) />
Full code on the page(mostly adapted from http://barneyb.com/barneyblog):
<cfobject action="create" type="java"
class="org.apache.batik.transcoder.image.PNGTranscoder" name="MakeImage">
<cfset svgPath = "e:\temp\newxml.svg" />
<cfset pngPath = "newxml.png" />
<cfset svgFile = expandPath(svgPath) />
<cfset pngFile = expandPath(pngPath) />
<cfset svgURI = createObject("java",
"java.io.File").init(svgFile).toURL().toString() />
<cfset input = createObject("java",
"org.apache.batik.transcoder.TranscoderInput").init(svgURI) />
<cfset ostream = createObject("java",
"java.io.FileOutputStream").init(pngFile) />
<cfset output = createObject("java",
"org.apache.batik.transcoder.TranscoderOutput").init(ostream) />
<cfset MakeImage.transcode(input, output) />
<cfset ostream.flush() />
<cfset ostream.close() />
Going to google and see if I can work this out.
Thanks for your help
Rodney
-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 08, 2007 1:28 PM
To: CF-Talk
Subject: Re: Using .jar file with <cfobject>
As noted, this still won't work You are still trying to call a jar directly.
A jar *contains* class files you need to use the api
http://www.stylusstudio.com/api/batik/overview-summary.htm
I.e calling them via com.batik.whatever
"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540. It contains information which is
confidential and may also be privileged. It is for the exclusive use of the
intended recipient(s). If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful. If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910. The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions."
Visit our website at http://www.reedexpo.com
-----Original Message-----
From: Bruce, Rodney S C-E LCMC HQISEC/Signal Solutions
To: CF-Talk
Sent: Tue May 08 21:17:12 2007
Subject: RE: Using .jar file with <cfobject>
No.
I am trying to convert svg files to images.
I found batik and am trying to get it to work, I found:
http://barneyb.com/barneyblog/index.php?s=batik&searchsubmit=Go
Following those instructions don't seem to work either, with that code I
get:
Object Instantiation Exception.
An exception occurred when instantiating a java object. The cause of this
exception was that: .
I can get the examples on Batik's website to run from the cmd window, with
my svg files.
I have tried:
<cfobject action="create" type="java" class="batik-rasterizer.jar"
name="myobj"> <cfobject action="create" type="java" class="rasterizer.jar"
name="myobj">
Thanks
Rodney
-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 08, 2007 12:17 PM
To: CF-Talk
Subject: Re: Using .jar file with <cfobject>
A jar isn't a class file itself. Do you know what class you want to
instantiate?
"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540. It contains information which is
confidential and may also be privileged. It is for the exclusive use of the
intended recipient(s). If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful. If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910. The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions."
Visit our website at http://www.reedexpo.com
-----Original Message-----
From: Bruce, Rodney S C-E LCMC HQISEC/Signal Solutions
To: CF-Talk
Sent: Tue May 08 20:15:41 2007
Subject: Using .jar file with <cfobject>
Hi
I am trying to get a .jar file to work with <cfobject>
I placed the file in a dir: d:\java\myjar.jar.
I put the dir in the class path in the Coldfusion administrator.
Stopped/started the service.
Tried:
<cfobject action="create" type="java" class="myjar.jar"
name="myobj">
when I run the page I get the error:
Object Instantiation Exception.
Class not found: myjar.jar
Verified my spelling of the dir in the class path.
In Coldfusion administrator I looked at System Information and can
see d:\java\myjar.jar in the Java class path listing.
In the cmd window I can go to the dir and run java -jar myjar.jar
and it runs.
What am I missing to get this to work?
Thanks
Rodney
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2.
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:277359
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4