Export to SDF from two tables with Class Exporter

User b8eed45673

25-01-2008 12:07:00

Is there a possibility to export some fields from two or more tables to SD-file?





Alternatively, I'm looking for inserting an arbitrary field into SD-file being exported (outside of the table)

ChemAxon 9c0afc9aaf

25-01-2008 12:12:44

Hi,





Please see Exporter.setSelectStatement() :





http://www.chemaxon.com/jchem/doc/api/chemaxon/jchem/db/Exporter.html#setSelectStatement(java.lang.String)





Best regards,





Szilard

User b8eed45673

01-02-2008 17:16:11

Thank you!


But I have some problems with this method.


Query like "SELECT cd_structure from table where cd_id in(1,2,3,4,5)" works fine. However, when I add up other fields, for example:


"SELECT cd_structure, cd_formula from table where cd_id in(1,2,3,4,5)" leads to the method error: writeAll() (NullPointerException).


Both queries work fine from mysql-client

ChemAxon 9c0afc9aaf

01-02-2008 20:35:58

Hi,





Could you let us know the JChem version you are using ?


(please always state this when submitting a support request)





Also could you paste here the full stack trace of the exception ?





Thank you,





Szilard

User b8eed45673

04-02-2008 13:18:58

SEVERE: Servlet.service() for servlet jsp threw exception





java.lang.NullPointerException





at java.lang.String.<init>(Unknown Source)





at org.apache.jsp.last_005fr.export_jsp._jspService(org.apache.jsp.last_005fr.export_jsp:225)





at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)





at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)





at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)





at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)





at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)





at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)





at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)





at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)





at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)





at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)





at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)





at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)





at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)





at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)





at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)





at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)





at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)





at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)





at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)





at java.lang.Thread.run(Unknown Source)











java -jar jchem.jar





JChem version: 3.2.6


Table version: 37 (for determining if regeneration is necessary)

ChemAxon 9c0afc9aaf

04-02-2008 15:54:21

Hi,





Thank you for providing the requested information.





Unfortunately the stack trace is not very informative, not a single ChemAxon class was listed.


If you happen to have more related error text in the Tomcat log (maybe in catalina.out) it could be useful for us.





We will try to reproduce the problem with version 3.2.6 regardless, and get back to you soon.





Best regards,





Szilard

ChemAxon 9c0afc9aaf

04-02-2008 19:26:57

Hi,





Never mind the stack trace, we have successfully reproduced the problem.





After a quick analysis it seems the bug affected the whole 3.2.x series and it's also present in the latest release.





We will fix this in for the upcoming minor release (5.0.1) expected in about two weeks.





Best regards,





Szilard

ChemAxon 9c0afc9aaf

09-02-2008 10:25:28

The bug has been fixed, and this will work fine in the next minor release (5.0.1) as mentioned.





Currently we do not plan an other patch release for 3.2.x, but if very important for you or anyone else I may prepare a modified 3.2.12 jchem.jar with only this specific change.





Bes regards,





Szilard