License file saxon-license.lic not found
Added by Anonymous about 18 years ago
Legacy ID: #3993440 Legacy Poster: john (john-smith)
I got a runtime exception -"saxon-license.lic not found" when using saxon8sa.jar. I put the saxon-license.lic in /WEB-INF/classes, /WEB-INF/lib/ or even at the package level with the java program but nothing is working and i got the same run time error message below. Do you know how I can include this license file into my war without specifying the license in the CLASSPATH as instructed on sason website. we have a 3-tier split since the web apps that use this jar/license will be deployed onto a different server instance and JVM so puting this license file into the CLASSPATH does not work for us. Any suggestion or work-around for this problem? Thanks. ======================================================================= java.lang.RuntimeException: License file saxon-license.lic not found at com.saxonica.validate.JavaVerifier.loadLicense(JavaVerifier.java:48) at com.saxonica.validate.PlatformVerifier.getFeature(PlatformVerifier.java:63) at com.saxonica.validate.SchemaAwareConfiguration.getFeature(SchemaAwareConfiguratio n.java:91) at com.saxonica.validate.SchemaAwareConfiguration.isSchemaAware(SchemaAwareConfigura tion.java:110) at net.sf.saxon.instruct.FixedElement.simplify(FixedElement.java:78) at net.sf.saxon.instruct.ParentNodeConstructor.simplify(ParentNodeConstructor.java:1 14) at net.sf.saxon.instruct.DocumentInstr.simplify(DocumentInstr.java:96) at net.sf.saxon.style.XSLGeneralVariable.initializeInstruction(XSLGeneralVariable.ja va:368) at net.sf.saxon.style.XSLVariable.compile(XSLVariable.java:103) at net.sf.saxon.style.XSLStylesheet.compileStylesheet(XSLStylesheet.java:1056) at net.sf.saxon.PreparedStylesheet.setStylesheetDocument(PreparedStylesheet.java:315 ) at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:127) at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:135) at net.sf.saxon.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:86 ) ================================================================
Replies (3)
Please register to reply
RE: License file saxon-license.lic not found - Added by Anonymous about 18 years ago
Legacy ID: #3993925 Legacy Poster: Michael Kay (mhkay)
I've only done this with a very simple tomcat configuration, in which I had no problems. I have the Saxon JAR files in %tomcat%/common/lib, and the servlet classes together with the license file in %tomcat%/webapps/servlets-examples/WEB-INF/classes. Basically Saxon is finding the license file using this logic: ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { cl = ClassLoader.getSystemClassLoader(); } InputStream is = cl.getResourceAsStream("saxon-license.lic"); if (is==null) { throw new RuntimeException("License file saxon-license.lic not found"); } If your environment is doing something clever with class loaders, then this could fail, but it's essentially looking in the same places that properties files will be found, and should be in the same place as you would put a properties file. You could try the above logic from your own application. You can't actually supply the license key to Saxon programmatically, but this might help you to diagnose why it isn't being found. One simple thing: check that the license file has the correct name (as above). Some mail systems, notably Yahoo, have been known to change the filename in transit, changing the hyphen to an underscore. I'd be inclined to tackle this by trying to get it working first in a very simple environment (like a vanilla tomcat environment) and then moving on to something more sophisticated. If it helps, I've posted the schema-aware sample servlet that I used for you to try at http://www.saxonica.com/download/patched/SaxonSAServlet.java
RE: License file saxon-license.lic not found - Added by Anonymous about 18 years ago
Legacy ID: #3994215 Legacy Poster: john (john-smith)
Michael, Excellent response. I think my goal is to pack everything in a WAR file and keep third party software like saxon at the application level. By doing so, I don't have to reply on the integration team who does the deployment. They don't have to move the saxon jar to the common lib on the server as you said or include the license directory path into the CLASSPATH. All I have to do is give them a WAR file for deployment and I dont have to worry if we decide to split as mentioned earlier. I had put jar file under /WEB-INF/lib/ and license file under /WEB-INF/classes/saxon-license.lic (below configuration) but it didn't work: myapp/webapp/WEB-INF/lib/saxon/saxon8sa.jar /myapp/webapp/WEB-INF/classes/saxon-license.lic Clearly, putting saxon jar file under the server is what we avoid to do. We also avoid including saxon-licence.lic into the CLASSPATH at the server level as well. Is it possible to make it work and keep saxon8sa.jar and saxon-license.lic at the application level? We probably use weblogic or websphere and not tomcat in the production. Thanks.
RE: License file saxon-license.lic not found - Added by Anonymous about 18 years ago
Legacy ID: #3994636 Legacy Poster: john (john-smith)
Never mind. Problem solved! put license file under /WEB-INF/classes/ should work.
Please register to reply