License not valid in a Java+Spring web application

User 1f6738be65

04-09-2013 07:43:09

Hi,


We are working in a Java + Spring web application that will be hosted in a server, and when we want to use a JChemSearch searcher, says that the license is not valid.


First we had an Evaluation license (that was Server Use Allowed), and we place it under the root of the project, into a directory called chemaxonLicense/license.cxl, and then, in the code, we write:


LicenseManager.setLicensePath("/chemaxonLicense/license.cxl");


And the license had worked well.


But the license has expired and we aquired an Annual license, that has a restriction 


<Restriction Name="Server Use" Value="Not Allowed"/>


And now it doesn't work, says that the license is not valid. We place the license in the default directory (in the server, in a sub-directory under the home directory) and in the code we write:


LicenseManager.setLicensePath("/home/name_of_user_home/.chemaxon/license.cxl");


And it still says that the license is not valid.


What are we doing wrong?


Thanks a lot.

ChemAxon 9c0afc9aaf

04-09-2013 09:23:00

Hi,


Normally local license files should not require Server Usage option.


Could you please let us know the exact JChem Version and send us the license file you ar using to support _at_ chemaxon.com ?


Best regards,


Szilard

ChemAxon 9c0afc9aaf

04-09-2013 09:25:36

PS:


LicenseManager.setLicensePath("/home/name_of_user_home/.chemaxon/license.cxl");

This is the default path for license files.


Coud you try what happens if you do Not call the setLicensePath() method ? (superfluous in this case)


Szilard

User 1f6738be65

04-09-2013 09:44:31

If I don't call the setLicensePath() method says "No license file found." (tested locally, in the server I don't know because I can't see logs).


I am using JChem Base, the version I think is Marvin 5.3.7, and I want to place the license in the server with the web application, not locally. Place the license locally means have one license in every pc that uses the application, not?


If I want to place the license in server, how have I to configure it?


I have sent you the license.

User 1f6738be65

04-09-2013 09:56:18

PS: Failed to send mail to the address you gave me.

ChemAxon 9c0afc9aaf

04-09-2013 10:21:05

 


Sorry, the correct e-mail is support _at_ chemaxon.com 


I am using JChem Base, the version I think is Marvin 5.3.7, and I want to place the license in the server with the web application, not locally. Place the license locally means have one license in every pc that uses the application, not?

It depends on where the do you call the API (e.g. where do you run the search).


If you use our API whjich needs the license on the server, then it is "local" from the running code's point of view.


Otherwise you either deply the non-server mode licenses on all client macines, or you need to a have a license that supports Server Usage, and then you can specify a URL on your server for the client application to fetch the license from.


Best regards,


Szilard

User 1f6738be65

04-09-2013 10:33:12

Ok. So I don't understand why, when I had the Evaluation license placed under the root of the project, into the directory called chemaxonLicense (path /chemaxonLicense/license.cxl) the license works well, and with the new license, says license is not valid? When the new license arrived, I only changed the old by the new, and it doesn't work anymore.


I have sent you the license again.

User 1f6738be65

05-09-2013 06:33:43










sram010 wrote:

Ok. So I don't understand why, when I had the Evaluation license placed under the root of the project, into the directory called chemaxonLicense (path /chemaxonLicense/license.cxl) the license works well, and with the new license, says license is not valid? When the new license arrived, I only changed the old by the new, and it doesn't work anymore.


I have sent you the license again.



Hi,


did you find a clue to this problem?


Thanks.

ChemAxon 9c0afc9aaf

05-09-2013 07:35:57

We have received the license file, and it seems to be fine.


BTW did you send the copy that was on the server ?


In rare cases opening and saving the license file in certain editors can render our licenese file invalid.


- Could you please clarify if the code that throws the exception and the license are on the same computer or not ?


- Could you please paste here the stack trace ?


- Also could you print from the code chemaxon.marvin.version.VersionInfo.MARVIN_VERSION ? (just to be sure about the version)


With this information we should be able to reprodece / tell more.


At this point we cannot tell for sure if this is a bug, however version 5.3.7 is quite old (more than 3 years), so we also suggest to consider an upgrade when it is possible (regardless of this problem).


Best regards,


Szilard

User 1f6738be65

05-09-2013 08:17:45

The license I sent you is the same license from the server and the same license you sent me.


I paste here the stackTrace I receive when I try to use de JChemSearcher object with the license placed in a directory under the root of the project (/chemaxon/license.cxl):


2013-09-05 09:44:04,881 [http-apr-8081-exec-27] ERROR chemaxon.jchem.base.persist.search.MolSetSearch - chemaxon.license.LicenseException: No valid license has been found.


Product name: JChem Base


License path: /chemaxon/license.cxl


Please contact sales _at_ chemaxon.com to obtain the corresponding license.


Students and academic researchers are entitled of free use


through our Academic Package, for more information


please visit: http://www.chemaxon.com/acpack_conditions.html


chemaxon.jchem.db.DatabaseSearchException: chemaxon.license.LicenseException: No valid license has been found.


Product name: JChem Base


License path: /chemaxon/license.cxl


Please contact sales _at_ chemaxon.com to obtain the corresponding license.


Students and academic researchers are entitled of free use


through our Academic Package, for more information


please visit: http://www.chemaxon.com/acpack_conditions.html


Caused by:


No valid license has been found.


Product name: JChem Base


License path: /chemaxon/license.cxl


Please contact sales _at_ chemaxon.com to obtain the corresponding license.


Students and academic researchers are entitled of free use


through our Academic Package, for more information


please visit: http://www.chemaxon.com/acpack_conditions.html


at chemaxon.jchem.db.JChemSearch.run(JChemSearch.java:1406)


at com.project.daoImpl.JChemStructureDaoImpl.structureExists(JChemStructureDaoImpl.java:87)


at com.project.controller.search.ProductController.structureExists(ProductController.java:322)


at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)


at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)


at java.lang.reflect.Method.invoke(Method.java:601)


If I do the same with the license placed in a directory locally in my pc (C:\Users\developer\chemaxon\license.cxl) the license works well.

ChemAxon 9c0afc9aaf

05-09-2013 09:00:49

 


- Could you please clarify if the code that throws the exception and the license are on the same computer or not ?

I'm afraid this point is still not clear, not sure where your affected code is running and what is the root of the project.


I seemst to me you get the exception from a code running on the client side (Windows), but you are trying to install the license on the server(Linux), right ?


In this case (if the licensed code runs on the client machine, and you want to deploy on the server only) you need to obtain a license with Server usage allowed, and point to some URL on the server. Of course this should be kept on a closed intranet, so the license is not accessible to the public.

User 1f6738be65

05-09-2013 09:20:46

Code that throws the exception:


LicenseManager.setLicenseFile("/chemaxon/license.cxl");


        ConnectionHandler ch = new ConnectionHandler(this.dataSource.getConnection(), ConnectionHandler.DEFAULT_PROPERTY_TABLE);


        try {


            JChemSearch searcher = new JChemSearch();


            searcher.setQueryStructure(mol);


            searcher.setConnectionHandler(ch);


            searcher.setStructureTable(this.jchemStructureTable);


            JChemSearchOptions searchOptions = new JChemSearchOptions(JChemSearch.FULL_FRAGMENT);


            searchOptions.setMaxResultCount(100);


            searchOptions.setMaxTime(60000);


            searchOptions.setExactQueryAtomMatching(false);


            searchOptions.setIsotopeMatching(0);


            searchOptions.setChargeMatching(0);


            searchOptions.setRadicalMatching(0);


            searchOptions.setDoubleBondStereoMatchingMode(StereoConstants.DBS_NONE);


            searcher.setSearchOptions(searchOptions);


            searcher.setRunMode(JChemSearch.RUN_MODE_SYNCH_COMPLETE);


            searcher.run(); <-- in this point the exception is thrown


            int[] hits = searcher.getResults();


// treatment of the results


} catch ...............


I put the license inside a directory in this path: /src/main/resources/chemaxon/license.cxl


When the project is deployed, the directory resources is the ROOT directory of the project, so in the end, /chemaxon directory is under the ROOT, and the path setLicenseFile("/chemaxon/license.cxl"); is correct. I do it like this because I want to have de license in the server inside the project, and access to the license "locally".


When I test the web application with Netbeans + Tomcat in my pc (not in server) and I place the license in setLicenseFile("C:\Users\Developer\chemaxon\license.cxl");, the license works fine!! The mystery is why with the Evaluation license, the path "/chemaxon/license.cxl" works well, and now with the new license I sent you this don't work.

ChemAxon 9c0afc9aaf

06-09-2013 10:45:45

 


LicenseManager.setLicenseFile("/chemaxon/license.cxl");

I think I misunderstood this and thought it was referring to a File path in the file system.


Is it a URL type path ?


All URL type paths (all paths which are not local file system paths) require Server mode licenses (we do not discriminate if they are resolved to local or remote locations).


Our Sales can issue such a license, but if I'm not mistaken it's not really needed here. 


Instead of deploying the license with the application, I suggest to set it via one of the ways described here on the server:


 http://www.chemaxon.com/marvin/help/licensedoc/installToServer.html


In general we recommend to keep the application and license deployment separate:


- So they can be upgraded / deployed independently (no need to re-deploy the app. to upgrade the license)


- One license might be applicable to  multiple applications 


- In case of mulitple deployments the allowed licenses may differ


Best regards,


Szilard

User 1f6738be65

09-09-2013 08:54:14

Hi,


I have acquired a Server mode license and this problem has been solved.


The path I use is LicenseManager.setLicenseFile("/chemaxon/license.cxl");


This is an absolute path inside the project placed in the server (so this path is relative inside the server system), but I'm afraid that server applications require server mode licenses if you want to place the license in the server side.


Thanks.