no structures display when using mod_jk connector

User f52820d97e

17-06-2009 16:30:51

Hi,


Here is my lates problem: I figured out how to organize the webservices within tomcat (a detailed post on the procedure will come soon), provided modifications of the config.xml file.
Everything works fine if I use the provided tomcat (on the port 8180) distrib or if I build my own (tomcat 6.0.20, port 8080 by default).


However, when I try to use apache httpd-2.2.11 as a frontend for my tomcat-6.0.20, with the mod_jk connector
http://wiki.apache.org/tomcat/FAQ/Connectors />http://wiki.apache.org/tomcat/HowTo#head-faca74f37dba8108508863f93dc6c78ab716af1


In that case, from what I understand, there is some port forwarding using the ajp13 protocol (between jk-8009 and http-80 it seems).


In that case, everything works except the structure display in the result table. Is there a conflict with Marvinview ? I don't know... If you have any idea...


Cheers,


Nicolas

User f52820d97e

18-06-2009 08:45:51

no need to bang your head trying to answer to me... I have a problem with the latest versions of tomcat and apache and the mod_jk connector (I have been using oldest versions), I read that mod_proxy is simpler, I am going to try that. I'll keep you posted!

User f52820d97e

19-06-2009 13:53:35

I think I have identified my problem. I re-created the tomcat
interface from the pieces in your web services distrib, with a simpler
architecture - all in one ajax interface, except the axis2 services,
and no need to put it in the ROOT (see war deployment file attached here: http://xfer.curie.fr/get/nPqlPD9fmfR/ajax.war).


I used the very same ports that you have in your server.xml file. I
can see the ajax examples fine when using the tomcat URL on port 8180.


When I use apache httpd as a frontend with the mod_proxy module, and
the ajp connector listening on port 8109, everything works fine except
the image production. I can identify the error coming from the img.jsp
file, with this stack trace in the tomcat localhost.YYY-MM-DD.log file:


19 juin 2009 15:29:46 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: "Servlet.service()" pour la servlet jsp a généré une exception
java.lang.ArrayIndexOutOfBoundsException: 1
at org.apache.jsp.jsp.img_jsp._jspService(img_jsp.java:85)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)


It is as far as I can go in the debugging, now I am at a lost.


Thank you in advance for any help you can provide...


Nicolas

ChemAxon ebbce65bcf

22-06-2009 09:18:51

Hi Nicolas,


We experience a similar problem when using https, so it seems to be a general issue. We are trying to find a solution for the image generation, however it is not that trivial we thought at first. Be patient, please.


Thank you,


Roland

User f52820d97e

22-06-2009 09:27:21

Great, I'm glad you understand and try to tackle the problem. I'll be patient!


Thanks


Nicolas

ChemAxon ebbce65bcf

22-06-2009 14:41:06

After some investigation I found that maybe your problem is not the same as ours. But I have some ideas. Please open ajax/jsp/img.jsp for editing. Around line 35 there will be the following:


port = (hostAndPort[1] == null ? 8180 : Integer.valueOf(hostAndPort[1]));


At first try to set port to 8109 or 80 (e.g. modify this line to: port = 8109;). If you does not succeed, undo your changes and try to print "host" and "port" variables after this line using:


out.println(host+" "+port);


To achive this without error messages you must comment out all lines after this one (use: /* ... */). And please tell me your results. :)

User f52820d97e

22-06-2009 15:49:55

When I changed to port 8109 I have this stack trace


22 juin 2009 17:45:41 org.apache.jk.common.MsgAjp processHeader
GRAVE: BAD packet signature 20559
22 juin 2009 17:45:41 org.apache.jk.common.ChannelSocket processConnection
GRAVE: Error, processing connection
java.lang.IndexOutOfBoundsException
at java.io.BufferedInputStream.read(BufferedInputStream.java:310)
at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:621)
at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:578)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:686)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)


But when I change to port 80 it works, perfectly!


Thank you very much!!!


Nicolas

ChemAxon ebbce65bcf

26-06-2009 13:43:38

Nicolas,


Just came to my mind that export.jsp needs to be changed, too, otherwise exporting molecules functionality won't work. The way is the same as with img.jsp. However I am not sure that this hack is needed. In config.xml you can define jsp paths.


This was the default configuration:


<jspPath>
 <getimage>/ajax/jsp/img.jsp</getimage>
 <export>/ajax/jsp/export.jsp</export>
</jspPath>


But here not only relative path can be given but absolute path, as well. Now we know that your webservice can recieve requests on port 80. I assume that your jsp-s can be accessed on port 80 so you can make a configuration like this.


<jspPath>
 <getimage>http://<yourdomain>:80.../ajax/jsp/img.jsp</getimage>
 <export>http://<yourdomain>:80/.../ajax/jsp/export.jsp</export>
</jspPath>


Here we define port 80 explicitly, which is a bit weird, but it is because our default is 8180 in the jsp-s. Could you try it, please? If it works you can undo your changes in img.jsp, and nothing must be changed in export.jsp.


Thanks,


Roland

User f52820d97e

29-06-2009 15:30:15

Hi Roland,


Indeed the export does give me this exception:


exception
org.apache.jasper.JasperException: java.lang.ArrayIndexOutOfBoundsException: 1
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
parent cause
java.lang.ArrayIndexOutOfBoundsException: 1 org.apache.jsp.jsp.export_jsp._jspService(export_jsp.java:82) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


When I try to change the config.xml with the absolute path, with port 80, 8180 or even nothing, I have the same exceptions and the img.jsp (original) does not show any structures either...


Cheers,


Nicolas

User f52820d97e

29-06-2009 16:26:16

Some follow-up...


I managed to make the export work by changing the line 30 in export.jsp into port = 80


I had to change the heap size in tomcat though, and the sdf file generated (with 8 structures, because it was very slow otherwise) gives me a  "Line too short in bond block" exception in mview...

ChemAxon ebbce65bcf

06-07-2009 11:14:20

Nicolas,


Sorry for this late answer. Could you attach the sdf file, please? Does this error appear permanently with every export outputs, or only in special cases? Anyway maybe we could use another wrong export outputs to find out what causes the problem.


Cheers,


Roland

User f52820d97e

06-07-2009 14:03:02

Hi,


Here is a sample. It looks like it happens in every export, I tried with several queries (a few hundred molecules), I get this error "line too short in atom block".


I should also mention it takes forever with more than a few thousand molecules...


Nicolas

ChemAxon 7c2d26e5cf

08-07-2009 14:44:44

I have checked the "export.sdf" file with molconverter. Fortunatelly, the error message was very informative:


export.sdf:194: error in molecule 5: Line too short in atom block.Although I am not an expert in SD file format but the trash characters and wrong indentation of the refered code was suspecious, immediatelly.


    3.0542
8
  -3.241
1ff8
7    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
The correct code is:


    3.0542   -3.2418    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0There are similar indentation problems in a few further records.


You can read more about the SD file format in the documentation:
http://www.chemaxon.com/marvin/help/formats/mol-csmol-doc.html#mol