We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Build Report & Update LINQ Template Syntax Fields in Word Document using Java - Manage WindowsNativeCall Exception

I have same problem with 18.9 too, trying to merge with linkq when i save

	// Open the template document
	com.aspose.words.Document doc = new com.aspose.words.Document(new ByteArrayInputStream(merger.getTemplate()));

	logger.debug("linq reporting begin");

	ReportingEngine engine = new ReportingEngine();
	// Per poter referenziare nel template elementi non presenti nell'istanza
	engine.setOptions(ReportBuildOptions.ALLOW_MISSING_MEMBERS);
	// per poter utilizzare la classe Date
	engine.getKnownTypes().add(Date.class);
	// per poter utilizzare la classe Lingua
	engine.getKnownTypes().add(Lingua.class);
	engine.buildReport(doc, istanza);

	logger.debug("linq reporting end");

	**ByteArrayOutputStream dstStream = new ByteArrayOutputStream();**

** doc.save(dstStream, options);**

Caused by: java.lang.UnsatisfiedLinkError: com.aspose.words.WindowsNativeCall.readRegistryStringValues(ILjava/lang/String;)Ljava/util/Map;
10:53:36,306 INFO [stdout] (default task-96) at com.aspose.words.WindowsNativeCall.readRegistryStringValues(Native Method) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at asposewobfuscated.zzA1.zzN(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at asposewobfuscated.zzC1.zzU(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at asposewobfuscated.zzC2.zzQK(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at asposewobfuscated.zzRF.zzZ(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at asposewobfuscated.zzRZ.zzQN(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at asposewobfuscated.zzRZ.zzS(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at asposewobfuscated.zzRZ.zzT(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at com.aspose.words.FontSettings.zzT(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at com.aspose.words.zz97.zzR(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at com.aspose.words.zz97.zzQ(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at com.aspose.words.zz00.zzYJ(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at com.aspose.words.zz8Z$zzZ.zzZX(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at asposewobfuscated.zzCT.moveNext(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at com.aspose.words.zz8Z.zzZ(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at com.aspose.words.zzZ0G.zzZlX(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at com.aspose.words.zzZ0G.zzX(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at com.aspose.words.zz8Z.(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at com.aspose.words.zzYXQ.zzZ(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,306 INFO [stdout] (default task-96) at com.aspose.words.zz8Y.moveNext(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,356 INFO [stdout] (default task-96) at com.aspose.words.zzZMT.zzZ(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,356 INFO [stdout] (default task-96) at com.aspose.words.Document.updatePageLayout(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,356 INFO [stdout] (default task-96) at com.aspose.words.Document.zzXu(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,356 INFO [stdout] (default task-96) at com.aspose.words.Document.zz5q(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,356 INFO [stdout] (default task-96) at com.aspose.words.zz1F.zzT(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,356 INFO [stdout] (default task-96) at com.aspose.words.zz1F.zzW(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,356 INFO [stdout] (default task-96) at com.aspose.words.zz1F.zzYZ(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,356 INFO [stdout] (default task-96) at com.aspose.words.zz1F.zzZ(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,356 INFO [stdout] (default task-96) at com.aspose.words.zz1F.zzZC(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,356 INFO [stdout] (default task-96) at com.aspose.words.Document.zzZ(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,356 INFO [stdout] (default task-96) at com.aspose.words.Document.zzZ(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,356 INFO [stdout] (default task-96) at com.aspose.words.Document.zzZ(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,356 INFO [stdout] (default task-96) at com.aspose.words.Document.save(Unknown Source) ~[aspose-words-18.8-jdk16.jar:18.8]
10:53:36,356 INFO [stdout] (default task-96) at it.bolzano.comune.cbzcomponent.adapter.PdfAdapter.mergeDataTo(PdfAdapter.java:122) ~[cbz-component-1.0.33-20181001.121453-1.jar:?]
10:53:36,356 INFO [stdout] (default task-96) at it.bolzano.comune.cbzcomponent.adapter.PdfAdapter.mergeData(PdfAdapter.java:83) ~[cbz-component-1.0.33-20181001.121453-1.jar:?]
10:53:36,356 INFO [stdout] (default task-96) at it.bolzano.comune.cbzcomponent.adapter.PdfAdapter.creaPdf(PdfAdapter.java:50) ~[cbz-component-1.0.33-20181001.121453-1.jar:?]
10:53:36,356 INFO [stdout] (default task-96) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66]
10:53:36,356 INFO [stdout] (default task-96) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66]
10:53:36,356 INFO [stdout] (default task-96) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66]
10:53:36,357 INFO [stdout] (default task-96) at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66]
10:53:36,357 INFO [stdout] (default task-96) at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52) ~[?:?]
10:53:36,357 INFO [stdout] (default task-96) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) ~[jboss-invocation-1.4.1.Final.jar!/:1.4.1.Final]
10:53:36,357 INFO [stdout] (default task-96) at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437) ~[jboss-invocation-1.4.1.Final.jar!/:1.4.1.Final]
10:53:36,357 INFO [stdout] (default task-96) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82) ~[wildfly-weld-10.1.0.Final.jar!/:10.1.0.Final]
10:53:36,357 INFO [stdout] (default task-96) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93) ~[wildfly-weld-10.1.0.Final.jar!/:10.1.0.Final]
10:53:36,357 INFO [stdout] (default task-96) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63) ~[?:?]
10:53:36,357 INFO [stdout] (default task-96) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) ~[jboss-invocation-1.4.1.Final.jar!/:1.4.1.Final]
10:53:36,357 INFO [stdout] (default task-96) at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) ~[wildfly-ejb3-10.1.0.Final.jar!/:10.1.0.Final]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) ~[?:?]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47) ~[?:?]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) ~[?:?]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437) ~[?:?]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:64) ~[weld-core-impl-2.3.5.Final.jar!/:2.3.5.Final]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83) ~[wildfly-weld-10.1.0.Final.jar!/:10.1.0.Final]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) ~[jboss-invocation-1.4.1.Final.jar!/:1.4.1.Final]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) ~[wildfly-ee-10.1.0.Final.jar!/:10.1.0.Final]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) ~[jboss-invocation-1.4.1.Final.jar!/:1.4.1.Final]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) ~[jboss-invocation-1.4.1.Final.jar!/:1.4.1.Final]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) ~[jboss-invocation-1.4.1.Final.jar!/:1.4.1.Final]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) ~[jboss-invocation-1.4.1.Final.jar!/:1.4.1.Final]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52) ~[?:?]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) ~[jboss-invocation-1.4.1.Final.jar!/:1.4.1.Final]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocation(NonPooledEJBComponentInstanceAssociatingInterceptor.java:59) ~[wildfly-ejb3-10.1.0.Final.jar!/:10.1.0.Final]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) ~[jboss-invocation-1.4.1.Final.jar!/:1.4.1.Final]
10:53:36,406 INFO [stdout] (default task-96) at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:254) ~[wildfly-ejb3-10.1.0.Final.jar!/:10.1.0.Final]
10:53:36,406 INFO [stdout] (default task-96) … 194 more

I’ve noticed it happens only if try to generate a PDF file with PdfSaveOptions.

		options = new PdfSaveOptions();
		((PdfSaveOptions) options).setCompliance(PdfCompliance.PDF_A_1_B);

If i use DocSaveOptions or OdtSaveOptions if works ok.

@simone.padovan,

It looks to be a class loader bug of some JVMs. We had recently changed our old good working code for compatibility with Java 10 and Java 11. But this new code, that we added for compatibility, does not work on some buggy JVMs (it seems they do not release some resources automatically).

The good news is that we have recently fixed this issue i.e. WORDSJAVA-1891. Your thread has been linked to this issue. The fix of this issue will be integrated in next 18.10 release of Aspose.Words for Java. We will inform you via this thread as soon as 18.10 release will be published in next few days.

You may please retest your scenario on your end after when Aspose.Words for Java 18.10 is released in next few days.

A post was split to a new topic: Input stream has been finalized or forced closed without being explicitly closed

The issues you have found earlier (filed as WORDSJAVA-1891) have been fixed in this Aspose.Words for .NET 18.10 update and this Aspose.Words for Java 18.10 update.