import com.aspose.words.License;
public void loadLicense() throws LicenseNotFoundException {
File licenseFile = new File("c:\Aspose.Total.Java.lic");
if (licenseFile.exists()) {
try {
License license = new License();
InputStream in = new FileInputStream(licenseFile);
license.setLicense(in);
in.close();
} catch (Exception e) {
e.printStackTrace();
throw new LicenseNotFoundException(licenseFile.getAbsolutePath() + " not loaded. " + e.getMessage());
}
} else {
throw new LicenseNotFoundException(licenseFile.getAbsolutePath() + " cannot be found.");
}
}
Ausnahme:OC4J Aspose Lizenzdatei laden
java.io.FileNotFoundException: META-INF/MANIFEST.MF nicht in der Datei gefunden: c/oc4j_101350/j2ee/home/Anwendungen/xxx/lib/Aspose.Words.jdk14.jar
META-INF/MANIFEST.MF nicht in der Datei gefunden: C/oc4j_101350/j2ee/home/Anwendungen/xx/lib/Aspose.Words.jdk14.jar
Konfiguration:
- JDK 1.5.06
- OC4J Standalone 10.1.3
- Aspose.Words.jdk14.jar