Free Support Forum - aspose.com

Aspose.total word license problem

I’ve the latest version from aspose.words for java (1.0.4.0) and a aspose.total license (been send yesterday).
Still I get this error when executing the code:


Exception

org.apache.jasper.JasperException: The license is not valid for this product. For free technical support, please post this error and the file in the Aspose.Words Forums http://www.aspose.com/forums/ShowForum.aspx?ForumID=75.
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)

root cause

com.aspose.words.PleaseReportException: The license is not valid for this product. For free technical support, please post this error and the file in the Aspose.Words Forums http://www.aspose.com/forums/ShowForum.aspx?ForumID=75.
com.aspose.words.do.a(Unknown Source)
com.aspose.words.License.setLicense(Unknown Source)
org.apache.jsp.asposeTest_jsp._jspService(asposeTest_jsp.java:68)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)

We need some additional info from you. Please describe where you have put the license file, where the license activation code resides and also please post your license activation code snippet here. I need to check if everything was done correctly.

Best regards,

I’d like to add that aspose.cells works fine.


<%@page contentType=“text/html”%>
<%@page pageEncoding=“UTF-8”%>

<%@ page import=“java.io., com.aspose.words. , java.awt.* " %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
http://www.w3.org/TR/html4/loose.dtd”>




Aspose test



<%

//licensing
License license = new License();
FileInputStream inputStream = null;
try {
inputStream = new FileInputStream(“C:\temp\Aspose.Total.lic”);
license.setLicense(inputStream);
}
finally {
if(inputStream != null)
inputStream.close();
}



//Creating an Workbook object
/***** cells part, works! *******
Workbook workbook = new Workbook();

//Calling Open method of Workbook object to open an Excel file using its file path
workbook.open(“C:\temp\asposetest.xls”);

Worksheet ws = workbook.getSheet(0);
Cell cell_1 = ws.getCell(0,0);
Cell cell_2 = ws.getCell(0,1);
String waarde1 = cell_1.getValue().toString();
String waarde2 = cell_2.getValue().toString();

//Setting the orientation to Portrait
PageSetup pageSetup = ws.getPageSetup();
pageSetup.setOrientation(PageOrientationType.LANDSCAPE);

cell_1.setValue(“veranderd”);

workbook.save(“C:\temp\asposetest_landscape.xls”);

*********** end cells part * /


// *******part from documentbuilder demo:
//Open the template document
Document doc = new Document();

//Once the builder is created, its cursor is positioned at the beginning of the document.
DocumentBuilder builder = new DocumentBuilder(doc);

//Specify font formatting before adding text.
builder.getFont().setSize(16);
builder.getFont().setBold(true);
builder.getFont().setColor(Color.BLUE);
builder.getFont().setName(“Arial”);
builder.setUnderline(Underline.DASH);
builder.write(“This text”);
builder.setUnderline(Underline.NONE);
builder.write(” is inserted at the beginning of the document and demonstrates “);

//Set shading and border around a run of text, then clear the border.
builder.getFont().getShading().setForegroundPatternColor(Color.CYAN);
builder.getFont().getShading().setTexture(TextureIndex.TEXTURE_SOLID);
builder.write(“various font”);
builder.getFont().getShading().clearFormatting();
builder.getFont().getBorder().setLineStyle(LineStyle.SINGLE);
builder.write(” formatting ");
builder.getFont().getBorder().clearFormatting();
builder.writeln(“options.”);
builder.insertParagraph();

//Move the insertion cursor to a merge field.
builder.moveToMergeField(“MyInsertionPlace1”);

//Specify paragraph formatting before calling InsertParagraph or Writeln.
builder.getParagraphFormat().getBorders().get(BorderType.TOP).setLineStyle(LineStyle.DOUBLE);
builder.getParagraphFormat().getBorders().get(BorderType.TOP).setLineWidth(2);
builder.getParagraphFormat().setAlignment(ParagraphAlignment.CENTER);
builder.getParagraphFormat().getShading().setForegroundPatternColor(new Color(240, 255, 255));
builder.getParagraphFormat().getShading().setTexture(TextureIndex.TEXTURE_SOLID);
builder.getParagraphFormat().setLeftIndent(2 * 72); //2 inchdes by 72 points.
builder.getParagraphFormat().setSpaceBefore(12);
builder.getParagraphFormat().setSpaceAfter(12);
builder.getFont().setName(“Arial”);
builder.getFont().setSize(12);
builder.write("This fragment demonstrates use of paragraph formatting to specify ");
builder.writeln(“alignment, spacing, borders and shading.”);
builder.getParagraphFormat().clearFormatting();

//Insert another section and demonstrate page setup properties.
builder.getFont().setSize(12);
builder.insertBreak(BreakType.SECTION_BREAK_NEW_PAGE);
builder.getPageSetup().setPaperSize(PaperSize.A5);
builder.getPageSetup().setOrientation(Orientation.LANDSCAPE);
builder.writeln(“This text is in a section with different page size and orientation.”);

//Move to a position in the header.
builder.moveToMergeField(“MyHeader”);
builder.getFont().clearFormatting();
builder.getFont().setItalic(true);
builder.write(“This text is inserted into the header.”);

//Don’t need merge fields in the document anymore.
doc.getMailMerge().deleteFields();

doc.save(“C:\temp\asposewordtest.doc”);

%>





I have notified our team leader of your problem. He will contact you shortly on this issue.

Best regards,

Can you please open your license in notepad and check what's specified in the element. It should be Aspose.Total for Java. Better yet attach your license to this forum so I can test with it. Aspose.Words for Java works in my tests with the Total license.

By the way, do you realize you need to call SetLicense on different Licenses classes for Aspose.Words and Aspose.Cells.

com.aspose.words.License license1 = new com.Aspose.Words.License();

license1.SetLicense(...);

com.aspose.cells.License license2 = new com.Aspose.Cells.License();

license2.SetLicense(...);

Although that will not be the cause of the exception you are getting.