On 13 Sep 2005, at 15:21, Sami Dalouche wrote:

Hi,

thanks a lot James !
Concerning spring extension, is there any chance upstream spring will accept the
changes or will we have to use servicemix-specific Spring forever ?

I made the changes in Spring; though the spring folks are pushing back until 1.4 (sigh) until considering XML extensions. (No idea why, I've tried and tried).

So I'm gonna move the Spring enhancements to the gbean project as a gbean extension (http://gbean.org). The downside is this will mean folks will have to use a new little jar and use gbean versions of the standard Spring classes. e.g. org.gbean.spring.context.WebXmlApplicationContext etc - though the plus side is that ServiceMix and other libraries using the XML extension mechanism will then work with any Spring release.

If one day the spring team ever decide on a neat way to allow XML extension, then we can migrate to it - but its looking like being 6 months + away at the moment I'm afraid :(

James


Regards,
Sami Dalouche

Quoting James Strachan <[EMAIL PROTECTED]>:



On 29 Jul 2005, at 19:26, Matthew Parrish wrote:

I'm trying to use the ServiceMix XML syntax, but I'm getting the
following
error when deploying in my webapp:

org.xml.sax.SAXParseException: Document is invalid: no grammar found.


I hit this recently.



The spring xml files are getting loaded by the
org.springframework.web.context.ContextLoaderListener class as
defined in
web.xml.  I was able to run the document through a standalone app
to get the
vanilla spring config, and I've successfully deployed using that.

I guess I just have to wait until spring supports the XML changes
to use the
servicemix XML in my webapp. For now, I'm using plain vanilla spring
syntax.


I fixed this in CVS HEAD of ServiceMix by allowing a different
context loader to be used. Here's what I used in the web.xml...

   <context-param>
     <param-name>contextConfigLocation</param-name>
     <param-value>/WEB-INF/applicationContext.xml</param-value>
   </context-param>
   <context-param>
     <param-name>contextClass</param-name>
<param- value>org.servicemix.jbi.config.XmlWebApplicationContext</
param-value>
   </context-param>

   <listener>
     <listener-class>
       org.springframework.web.context.ContextLoaderListener
     </listener-class>
   </listener>

We've now got a sample WAR build in CVS HEAD to demonstrate using
ServiceMix inside a WAR using this technique in servicemix/tooling/
servicemix-web. This also includes a web based JMX management console.

James



Thanks for your help.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 28, 2005 10:34 PM
To: [email protected]
Subject: Re: [servicemix-user] RE: Spring and POJO support

Good catch Craig :)

Yeah, everything is totally possible using vanilla Spring XML - its
just
very verbose (especially the use of QNames) - which is one of the main
reasons for us pushing the envelope on Spring to make it easier.

One way to see what the XML looks like in vanilla spring is to enable
logging on a debug level then we output the full 'vanilla spring'
XML before
we initialise ServiceMix, so you can see what's truly gonna go into
Spring.

If you really needed it; I'm sure we could add a little tool to the
code to
take our XML and spit out regular Spring XML so that you could
deploy on any
Spring release. Note that it our Spring snapshot is an official
snapshot of
Spring; its just not an official version (its a little before 1.2.2
went
out).

Hopefully this XML situation with Spring will be resolved quite soon.


On 29 Jul 2005, at 02:07, Craig Walls wrote:


I've not yet got it to work yet (actually, I haven't tried it
yet...but am about to), but I think you're right about the
ActivationSpec class. I found http://cvs.servicemix.codehaus.org/
*checkout*/servicemix/base/src/test/resources/org/servicemix/jbi/
config/example-spring.xml?rev=HEAD linked to from James' blog and it
shows how to use ActivationSpec to wire up components using pure
Spring.

The good thing is that it's pure Spring XML...The problem is that
this
example is grotesquely verbose. I completely agree with the idea of extending Spring to make the XML more concise. It's just unfortunate
that we have to wait until Spring settles on a "standard" way of
extending Spring XML.


Matthew Parrish wrote:




I'm trying to accomplish a similar thing to what Craig was asking.
I'm trying to integrate ServiceMix into an existing application that uses Spring, and I'd like to keep the official spring jars. So, how do I configure JmsUsingJCA message consumption using the Spring XML
syntax?
Here's a snippet from the example doc's using ServiceMix syntax...
<component id="myJmsReceiver" service="foo:myJmsReceiver"
class="org.servicemix.components.jms.JmsInUsingJCABinding"
destinationService="foo:receiver">

 <property name="jcaContainer" ref="activeJcaContainer"/>

 <property name="activationSpec">
   <bean class="org.activemq.ra.ActiveMQActivationSpec">
     <property name="destination"
value="test.org.servicemix.example.jca"/>
     <property name="destinationType" value="javax.jms.Topic"/>
   </bean>
 </property>
</component>
How is this accomplished using the Spring XML syntax?  I'm
especially
interested in how to port destinationService="foo:receiver".  I'm
guessing that it might have to do with the ActivationSpec class, but
I haven't gotten it to work yet.  Any clues would be helpful.
Thanks,
Matthew

-- FROM Craig Walls --
Just to make sure I've got this straight...

If I use the extended Spring XML, then I can use the  element's
destinationService attribute to tell ServiceMix how to move messages
around.

But if I use the pure Spring XML, I must do something more like the
original example where the component was directly involved in
sending
the message.

Is this correct?

One other thing: It would help greatly if you could break up the
lines in the code examples so that "Printer-Friendly" would really
work.
Just a
friendly request.
-- END FROM Craig Walls --










James
-------
http://radio.weblogs.com/0112098/




James
-------
http://radio.weblogs.com/0112098/







----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



James
-------
http://radio.weblogs.com/0112098/

Reply via email to