Setting License with Coldfusion

Last post 03-04-2010, 11:59 AM by mweisert. 23 replies.
Page 1 of 2 (24 items)   1 2 Next >
Sort Posts: Previous Next
  •  02-02-2010, 7:26 PM 220362

    Setting License with Coldfusion Java

    Hello,

    I am trying to set our purchased license into the code to eliminate the watermark.  We are using ColdFusion. 

    I tried this:
        <cfset license=CreateObject("java", "com.aspose.cells.lic").init()>
        <cfset setLicense = license.setLicense("Aspose.Cells.lic")>

    but no luck.  I've placed the license file in the C:/ColdFusion8/wwwroot/WEB-INF/lib directory alongside the .jar files.  Where am I going wrong?

    Thanks,
    Mike
    Filed under: Coldfusion
     
  •  02-03-2010, 4:59 AM 220456 in reply to 220362

    Re: Setting License with Coldfusion

    Hi,


    The path to load License file is to use file path, not classpath. So, please put the license file at any place your application could access it fine and give the correct path for license.setLicense() method. When you simply input the path as "Aspose.Cells.lic", the path in fact should be relative to your web application's root folder, not the WEB-INF/lib and so the license file cannot be found.

     

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  02-04-2010, 11:27 AM 220793 in reply to 220456

    Re: Setting License with Coldfusion

    Hi Amjad,

    I moved the .lic file to the root of the website.  I tried:
    <cfset license=CreateObject("java", "com.aspose.cells.lic").init()>
        <cfset setLicense = license.setLicense("Aspose.Cells.lic")>

    and

    <cfset license=CreateObject("java", "com.aspose.cells.lic").init()>
        <cfset setLicense = license.setLicense("/Aspose.Cells.lic")>

    But still getting errors  (Class not found: com.aspose.cells.lic ) .  Thanks for your help.

    Mike
     
  •  02-04-2010, 11:43 AM 220798 in reply to 220793

    Re: Setting License with Coldfusion

    Hi,

    Please change the line:
    <cfset license=CreateObject("java", "com.aspose.cells.lic").init()>

    to:

    <cfset license=CreateObject("java", "com.aspose.cells.License").init()>
    as the class name is License and not lic.


    Thank you.

    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  02-04-2010, 11:51 AM 220799 in reply to 220798

    Re: Setting License with Coldfusion

    Hi,

    I now get: 'The setLicense Method was not found'

    With:

        <cfset license=CreateObject("java", "com.aspose.cells.License").init()>
        <cfset setLicense = license.setLicense("Aspose.Cells.lic")>

    Thanks,
    Mike
     
  •  02-04-2010, 2:15 PM 220819 in reply to 220799

    Re: Setting License with Coldfusion

    Hi Mike,

     

    Thank you for considering Aspose.

     

    Please try the following code to set your license in cold fusion:

     

    <cfobject action="create" type="java" class="java.io.FileInputStream" name="LicFile">  

    <cfset LicfileI = LicFile.init(JavaCast("string","Aspose.Cells.lic"))>

    <cfobject action="create" type="java" class="com.aspose.cells.License" name="license">

     

    If you still face any problem, try using the complete license file path e.g. C:\ColdFusion9\Aspose.Cells.lic

     

    Thank You & Best Regards,


    Nausherwan Aslam
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  02-04-2010, 2:32 PM 220826 in reply to 220819

    Re: Setting License with Coldfusion

    I don't get an error with this:
        <cfobject action="create" type="java" class="java.io.FileInputStream" name="LicFile">  
        <cfset LicfileI = LicFile.init(JavaCast("string","D:\Inetpub\wwwroot\Intranet\Aspose.Cells.lic"))>
        <cfobject action="create" type="java" class="com.aspose.cells.License" name="license">

       
        <cfset workbook=CreateObject("java", "com.aspose.cells.Workbook").init()>
        <cfset worksheets = workbook.getWorksheets()>
        <cfset sheet= worksheets.getSheet("Sheet1")>
        <cfset cells= sheet.getCells()>
        <cfset cell= cells.getCell(0,0)>
        <cfset cell.setValue("Hello World!")>
        <cfset workbook.save("D:\Inetpub\wwwroot\Intranet\testtwg\sales_reports\engr\temp\out2.xls")>

    But -

    The result xls file still has a tab talking about it being an evaluation copy.  We purchased in Aug. 09 - I have the PO number if you need it.

    Am I still missing something?

    Thanks,
    Mike

     
  •  02-05-2010, 3:28 AM 220902 in reply to 220826

    Re: Setting License with Coldfusion

    Hi Mike,

     

    Thank you for considering Aspose.

     

    Please update your code as below.

     

    <cfobject action="create" type="java" class="java.io.FileInputStream" name="LicFile">  

    <cfset LicfileI = LicFile.init(JavaCast("string","D:\Inetpub\wwwroot\Intranet\Aspose.Cells.lic"))>

    <cfobject action="create" type="java" class="com.aspose.cells.License" name="license">

    <cfset license.setLicense(LicfileI)>

     

    <cfset workbook=CreateObject("java", "com.aspose.cells.Workbook").init()>

    <cfset worksheets = workbook.getWorksheets()>

    <cfset sheet= worksheets.getSheet("Sheet1")>

    <cfset cells= sheet.getCells()>

    <cfset cell= cells.getCell(0,0)>

    <cfset cell.setValue("Hello World!")>

    <cfset workbook.save("D:\Inetpub\wwwroot\Intranet\testtwg\sales_reports\engr\temp\out2.xls")>

     

    Thank You & Best Regards,


    Nausherwan Aslam
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  02-08-2010, 2:01 PM 221286 in reply to 220902

    Re: Setting License with Coldfusion

    Hello,

    I get an error reading:
    'Error when parse license stream'  line 8  which is

    <cfset license.setLicense(LicfileI)>


    Thanks,

    Mike

     
  •  02-09-2010, 7:58 AM 221440 in reply to 221286

    Re: Setting License with Coldfusion

    Hi Mike,

     

    Thank you for considering Aspose.

     

    Well, I checked the code (shared in my previous post) and it works fine. Please send us your license file via email and we will check it soon. Please follow the steps mentioned in the below link to send us the license file (please don’t post your license file in the forum).

     

    http://www.aspose.com/corporate/purchase/faqs/send-license-to-aspose-staff.aspx

     

    Thank You & Best Regards,


    Nausherwan Aslam
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  02-09-2010, 12:23 PM 221484 in reply to 221286

    Re: Setting License with Coldfusion

    Hi,

     

    Thank you for considering Aspose.

     

    We have received your file via email. I checked your issue with you license file and still I am not able to reproduce the issue you mentioned. Please share the complete sample code, your system environment like OS, Cold Fusion version, Aspose.Cells version etc. This will help us figure out the issue soon.

     

    Thank You & Best Regards,


    Nausherwan Aslam
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  02-09-2010, 2:47 PM 221511 in reply to 221484

    Re: Setting License with Coldfusion

    Here is the complete code:

    <html>
    <head><title>Hello World!</title></head>
    <body>
        <b>This example shows how to create a simple MS Excel Workbook using Aspose.Cells</b>
    <cfobject action="create" type="java" class="java.io.FileInputStream" name="LicFile"> 

    <cfset LicfileI = LicFile.init(JavaCast("string","D:\Inetpub\wwwroot\Intranet\Aspose.Cells.lic"))>

    <cfobject action="create" type="java" class="com.aspose.cells.License" name="license">

    <cfset license.setLicense(LicfileI)>

     

    <cfset workbook=CreateObject("java", "com.aspose.cells.Workbook").init()>

    <cfset worksheets = workbook.getWorksheets()>

    <cfset sheet= worksheets.getSheet("Sheet1")>

    <cfset cells= sheet.getCells()>

    <cfset cell= cells.getCell(0,0)>

    <cfset cell.setValue("Hello World!")>

    <cfset workbook.save("D:\Inetpub\wwwroot\Intranet\testtwg\sales_reports\engr\temp\out2.xls")>

    <a href="temp/out2.xls">Download</a>

    <!--- Tell the browser to expect an Excel file attachment.
    <cfheader
        name="content-disposition"
        value="attachment; filename=out.xls"
        />
       
    <!---
        Tell browser the length of the byte array output stream.
        This will help the browser provide download duration to
        the user.
    --->
    <cfheader
        name="content-length"
        value="#REQUEST.ExcelData.Size()#"
        />

    <!--- Stream the binary data to the user. --->
    <cfcontent
        type="application/excel"
        variable="#REQUEST.ExcelData.ToByteArray()#"
        />

    --->


    </body>
    </html>

    The OS is Windows Server 2003,
    ColdFusion version 8.0
    - ColdFusion is installed on the C drive, however, it loads InetPub on the D.  Cells is working without the license (just getting the register notification).
    Aspose.Cells (I believe I have installed JDK 1.4).  Let me know if I need to install JDK 5.0 instead.
     
  •  02-10-2010, 1:59 PM 221739 in reply to 221511

    Re: Setting License with Coldfusion

    Hi,

    Thank you for sharing the details.

    We will look into your issue and get back to you soon.

    Thank You & Best Regards,


    Nausherwan Aslam
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  02-16-2010, 6:00 PM 222569 in reply to 221739

    Re: Setting License with Coldfusion

    Hello -

    I typed in Java - version to terminal and I am apparently running 1.6.0_17-b04 
    Is this the issue?

    Thanks,
    Mike
     
  •  02-18-2010, 12:39 AM 222784 in reply to 222569

    Re: Setting License with Coldfusion

    Hi Mike,

     

    I ran your exact code with your license file and it works absolutely fine. My system environment is Windows XP, ColdFusion 9, and JDK 5.0. Please make sure you are using the jar file in JDK 5.0 folder in your installation path. Also, share the complete exception stack trace (which may help us in finding the issue). We will also try to create same system environment as yours to try and figure out the issue.

     

    Thank you for your constant support in figuring out the issue,


    Nausherwan Aslam
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
Page 1 of 2 (24 items)   1 2 Next >
View as RSS news feed in XML