When I try to load license file I get the following exception.
java.io.IOException: code-source:/c:/oc4j/j2ee/home/config/…/applib/Aspose.Words.jdk14.jar/META-INF/MANIFEST.MF has no "!" suffix so does not name a path within the code-source.
at oracle.classloader.SharedCodeSourceSet.getResourceStream(SharedCodeSourceSet.java:482)
at oracle.classloader.SharedCodeSourceURL$Connection.getInputStream(SharedCodeSourceURL.java:93)
at java.net.URL.openStream(URL.java:1007)
at com.aspose.words.ew.b(Unknown Source)
at com.aspose.words.ew.a(Unknown Source)
at com.aspose.words.License.setLicense(Unknown Source)
A similar exception is stated on the following URL: http://lists.jboss.org/pipermail/hibernate-issues/2006-August/000544.html
Hi,
Afraid, I don’t understand your question. What overload of License.setLicense() are you using? Where you put the license file? Please, provide the code snippet that causes the exception.
Best reards,
Hi,
I use the following method to load license file.
I tried to put license file into web-inf directory as in samples, I tried to pass a String argument to setLicense method to no avail.
As far as I understood from the exception you try to open manifes.mf file in the jar. But you fail to provide a ! notation file name to call, and OC4J rejects it.
Hi, Ali,
From link you provided I realize that this is a bug or a specific behavior of Oracle OC4J’s class loader. For some reasons it changes the protocol and strips ‘!’ after ‘jar’. Other class loaders leave ‘!’ in place so we successfully loading the manifest by url, something like: “jar: /X:/Aspose.Words.Java/lib/Aspose.Words.jdk15.jar!/META-INF/MANIFEST.MF”.
Afraid, we have to correct ours license code to please Oracle:) Before this, please, can you launch from your loadLicense() a simple code snippet and inform me what you see:
URL url = License.class.getResource("License.class");
System.out.println("url = " + url);//OC4J's classloader should strip ‘!’
InputStream inputStream = url.openStream();//OC4J should throw here
Hi, Ali,
It’s interesting. I see, your class loader doesn’t strip ‘!’ when makes an URL from a string, it only changes the protocol to “code-source:/”…
We do something similar to what you figured out. But. We using “**!/META-INF/MANIFEST.MF" instead of yours "!META-INF/MANIFEST.MF" (‘!/’ instead of ‘!’). When I launching your code I get “java.net.MalformedURLException: no !/ in spec”.
Please, try "!/**META-INF/MANIFEST.MF” in your test unit. May be Oracle prefer ‘!’ instead of ‘!/’ and strips ‘!’ before ‘/’?
Regards,
java.io.FileNotFoundException: /META-INF/MANIFEST.MF not found
in file:/c:/Borland/oc4j_yeni/j2ee/home/config/../applib/Aspose.Words.jdk14.jar
at oracle.classloader.SharedJar.doGetStream(SharedJar.java:308)
at oracle.classloader.SharedCodeSource.getStream(SharedCodeSource.java:1007)
at oracle.classloader.SharedCodeSourceSet.getResourceStream(SharedCodeSourceSet.java:479)
at oracle.classloader.SharedCodeSourceURL$Connection.getInputStream(SharedCodeSourceURL.java:93)
at java.net.URL.openStream(URL.java:1007)
at mil.tsk.base.aspose.WordUtil.loadLicense(WordUtil.java:36)
... and so on
Unfortunately the problem continues. The exception message is as follows:
Thanks,
Ali
java.io.IOException: code-source:/C:/Borland/oc4j_yeni/j2ee/home/applications/akss/lib/Aspose.Words.jdk14.jarMETA-INF/MANIFES.MF has no "!" suffix so does not name a path within the code-source.
at oracle.classloader.SharedCodeSourceSet.getResourceStream(SharedCodeSourceSet.java:482)
at oracle.classloader.SharedCodeSourceURL$Connection.getInputStream(SharedCodeSourceURL.java:93)
at java.net.URL.openStream(URL.java:1007)
at com.aspose.words.nonpublic.ge.b(Unknown Source)
at com.aspose.words.nonpublic.ge.a(Unknown Source)
at com.aspose.words.License.setLicense(Unknown Source)
at mil.tsk.base.aspose.WordUtil.loadLicense(WordUtil.java:59)
at mil.tsk.beyanname.client.GCServlet.loadAsposeLicense(GCServlet.java:100)
Sorry, it’s my ‘mind typo’ – I was thinking in terms that Oracle strips ‘/’ from the URL but it just using ‘!’ instead of ‘!/’.
I found a new topic about this Oracle bug: http://mail-archives.apache.org/mod_mbox/hivemind-dev/200601.mbox/%3C1675266867.1138127830897.JavaMail.jira@ajax.apache.org%3E . They talking that this bug is already fixed in the latest developer preview of OC4J. So we will continue ours conversation after that OC4J release:)
Please, inform me how the newest library works.
Regards,