AssemblyProduct attribute is not defined on the assembly. Please report this error to

This error occured when I'm trying to set the License for Aspose.BarCode 1.5.0.0.

here is the error message:

08/09/17 15:17:47 java.lang.RuntimeException: AssemblyProduct attribute is not defined on the assembly. Please report this error to.
08/09/17 15:17:47 at com.aspose.barcode.bs.a(SourceFile:181)
08/09/17 15:17:47 at com.aspose.barcode.bs.a(SourceFile:137)
08/09/17 15:17:47 at com.aspose.barcode.License.setLicense(SourceFile:102)
08/09/17 15:17:47 at com.faf.credit.individualcarfinance.docgen.LoanContranct.generateOutputStream(LoanContranct.java:66)

my environment:

OS: solaris

JDK:1.4.2.13

Application Server: Oracle Application Server 10.1.2

and my source code is like this:

com.aspose.words.License wordLicense = new com.aspose.words.License();
com.aspose.barcode.License barcodeLicense = new com.aspose.barcode.License();
wordLicense.setLicense("/u02/oracle/icf/AsposeLicense.lic");
barcodeLicense.setLicense("/u02/oracle/icf/AsposeLicense.lic");

if I comment the last line the error seems gone, but "Aspose Demo" will be shown on the barcode picture.

would you please help me solve this problem.

thanks

best regards.

PS: the same code works just fine on Oracle Application Server 10.1.3.

I'm totaly confused. -_-!

Hi Daniel,

Thanks for considering Aspose.

The barcode license settings should work well without giving any errors. Could you please try setting the barcode license in a separate .java file and execute it, just to test whether the licensing alone is not giving any error.

Could you please also test com.faf.credit.individualcarfinance.docgen.LoanContranct.generateOutputStream(LoanContranct.java:66) function.

It seems strange to use as well that it works with Oracle AS10.1.3 and not with 10.1.2.

Hi saqib ,

As you said, I wrote a new .java file and some test code. here is my entire test file:

package com.faf.credit.test.action;

import java.io.File;
import java.io.FileInputStream;

public class AsposeTest {

private static final String LICENSE_FILE = "/u02/oracle/icf/AsposeLicense.lic";

public void barcodeLicenseTest() {
try {
com.aspose.barcode.License barcodeLicense = new com.aspose.barcode.License();
barcodeLicense.setLicense(LICENSE_FILE);
System.out.println("barcode license first try success");
} catch (Exception ex) {
System.out.println("barcode license first try failed");
ex.printStackTrace();
}

try {
com.aspose.barcode.License barcodeLicense = new com.aspose.barcode.License();
FileInputStream fi = new FileInputStream(new File(LICENSE_FILE));
barcodeLicense.setLicense(fi);
System.out.println("barcode license second try success");
} catch (Exception ex) {
System.out.println("barcode license second try failed");
ex.printStackTrace();
}
}

public void wordLicenseTest(){
try {
com.aspose.words.License wordLicense = new com.aspose.words.License();
wordLicense.setLicense(LICENSE_FILE);
System.out.println("word license first try success");
} catch (Exception ex) {
System.out.println("word license first try failed");
ex.printStackTrace();
}

try {
com.aspose.words.License wordLicense = new com.aspose.words.License();
FileInputStream fi = new FileInputStream(new File(LICENSE_FILE));
wordLicense.setLicense(fi);
System.out.println("word license second try success");
} catch (Exception ex) {
System.out.println("word license second try failed");
ex.printStackTrace();
}
}
}

I execute these two functions in a jsp page, here is my jsp page source code:

<%@page contentType="text/html; charset=GBK"%>
<%@page import="com.faf.credit.test.action.AsposeTest" %>
<%
AsposeTest asposeTest = new AsposeTest();
asposeTest.barcodeLicenseTest();
asposeTest.wordLicenseTest();
%>

and I got the stack trace like this:

08/09/18 09:01:35 barcode license first try failed
08/09/18 09:01:35 java.lang.RuntimeException: AssemblyProduct attribute is not defined on the assembly. Please report this error to Aspose.
08/09/18 09:01:35 at com.aspose.barcode.bs.a(SourceFile:181)
08/09/18 09:01:35 at com.aspose.barcode.bs.a(SourceFile:137)
08/09/18 09:01:35 at com.aspose.barcode.License.setLicense(SourceFile:102)
08/09/18 09:01:35 at com.faf.credit.test.action.AsposeTest.barcodeLicenseTest(AsposeTest.java:13)
08/09/18 09:01:35 at _test._jspService(_test.java:49)
08/09/18 09:01:35 at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
08/09/18 09:01:35 at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:569)
08/09/18 09:01:35 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:305)
08/09/18 09:01:35 at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
08/09/18 09:01:35 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
08/09/18 09:01:35 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
08/09/18 09:01:35 at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
08/09/18 09:01:35 at com.faf.framework.LoginFilter.doFilter(LoginFilter.java:51)
08/09/18 09:01:35 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
08/09/18 09:01:35 at com.faf.framework.EncodeFilter.doFilter(EncodeFilter.java:32)
08/09/18 09:01:35 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:659)
08/09/18 09:01:35 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
08/09/18 09:01:35 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
08/09/18 09:01:35 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224)
08/09/18 09:01:35 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)
08/09/18 09:01:35 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
08/09/18 09:01:35 at java.lang.Thread.run(Thread.java:534)
08/09/18 09:01:35 barcode license second try failed
08/09/18 09:01:35 java.lang.RuntimeException: AssemblyProduct attribute is not defined on the assembly. Please report this error to Aspose.
08/09/18 09:01:35 at com.aspose.barcode.bs.a(SourceFile:181)
08/09/18 09:01:35 at com.aspose.barcode.License.setLicense(SourceFile:123)
08/09/18 09:01:35 at com.faf.credit.test.action.AsposeTest.barcodeLicenseTest(AsposeTest.java:23)
08/09/18 09:01:35 at _test._jspService(_test.java:49)
08/09/18 09:01:35 at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
08/09/18 09:01:35 at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:569)
08/09/18 09:01:35 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:305)
08/09/18 09:01:35 at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
08/09/18 09:01:35 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
08/09/18 09:01:35 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
08/09/18 09:01:35 at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
08/09/18 09:01:35 at com.faf.framework.LoginFilter.doFilter(LoginFilter.java:51)
08/09/18 09:01:35 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
08/09/18 09:01:35 at com.faf.framework.EncodeFilter.doFilter(EncodeFilter.java:32)
08/09/18 09:01:35 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:659)
08/09/18 09:01:35 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
08/09/18 09:01:35 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
08/09/18 09:01:35 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224)
08/09/18 09:01:35 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)
08/09/18 09:01:35 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
08/09/18 09:01:35 at java.lang.Thread.run(Thread.java:534)
08/09/18 09:01:35 word license first try success
08/09/18 09:01:35 word license second try success

I've also tested it on another computer which runs RedHat Linux AS2 and Oracle AS 10.1.2, and it gives me the same error.

And along I send my license file to you.

thanks and best regards..

Hi,

We did the tests on JDK 1.5. There was no exception. I am now trying to test it on JDK:1.4.2.13 and will let you know about the results.

Thanks

I'm looking forward to your results.

by the way, our company provides credit loan for customer who are buying there car. And we use aspose.words and aspose.barcode controls to generate the loan contract with a 2D barcode on it.

And all our program runs on OAS 10.1.2 and JDK 1.4.2.13, so there is no way to change our environment. :-(

just let you know my situation. ^_^

Hi,

I just noted one thing. It is being caused due to the file stream that is left open. If you close the stream after setting the license in the each function, it will work.

Hi,

You mean like this?

public void barcodeLicenseTest() {

try {
com.aspose.barcode.License barcodeLicense = new com.aspose.barcode.License();
FileInputStream fi = new FileInputStream(new File(LICENSE_FILE));
barcodeLicense.setLicense(fi);
System.out.println("barcode license try success");
fi.close();
} catch (Exception ex) {
System.out.println("barcode license try failed");
ex.printStackTrace();
}
}

but I still can't get it work. :-( I'm sure that I havn't called any of the setLicense() method before I try this.

also I tried this,

public void barcodeLicenseAnotherTest() {

try {
com.aspose.barcode.License barcodeLicense = new com.aspose.barcode.License();
barcodeLicense.setLicense(LICENSE_FILE);
System.out.println("barcode license try success");
} catch (Exception ex) {
System.out.println("barcode license try failed");
ex.printStackTrace();
}

}

it can't work properly too.

Hi,

Please check out the latest version and test if it works.

It seems like a bug of OAS environment...

Thanks

Hi,

I'm sorry to say that the beta version did not work properly.

the stacktrace is like this:

08/09/26 16:48:20 java.lang.RuntimeException: AssemblyProduct attribute is not defined on the assembly. Please report this error to Aspose.
08/09/26 16:48:20 at com.aspose.barcode.bt.a(SourceFile:181)
08/09/26 16:48:20 at com.aspose.barcode.License.setLicense(SourceFile:123)

Note that the beta version 1.5.0.1 has the error occured at source file line 123. the previous version 1.5.0.0 has the same error at source file line 102.

Hope that will help.

thanks and best regards.

Bad news..

Please try the latest version of Aspose.BarCode. Thanks

OMG

It works, it works!!!!!!

thank you.