Multi User Installation using Tomcat+Apache

Post Reply
tchaffee
Posts: 6
Joined: 25 May 2009, 17:26

I have a multi user installation on Windows Vista and everything was working fine with just Tomcat. However we need Apache as well and now that I have Apache working with Tomcat the "Publish Repository" option is not working. The message we get is: "Failed to send snapshot to the Report Service :
Server error. The URL appears to OK but sending the repository snapshot could not be completed. Check server for errors such as memory."

Any help is appreciated.
tchaffee
Posts: 6
Joined: 25 May 2009, 17:26

Update: the changes do seem to be making it to the report viewer despite the error.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

This error indicates that the server process running in the Essential Viewer has raised an exception of some sort - at the very least the positive, success status is not being returned to the client (the report publishing tab).

Could you check in the catalina.out file in your Tomcat installation for any errors? Also, in the Essential Viewer root directory, check that the reportXML.xml file ([Tomcat]/webapps/essential_viewer/reportXML.xml) is complete and is not truncated. If Tomcat runs out of memory, this XML document can get truncated which breaks some of the reports.

Just so that I understand your configuration, you've installed the Apache webserver 'in front of' Tomcat (rather than using the default web server supplied by Tomcat)?
Is it possible that Apache is in some way affecting the response code from the server? On success the server returns a '1', and '0' for an error to the client.

Thanks

Jonathan
Essential Project Team
tchaffee
Posts: 6
Joined: 25 May 2009, 17:26

The catalina log has no errors and the reportXML.xml file seems complete (starts and ends with knowledgebase tag). Yes, Apache is the frontend which serves the static html. Requests towards Tomcat urls are forwarded to a Tomcat worker. It's possible that Apache is doing something with the response, however other webapps are working. Is there any way I could see what response Apache is sending? Are you POSTing to /essential_viewer/reportService? If you could give me the parameters and I could quickly contruct an HTML form to try to capture the response.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Yes, the report service expects an HTTP Post as follows (from the Javadoc):
To use this service, send an HTTP POST with the following parameters
  • "action" = "report"
  • "kbXML" = <XML document of the Protege knowledge base>
So grab a copy (or a cut down copy) of your reportXML.xml and pass the contents of that in the kbXML parameter. The 'action' parameter should always be 'report'.

Let me know how you get on

Thanks

Jonathan
Essential Project Team
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Just had another look at the source code.
The report service (that receives the XML snapshot from the Protege tab) is setting the status on the HTTP response, as there's no response content (e.g. there's no HTML page to send back to the Protege tab). Perhaps there's some setting in Apache that is available to get it to pass on the response status?

Jonathan
Essential Project Team
tchaffee
Posts: 6
Joined: 25 May 2009, 17:26

I used telnet to create the POST header and send a small XML file. The XML file makes it OK to the essential_viewer webapp but the response header is the following:

HTTP/1.1 500 Internal Server Error
Date: Thu, 28 May 2009 08:57:29 GMT
Server: Apache/2.2.11 (Win32) PHP/5.2.9-2 mod_jk/1.2.28
Content-Length: 0
Content-Type: text/plain

Strange, because it give no details of the error. It seems like the webapp is choking on something and reporting that back to apache which passes the header back to the client (in this case telnet).
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Thanks for getting back to me on this.
I've had a look at the source code for the mod_jk to see what it does with the response from Tomcat. Basically, if the webapp returns an HTTP response status that is not in the standard set, the Apache/Tomcat adapter (mod_jk) takes this as a 500 and hence the reply that you are getting.

As I mentioned in a previous post, the webapp returns a status of '1' on success and '0' on error and these were deliberately to not be the standard HTTP status codes. It is now clear that that was not the right decision and this is a bug in the Apache+Tomcat scenario that you are using.

I will get an update of the Essential Widgets (where the ReportTab lives) and the Essential Viewer (where the webapp lives) posted very shortly to fix this (assuming I don't run into unexpected problems). I'll post here when the update is available but hopefully over the next day or so.

Thanks for help tracking this issue down

Jonathan
Essential Project Team
tchaffee
Posts: 6
Joined: 25 May 2009, 17:26

Hi Jonathan, great that you are working with open source and were able to find the mod_jk / Apache "feature" so quickly. I should be able to try out your fix later next week if it's ready by then. In the meantime I've just taken Apache out of the loop. Thanks for all your help on this.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

I've made the required software updates that should fix the Apache issue but I would like to confirm that they do resolve the issue that you have before I release them fully.

Could you download these 2 updates and verify that the Repository Publishing works properly (i.e. gets a success message) when you have Apache as the webserver instead of the default Tomcat webserver?

There are 2 updates as follows:
  • Essential Widgets (change to the Architecture Reporting Tab).
  • Essential Viewer (change to the Essential Viewer ReportingService that receives the published repository snapshot from Protege).
These should be installed as per the installation guides, as follows: Don't hesitate to let me know if you have any problems with these updates.

Jonathan
Essential Project Team
tchaffee
Posts: 6
Joined: 25 May 2009, 17:26

The fix works for me. Thanks for the quick response.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

That's great news. Thanks for getting back to us and for your help in tracking this down.
I'll now release this as an update to the Essential Software.

Jonathan
Essential Project Team
wolske
Posts: 3
Joined: 09 Jun 2009, 15:33

I'm having similar symptoms, though clearly it's a different problem. I'm NOT using Apache, it's straight-to-Tomcat6.

I installed the patches you posted above, and I still get an error on the Protege-side telling me to look at memory problems on the server.

The file reportXML.xml in web_apps appears to be complete; it ends with </knowledge_base> and it's 715K.

Here's the error I find in my catalina.log:
SEVERE: Error reading tld listeners javax.servlet.ServletException: Exception processing TLD at resource path /WEB-INF/x.tld in context /essential_viewer javax.servlet.ServletException: Exception processing TLD at resource path /WEB-INF/x.tld in context /essential_viewer

Any help would be appreciated. [cw]
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

For some reason there seems to be a problem with the x.tld tag library in the Essential Viewer webapp - most likely as the servlet is loaded by Tomcat as this particular servlet (for receiving the published repository) does not use any tag libraries. We have tested on Tomcat 6 but we'll take a further look at this and get back to you as soon as we can.

Jonathan
Essential Project Team
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

We've tested this again with Tomcat 6 and have not been able to replicate this issue.

Could you try some further things to help narrow down where the issue lies?
  • Does Essential Viewer work? Open a browser and go to http://<your host>:8080/essential_viewer
  • Do you have more details from catalina.out? Is Tomcat starting anyway, or is this error being reported each time you try to publish from Protege?
    Are there more details about the error logged after the line that you posted?
  • It's worth checking the timestamp on your reportXML.xml file. A default one is shipped with Essential Viewer that is around the size you describe, so it may not actually be being received.
Finally, can you tell us precisely what versions of Tomcat, Java etc. you are using?

Thanks very much

Jonathan
Essential Project Team
Post Reply