Hi,
I am new to Aspose.
I downloaded Aspose.Words for Java 11.1.0 for evaluation.
I am trying to run a basic example in java 1.6 using Spring framework on eclipse IDE. Following is the code for my words test;
package org.primefaces.examples.moviecollector.view;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.aspose.words.Document;
import com.aspose.words.DocumentBuilder;
@Component("test123")
@Scope("session")
public class Test
{
public static void main123()
{
try
{
// Document doc = new Document("Test.doc");
// doc.save("TestOut.doc");
Document doc1 = new Document();
DocumentBuilder builder = new DocumentBuilder(doc1);
builder.writeln("Hello World!");
doc1.save("DocumentBuilderAndSave Out.doc");
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
In My Application i have the following button to call the main123() method;
<h:commandButton id="generate" action="#{test123.main123}" value="Generate" />
When this method is called;
i get the following error;
SEVERE: java.lang.NoClassDefFoundError: com/aspose/words/Document javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: com/aspose/words/Document …
WARNING: #{test123.main123}: java.lang.NoClassDefFoundError: com/aspose/words/Document javax.faces.FacesException: #{test123.main123}: java.lang.NoClassDefFoundError: com/aspose/words/Document
I want to highlight that when i change the following method, main123() to main(String args[]) and run it from command line; it works; but when i change the method from main(String args[]) to main123() and run it from web application it gives me above error.
As i am new to Aspose; can anyone help me on this issue please; i am not sure if it is an issue with licence or i need to do something different to run this basic example as jsf?
Many Thanks
Sheraz