Error on Structure Search

User dfeb81947d

31-03-2009 16:31:09

Dear Support,








Recently, not on every client there is an unusual exception:
Quote:



java.lang.NegativeArraySizeException


at chemaxon.util.IntVector.<init>(IntVector.java:53)


at chemaxon.util.IntVector.<init>(IntVector.java:63)


at chemaxon.jchem.db.JChemSearch.search1(JChemSearch.java:2485)


at chemaxon.jchem.db.JChemSearch.search(JChemSearch.java:2340)


at chemaxon.jchem.db.JChemSearch.setRunning(JChemSearch.java:2172)


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


The structure search is executed through a web application on a tomcat server. The webserver is based on JChem 5.1.4, with marvin sketcher.


The clients are using Internet Explorer 6 and Internet Explorer 7





Some clients have no exception, and structure search works fine, but some others have this exception.


I'm actually not able to reproduce the exception.





What could be the problem that cause this kind of exception?


I'm searching a way to find the problem, and I'd llike to know if a molecule wrongly designed could be an origin of the problem?





What are the conditions to get this NegativeArraySizeException?








Thank you very much for your help





Best Regards,


Jacques

ChemAxon e274e1bada

01-04-2009 10:05:13

Hi,





please check your web application if you use setMaxResultCount(int maxResultCount) in the JChemSearchOptions. The users may be able to set the maxResultCount parameter to a negative value.


In this case we will throw an IllegalArgumentException in the following versions, and make the API doc clearer.





Best Regards, Edvard

User dfeb81947d

01-04-2009 10:44:02

Thank you very much, that's exactly the problem.


The value of max result count was based on field text, and the value was greater than integer.





What was executed is setMaxResultCount(Integer.MAX_VALUE + 1)








Thank you so far, it helped a lot.





Best Regards


Jacques