User 4aa76e4623
25-08-2014 07:59:26
I am using
the following code in order to search in the structure tables of my relational
database but I am getting the following exception.
Code:
JChemSearch searcher = new JChemSearch();
searcher.setConnectionHandler(ch);
searcher.setStructureTable(structureTableName);
searcher.setInfoToStdError(true);
searcher.run();
Exception:
Exception
in thread "Attach Listener" java.lang.reflect.InvocationTargetException
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at
java.lang.reflect.Method.invoke(Method.java:597)
at
sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323)
at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:348)
Caused by:
java.lang.IllegalStateException: Instrumentation has already value.
at
chemaxon.agent.InstrumentationHolder.premain(InstrumentationHolder.java:31)
at chemaxon.agent.InstrumentationHolder.agentmain(InstrumentationHolder.java:42)
... 6 more
Agent
failed to start!
This error
is displayed because of the setInfoToStdError(true), in case I set this to false
then I don’t get it.
(http://www.chemaxon.com/jchem/doc/dev/java/api/chemaxon/jchem/db/JChemSearch.html#setInfoToStdError%28boolean%29)
Can you explain
me why this exception is thrown from the InstrumentationHolder?
Thank you,