This is a good expanation Chris, thanks. I havent been using the xbeans facilities available through xfire, but after seeing that you can do this with spring2, I'm going to try as well. It makes sense that the namespace for the xml defined by xfire must be in the xfire namespace. Otherwise it will belong to the default namespace, in this case spring beans namespace, and xbeans will not process it when configuring xfire! Another way to do this is as follows, using namespace prefix to clean it up (arguably though, some poeple prefer not to use prefix):
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xf="http://xfire.codehaus.org/config/1.0" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <xf:xfire> <xf:transports> <bean id="jmsTransport" class="org.codehaus.xfire.transport.jms.JMSTransport" <constructor-arg ref="xfire"/> <constructor-arg ref="connectionFactory"/> </bean> </xf:transports> </xf:xfire> <xf:service xmlns:e="urn:Echo"> <xf:name>Echo</xf:name> <xf:serviceClass>org.codehaus.xfire.test.Echo</xf:serviceClass> <xf:implementationClass>org.codehaus.xfire.test.EchoImpl</xf:implementationClass> <xf:bindings> <xf:soap11Binding name="e:EchoJMSBinding" transport="urn:xfire:transport:jms"> <xf:endpoints> <xf:endpoint name="e:EchoJMSEndpoint" url="jms://Echo" /> </xf:endpoints> </xf:soap11Binding> </xf:bindings> </xf:service> </beans> Note that I declared the xfire namespace on the root element as a prefix 'xf', and then simply prefixed xfire specific elements with 'xf', making sure to leave it off spring specific elements. Thatcher ----- Original Message ----- From: Dan Diephouse To: [email protected] Sent: Wednesday, December 13, 2006 5:10 AM Subject: Re: [xfire-user] Re: JMS Transport not registering: throwing NullPointerException Hi Chris, Just saw your response to your own posting after I posted my response. Sorry we weren't able to get back to you in time, but thanks for posting a detailed response to the list! It will undoubtedly be helpful to others. Cheers, - Dan On 12/12/06, Chris Mathrusse <[EMAIL PROTECTED]> wrote: Seeing as I could get no one to respond to my problem I thought that it would be worth following up with the resolution to the problem. After much time spent trying to resolve this issue and many different configurations I finally found the resolution to this issue. The problem is associated with the way that the service and transports must be registerd. As I am using Spring 2.0 for my application you must define the services.xml file root element as follows: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> This creates the problem for XFire when trying to define the service. FOr the service definition to work correctly you must define the service root element as follows: <service xmlns="http://xfire.codehaus.org/config/1.0"> This is documented in the JMS transport document. The one thing that the document fails to tell you is that you must specify the xmlns when registering the JMS transport, as follows: <xfire xmlns=" http://xfire.codehaus.org/config/1.0"> <transports> <bean id="jmsTransport" class="org.codehaus.xfire.transport.jms.JMSTransport " xmlns="http://xbean.org/schemas/spring/1.0"> <constructor-arg ref="xfire"/> <constructor-arg ref="jmsConnectionFactory"/> </bean> </transports> </xfire> If you fail to specify the xmlns then XFire will not register the JMS transport for you. This is something that should be captured in the documentation and emphasized. --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email -- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog
