Thanks for your help everyone. I think I will be okay now.

On 4/18/07, Russ <[EMAIL PROTECTED]> wrote:
>
> Might want to make it public class instead of class... It could also use a
> constructor (or make the method static).
>
> Russ
>
>
>
> > -----Original Message-----
> > From: Wesley Middendorff [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, April 18, 2007 5:08 PM
> > To: CF-Talk
> > Subject: Re: CreateObject() with java
> >
> > That helps a little, I am now getting some other error that is not so
> > helpfull...
> >
> >
> > ....
> >    Object Instantiation Exception.  An exception occurred when
> > instantiating
> > a java object. The cause of this exception was that: YP_Unzip (wrong
> name:
> > YP_UnZip).
> >
> >
> > This shouldn't be so difficult.
> >
> >
> >
> > On 4/18/07, Gaulin, Mark <[EMAIL PROTECTED]> wrote:
> > >
> > > Java classpaths sound not actually contain ".class" files (although
> > > ".jar" files are included in classpaths).
> > >
> > > Assuming your java class in not in a "package" (which is a Bad idea,
> but
> > > looks to be the case from your java code), then you need to include in
> > > the classpath the directory containing your .class file.  A sort of
> > > "best practice" would be to create a directory somewhere called
> > > "classes" and then to put your .class files in there, and add that dir
> > > to the classpath.  If your java classes are in a package (again, a
> good
> > > idea, like maybe "com.wmiddeendorf"), then your .class files go unto
> > > appropriate subdirs under "classes" (like "classes/com/wmiddeendorf").
> > >
> > > Hope that helps.
> > >
> > >        Mark
> > >
> > > -----Original Message-----
> > > From: Wes Middendorff [mailto:[EMAIL PROTECTED]
> > > Sent: Wednesday, April 18, 2007 4:32 PM
> > > To: CF-Talk
> > > Subject: CreateObject() with java
> > >
> > > I have a totally newb problem. I have a written a java class to unzip
> > > files (which works JRUN's jre), but I am trying to use it with
> > > coldfusion and am unable to get coldfusion to even recognize that it
> is
> > > there. I have set up the classpath in administrator and ensured
> several
> > > times that the path is correct. The contents of the classpath field in
> > > CFAdmin is:
> > > C:\CFusionMX7\runtime\jre\lib\YP_Unzip.class
> > >
> > > I am sure I have to have something configured incorrectly.
> > >
> > > here is my code (though I am not sure that this is the problem):
> > >
> > > COLDFUSION:
> > >
> > > <cfset temp = createObject("java", "YP_Unzip")>
> > >
> > > JAVA:
> > >
> > > import java.io.*;
> > > import java.util.zip.*;
> > >
> > >
> > > class YP_UnZip {
> > >        public void Unzip (String Args[]){
> > >
> > >        int BUFFER = 2048;
> > >   int i;
> > >        BufferedOutputStream dest = null;
> > >        FileInputStream inputfile;
> > >        ZipInputStream  zipfile;
> > >
> > >
> > >    if (Args.length != 0){
> > >
> > >                //loop over files to be unzipped
> > >                for(i=0; i <Args.length; i++){
> > >                System.out.print("Unzipping : ");
> > >                System.out.print(Args[i]);
> > >                System.out.println();
> > >
> > >                try{
> > >
> > >                        inputfile = new FileInputStream(Args[i]);
> > >                        zipfile = new ZipInputStream(new
> > > BufferedInputStream(inputfile));
> > >                        ZipEntry entry;
> > >
> > >                        while ((entry = zipfile.getNextEntry()) !=
> > > null){
> > >                        System.out.println("Extracting : "+entry);
> > >
> > >                        int count;
> > >                        byte data[] = new byte[BUFFER];
> > >
> > >                        //write the back to disk
> > >                        FileOutputStream outputfile = new
> > > FileOutputStream(entry.getName());
> > >
> > >                        dest = new BufferedOutputStream(outputfile,
> > > BUFFER);
> > >                        while ((count = zipfile.read(data, 0, BUFFER))
> > > != -1) {
> > >                          dest.write(data, 0, count);
> > >                         }
> > >
> > >                        dest.flush();
> > >                        dest.close();
> > >
> > >
> > >                        }
> > >                 }
> > >                catch(Exception e){
> > >                  e.printStackTrace();
> > >                 }//end try-catch block
> > >
> > >                }       //end for loop
> > >
> > >         }//end if (Args.length != 0)
> > >         else{
> > >           //code for error handling goes here - error missing file
> > >         }
> > >
> > > }//main
> > >
> > > }
> > >
> > >
> > >
> > > Any help would be greatly appreciated.
> > >
> > > Thanks,
> > > Wes
> > >
> > >
> > >
> > >
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV

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

Reply via email to