Trying to update Aspose Words from Version 21.4 to 21.6 (same problem with 21.5). Running into the following exception. To isolate the issue I created a simple OSGi bundle (see manifest below). The Problem does not happen if only the Jar is used instead of the OSGi dependency.
org.osgi.framework.BundleException: Ausnahme in aspose.word.osgi.test.Activator.start() von Bundle aspose.word.osgi.test.
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:835)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:763)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1012)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:366)
at org.eclipse.osgi.container.Module.doStart(Module.java:605)
at org.eclipse.osgi.container.Module.start(Module.java:468)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1845)
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1838)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1743)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1665)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
Caused by: java.lang.ExceptionInInitializerError
at com.aspose.words.zzXjl.zzWXs(Unknown Source)
at com.aspose.words.zzXjl.zzXHL(Unknown Source)
at com.aspose.words.zzWh8.zzpw(Unknown Source)
at com.aspose.words.Document.zzYl6(Unknown Source)
at com.aspose.words.Document.zzWXs(Unknown Source)
at com.aspose.words.Document.zzWWx(Unknown Source)
at com.aspose.words.Document.<init>(Unknown Source)
at com.aspose.words.Document.<init>(Unknown Source)
at aspose.word.osgi.test.Activator.start(Activator.java:38)
at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:814)
at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:806)
... 14 more
Caused by: java.lang.IllegalStateException: Invalid license signature. Please make sure the license file was not modified.
at com.aspose.words.zzWS3.<init>(Unknown Source)
at com.aspose.words.zzWS3.<clinit>(Unknown Source)
... 27 more
Root exception:
java.lang.ExceptionInInitializerError
at com.aspose.words.zzXjl.zzWXs(Unknown Source)
at com.aspose.words.zzXjl.zzXHL(Unknown Source)
at com.aspose.words.zzWh8.zzpw(Unknown Source)
at com.aspose.words.Document.zzYl6(Unknown Source)
at com.aspose.words.Document.zzWXs(Unknown Source)
at com.aspose.words.Document.zzWWx(Unknown Source)
at com.aspose.words.Document.<init>(Unknown Source)
at com.aspose.words.Document.<init>(Unknown Source)
at aspose.word.osgi.test.Activator.start(Activator.java:38)
at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:814)
at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:806)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:763)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1012)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:366)
at org.eclipse.osgi.container.Module.doStart(Module.java:605)
at org.eclipse.osgi.container.Module.start(Module.java:468)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1845)
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1838)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1743)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1665)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
Caused by: java.lang.IllegalStateException: Invalid license signature. Please make sure the license file was not modified.
at com.aspose.words.zzWS3.<init>(Unknown Source)
at com.aspose.words.zzWS3.<clinit>(Unknown Source)
... 27 more
MANIFEST.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test
Bundle-SymbolicName: aspose.word.osgi.test;singleton:=true
Bundle-Version: 1.0.0.qualifier
Automatic-Module-Name: aspose.word.osgi.test
Bundle-RequiredExecutionEnvironment: JavaSE-15
Import-Package: com.aspose.words;version="21.6.0",
org.osgi.framework
Bundle-Activator: aspose.word.osgi.test.Activator
Require-Bundle: com.aspose.words;bundle-version="21.6.0"
Bundle-ActivationPolicy: lazy
Activator.java
package aspose.word.osgi.test;
import java.net.URL;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import com.aspose.words.Document;
public class Activator implements BundleActivator {
@Override
public void start(BundleContext bundleContext) throws Exception {
// load the license
URL licenseUrl = bundleContext.getBundle().getResource("resource/license/Aspose.Total.Java.lic"); //$NON-NLS-1$
if (licenseUrl == null) {
throw new Exception("license resource not found"); //$NON-NLS-1$
}
try {
com.aspose.words.License wordsLicense = new com.aspose.words.License();
wordsLicense.setLicense(licenseUrl.openStream());
} catch (Exception e) {
throw new Exception("failed to activate license for Aspose Words", e); //$NON-NLS-1$
}
try {
Document doc = new Document();
doc.save("d:/temp/result.docx");
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void stop(BundleContext bundleContext) throws Exception {
}
}