December 11th, 2007
My previous problem where the XSLT processor was outputting an unclosed meta tag has been solved. The W3C XSLT spec specifies that the processor should not output a new meta tag if there is one already present. Thus the way to fix the output so it did not add a meta tag was to insert one myself. However there are a few things to note. It will only do it within an html element that has the xhtml namespace. Also, if you do not have a trailing space before the closing / it will not work. See my example below (note I tried to use include-content-type=”no” which may or may not have worked. It takes a while to recompile and deploy the service-unit so I haven’t tried it):
<xsl:output method="xhtml" include-content-type="no"/>
<xsl:template match="result">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />
...
No Comments | In: ServiceMix, Summer Project | | #
December 10th, 2007
The tutorial app I wrote is now working. There were a few different problems. Firstly, I had removed some information about the secured broker in servicemix.xml and replaced it with a single flow name in a container attribute. I had forgotten about this until I reloaded the config from the distribution. Secondly, I needed to set up multiple static network connectors in activemq.xml, not a single one with multiple I.P. addresses. If put multiple I.P. addresses in a single static() block it will pick one at random and try to connect to it, doing this until it finds a working one then stopping. What is needed is multiple networkConnector elements with a single I.P. address in each static() block. I didn’t initially know how to do this because if I put two in it would give me an error. This leads to the next point. Thirdly, each networkConnector element needs a unique name (within the broker). So I gave them a name attribute corresponding to the ServiceMix instance they were connecting to. Fourthly, messages from the HTTP consumer service unit cannot be delivered to an endpoint on another ServiceMix instance (at least in my experience). I will post this to the mailing list later to see if there is a reason for this. Fifthly, and most importantly, ServiceMix 3.1.2 just plain does not work in my configuration. Upgrading to 3.2.1 fixed this and everything finally works. Well, except for my XSL transformation. They must have upgraded to a newer version of the XSLT processor (or used a different one), because it now ignores the directives I gave it telling it not to put unclosed <META> tags in because it does that now, even in XML output mode. My root element is an <html> so it may be overriding the xsl:ouput element (which it shouldn’t). If the XSL transformation does not output valid XML (which requires all tags to be closed) then ServiceMix cannot pass the HTML back to jetty to display to the user. This is my next task.
No Comments | In: ServiceMix, Summer Project | | #
December 4th, 2007
I’m still having major issues with ServiceMix. The ServiceMix instances will not connect to each other at all. I’ve tried everything I can find to configure ActiveMQ to allow message passing between them, but nothing has come of it yet. There are a few tcp connections between the two instances that I can see with netstat, but it doesn’t show up in jconsole. It has to be an issue with connecting ActiveMQ instances on separate machines, as it seems to work just fine when the ServiceMix instances are both on the same machine. Another puzzling aspect is that the cluster example that ships with ServiceMix works fine across machines, but if I hot deploy components to it instead of using static deployment then they cannot be seen by the other ServiceMix instance. I may have to re-write the config for my application to a static deployment, but I would like to know how to get it working dynamically. This should keep me busy for the week.
No Comments | In: ServiceMix, Summer Project | | #
December 3rd, 2007
I’ve spent most of today trying to discover why my ServiceMix tutorial application won’t work when I split the service units across multiple ServiceMix instances. Although I have specified that I am using the JMS message flow and the ActiveMQ brokers seem to be talking, the messages are not getting delivered. The message sent into the HTTP BC just gives back an exception about not being able to write a non xml fault to a non soap request. I have eliminated the virtual machines as the source of the error – this happens between instances running on separate windows machines within our home LAN as well. I have made sure that it is possible to have ServiceMix instances auto-discover each other by running the Cluster example on two separate machines. I have also checked that the Cluster example works between virtual machines. I can only assume that there is a problem in how ServiceMix is set up by default – something I will have to check by trying to create a simple example that is deployed rather than uses a stand-alone ServiceMix instance. Another option is to upgrade to the latest version of ServiceMix and see if they have changed the configuration (I didn’t want to upgrade as I’ve written and tested the tutorial on 3.1.2).
No Comments | In: ServiceMix, Summer Project | | #