ie. without the must not be abstract or interface part. Or perhaps
I'm confusing it with a legitimate must not be abstract ...
exception ;-)
Hi guys, you were right Janet, FileInputStream is concrete. The reason why it
was throwing the error is because the File I was accessing had null
That error is a totally non-specific object instantiation error. That third
sentence (...must not be an interface...) is just a stab in the dark by some
engineer trying to be helpful. Look down the full stack trace to find out
what the real error is.
Jaime Metcher
That looks very promising,
That error is a totally non-specific object instantiation error. That third
sentence (...must not be an interface...) is just a stab in the dark by some
engineer trying to be helpful. Look down the full stack trace to find out
what the real error is.
Jaime,
That wouldn't surprise me, but I
If this is a Java
object and you verified that the method exists, you may need to use
the javacast function to reduce ambiguity.
Did you try what was suggested ;)? ie using javacast
!--- change the java type if needed ---
cfset Slide = pres1.getSlideByPosition(javacast(int, 5))
Did you try what was suggested ;)? ie using javacast
!--- change the java type if needed ---
cfset Slide = pres1.getSlideByPosition(javacast(int, 5))
Thanks Janet, forgot to put that in, yes I did, I used javacast but the error
remained the same.
Yep the method name is there oh so frustrating, it shows like so below:
I see the problem. You haven't actually created a
com.aspose.slides.Presentation object. What you've created is a
FileOutputStream object. That's why the method isn't found.
cfset pres1 =CreateObject(java,
If you look the API for the getSlideByPosition(), what type of
value(s) does it expect and is the method public or
protected/private?
It expects an int valuethe method is public, see below:
public Slide getSlideByPosition(int position)Returns the slide by
SlidePosition.
Parameters:
It expects an int value the method is public, see below:
Yes, that looks right. If you cfdump an instance of the object do you
see that method name?
Yep the method name is there oh so frustrating, it shows like so below:
METHOD
getSlideByPosition(int)
RETURN TYPE
com.aspose.slides.Slide
That looks very promising, it coming up with a different error now:
That's weird. FileInputStream is concrete and from the java code Presentation
should be concrete too.
Do you get a different error if you break it out into separate lines?
cfset fis = CreateObject(java,
Try something along the lines of this
!--- Create the objects and initialize ---
cfset fis = CreateObject(java, java.io.FileInputStream)
cfset pres1 = CreateObject(java, com.aspose.slides.Presentation).init(
fis.init(c:\test\destination.ppt))
cfset pres2 = CreateObject(java,
seems setting it up like so
have solved the problem.
cfset pres2 =CreateObject(java, java.io.FileInputStream).
init(c:\test\destination.ppt)
That still looks off to me. Since you can access getSlideByPosition() I think
you fixed pres1 but not pres2. Then again it might just be my brain
That's weird. FileInputStream is concrete and from the java code
Presentation should be concrete too.
Do you get a different error if you break it out into separate lines?
cfset fis = CreateObject(java, java.io.FileInputStream).
init(c:\test\destination.ppt)
cfset pres1 =
Isn't that what the first line of the code is doing? cfobject
action=create type=java class=com.aspose.slides.Presentation
name=pres1
Yes and no. You're creating the object, but then overwriting it a few lines
later with a FileOutputStream object
cfset pres1 = CreateObject(java,
It expects an int value the method is public, see below:
Yes, that looks right. If you cfdump an instance of the object do you see that
method name?
~|
Download the latest ColdFusion 8 utilities including Report Builder,
Try something along the lines of this
!--- Create the objects and initialize ---
cfset fis = CreateObject(java, java.io.FileInputStream)
cfset pres1 = CreateObject(java, com.aspose.slides.Presentation).init(
fis.init(c:\test\destination.ppt))
cfset pres2 = CreateObject(java,
seems setting it up like so
have solved the problem.
cfset pres2 =CreateObject(java, java.io.FileInputStream).
init(c:\test\destination.ppt)
That still looks off to me. Since you can access getSlideByPosition()
I think you fixed pres1 but not pres2. Then again it might just
be
I see the problem. You haven't actually created a com.aspose.slides.
Presentation object. What you've created is a FileOutputStream object.
That's why the method isn't found.
cfset pres1 =CreateObject(java, java.io.FileOutputStream).
init(c:\test\source.ppt)
Isn't that what the first
If you look the API for the getSlideByPosition(), what type of value(s) does it
expect and is the method public or protected/private?
~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active
18 matches
Mail list logo