Need help... I am trying to set my lic with a input stream as follows:

com.aspose.words.License license = new com.aspose.words.License();
InputStream licIs = RRStartUp.class.getResourceAsStream("/retrospective__review/lic/Aspose.lic");
license.setLicense(licIs);

I get the following error:
com.aspose.words.PleaseReportException: Cannot find black listed licenses resource. Please report this error to Aspose. For free technical support, please post this error and the file in the Aspose.Words Forums <https://forum.aspose.com/c/words/8>.

com.aspose.words.License license = new com.aspose.words.License();
InputStream licIs = RRStartUp.class.getResourceAsStream("/retrospective__review/lic/Aspose.lic");
license.setLicense(licIs);

I get the following error:
com.aspose.words.PleaseReportException: Cannot find black listed licenses resource. Please report this error to Aspose. For free technical support, please post this error and the file in the Aspose.Words Forums <https://forum.aspose.com/c/words/8>.

Hi,
Blacklist file is situated inside the Aspose.Words jar. Probably you somehow modified your Aspose.Words jar, or wrapped, or even obfuscated it into another jar so license code can’t find the blacklist.
The best way is putting both Aspose.Words files (jar and license) on top level, without wrapping and obfuscating.
Best Regards,

That is not an option for me… I have it set up being obfuscated into one jar per client request. How do I put out the blacklist file I need into my jar?

If you could help me find a way to find or integrate the blacklist file needed into my jar I would appreciate it greatly… the clients I work for that bought the license want to know an answer to this. It is holding up a letter presentation.
Any help or suggestions would be greatly appreciated.
Thanks,

Hello CJavaTalk,
I have just spoken to Gary Holcomb from your company. I will make sure that many people sees this so it is answered quickly.
Problem: Cjavatalk needs help incorporating the license file of Aspose.Total.Java into their development jar. They ran into this problem when evaluating and found a workaround and didn’t think it would happen when purchasing Aspose.Total.
Second problem: They need help with bulk merger. Gary said that they will be sending many letters (1,000) and it is blowing their system when they test it.
This is very urgent for them since it is for their client.

Thanks for your response… we have the license file incorporated into the application… we are missing however the black list xml file due to I have only incorporated the dependence of your aspose jar into our application RRA.jar So the problem is that I need a way to link the needed black list xml file that the license requires to run properly. If you know how I can approach this situation I would appreciate any help on the matter.
Thanks for your time!

Hi,
Sorry for delay – it looks like we live in opposite timezonesJ
So, you have to obfuscate Aspose.Words jar into your jar? Or it is enough just insert the jar without obfuscation?
License code looks for the blacklist file by path “/resources/Aspose.License.BlackList.xml” inside the Aspose.Words jar. The code won’t work if your obfuscator scrambles this path/name or if it didn’t move the file into obfuscated jar.
I will send an private e-mail to your with additional info, but you should to know the official standpoint that Aspose.Words jar and license files should be visible for developers/users and should not be obfuscated into third-parity jars.
Best Regards,

I get different problem when it is not obfuscated… and when I incorporate the Aspose jar within my RRA.jar it gives me a message can not find main…which is explicitly set and has not been messed with. Can you give me some ideas to try?
Thanks for your time.

Hi,
What you mean when talking about “incorporating jar within another jar”? Obfuscating? Zipping?
Aspose.Words is a library and hasn’t main() method. Did you can’t find your main()?
You test Aspose.Words or Aspose.Total (or both)? Your application works well in basic mode but all breaks when you trying to “incorporate” all your jars into one jar?
So, I have more questions than answers. Please, provide more info about your environment and what you want to do.
About ideas, I suggest to test your application in a plain environment for a start, without any jar “incorporating”. If all works well we can move further.
Best Regards,

Hey,
To answer all you questions I have numbered them as follows:
1.) When talking about incorporating within our jar I mean Zipping.
1A) To do this I have three options:
1.) To include Resources and Dependencies (I have tried this with a main failure)
2.) To include just Dependencies (This will not work due to No blacklist but I Do Not Get the main error that I get with the others.)
3.) To include all. (I have tried this with a main failure)
2.) Did you can’t find you main()?>> I think what you are asking is… was I finding my main before including the Aspose jar? So the answer to this is yes, I have been working on this project for 55 week and have never had a problem with my jar. I have never had a problem incorporating other jars into our application like for instance our JDBC jar for SQL2005 connection. If this was not what you were asking please ask again…it was a little unclear.
3.) I have tried both with no success… and everytime I try to incorporate part or all of your Aspose Jar I can only get it to run by doing part 2 of 1A above… but when I just include dependencies it does not have the required resources file for the black list. When this is put in it produces a main error.
4.) My environment is Borland Enterprise 2006.
5.) Our system works fine in a plain environment and with other jars but not with the Aspose jar. The only time I get a main problem is with the Aspose jar… I think I will have to alter my archive file to possibly run the Aspose jar and then link to my main class. If you know anything about this please fill free to expand on this idea.
I hope I answered all your question. If not please ask again and I will clarify.
Thanks for all the time and effort.
Jeff

Hi, Jeff,
Thanks for your answers and welcome to the Jar HellJ.
Let’s describe your situation. You have two jars: 1) your “main” jar that contains (besides .class files and resources) manifest.mf file with the line “Main-Class: xxx” pointing to your main class; 2) Aspose.Words jar that contains its own manifest file (without “Main-Class: xxx” line since Aspose.Words is library but with great number of another important lines since the jar is signed). Note that Aspose.Words jar also contains the blacklist file in resources folder and at last the jar is signed. So you got a zugzwang: if you modifying anyway Aspose.Words jar – it won’t work, if you modifying your jar’s manifest (change it with Aspose.Words’s one) – java can’t find the main class for your application.
You have at least four options to solve the problem:

  1. Do not include all jars into oneJ. The best option, imo, since jarring one jar into another jar is non-standard way (see https://docs.oracle.com/javase/tutorial/deployment/jar/downman.html ). This option will help you to save a lot of time during deployment and, especially, during maintenance.
  2. Manually implant one jar into another using zip and notepad (for editing a manifest). Probably what you doing by now (?). – It is possible, but doesn’t practically feasible, imo, especially in maintenance period.
  3. Obfuscate one jar into another. By the way, this option used when we compose Aspose.Words jar – this helps to make the jar such a small and raises the performance (we leaving on top only license files). But most of current obfuscators can’t work with non .class files and we do not obfuscate some external libraries (with dependences on non .class configuration files) into Aspose.Words jar. This option doesn’t suit for you too because Aspose.Words jar contains dependence to blacklist xml file.
  4. Try to use One-JAR tool (http://one-jar.sourceforge.net/ ). I don’t test it but they stated that the tool can help to include one jar into another jar without any change to the first one.

So, you really have only two options – ## 1 and 4. And if you will have success with option #4 don’t forget to leave Aspose.Words license.txt file on top level.
Regards,

Thanks, I will give these a try… right now I do not have your jar in mine and I have a script that starts you jar then mine to run them in sequence which works… but my clients like the one jar concept.
Thanks again for your time in this matter,
Jeff