Re: Converting simple Java code to CF

2007-11-19 Thread Jide Aliu
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

RE: Converting simple Java code to CF

2007-11-17 Thread Jaime Metcher
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,

Re: Converting simple Java code to CF

2007-11-17 Thread Janet MacKay
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

Re: Converting simple Java code to CF

2007-11-16 Thread Janet MacKay
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))

Re: Converting simple Java code to CF

2007-11-16 Thread Jide Aliu
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.

Re: Converting simple Java code to CF

2007-11-16 Thread Janet MacKay
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,

Re: Converting simple Java code to CF

2007-11-16 Thread Jide Aliu
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:

Re: Converting simple Java code to CF

2007-11-16 Thread Jide Aliu
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

Re: Converting simple Java code to CF

2007-11-16 Thread Janet MacKay
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,

Re: Converting simple Java code to CF

2007-11-16 Thread Jide Aliu
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,

Re: Converting simple Java code to CF

2007-11-16 Thread Janet MacKay
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

Re: Converting simple Java code to CF

2007-11-16 Thread Jide Aliu
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 =

Re: Converting simple Java code to CF

2007-11-16 Thread Janet MacKay
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,

Re: Converting simple Java code to CF

2007-11-16 Thread Janet MacKay
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,

Re: Converting simple Java code to CF

2007-11-16 Thread Janet MacKay
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,

Re: Converting simple Java code to CF

2007-11-16 Thread Jide Aliu
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

Re: Converting simple Java code to CF

2007-11-16 Thread Jide Aliu
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

Re: Converting simple Java code to CF

2007-11-16 Thread Janet MacKay
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