my mistake its XBean 2.7, you can get it here
http://goopen.org/confluence/display...0/21/XBean+2.7
my mistake its XBean 2.7, you can get it here
http://goopen.org/confluence/display...0/21/XBean+2.7
Take 2.7 or 2.8 from here (I had 2.8 it worked)
http://people.apache.org/repo/m2-ibi...spring-2.8.jar
For the XBean "can't resolve bean" problem (as opposed to the Weblogic / Woodstox problem that Eliseo is talking about), check out the bottom of this XFire page
http://xfire.codehaus.org/services.xml+Reference:
Spring 2.x support
Because of Spring 2.x new feature, services.xml default namespace must not be declared on the root element of configuration ( beans ) and need to be moved to <service> tag level.
<beans>
<service xmlns="http://xfire.codehaus.org/config/1.0">
<name/>
<namespace/>
...
...
</service>
</beans>
I am also having a problem creating the namespace handler for v2b, with a root cause of not being able to find the class org/springframework/beans/factory/support/ReaderContext (I have checked the Spring JAR, and this class is absent).
I am using xfire-all-1.2.4, xbean-spring-2.8, wstx-asl-3.1.1, and spring-2.0.2.
I have tried adding the namespace within a <service> tag as described in the previous post but this doesn't seem to help.
Below is the error stack trace.
If anyone can comment I'd appreciate your insight. Thanks in advance.Code:java.lang.IllegalStateException: Unable to create namespace handler for: v2b at org.apache.xbean.spring.context.v2.XBeanV2Helper.createNamespaceHandler(XBeanV2Helper.java:48) at org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.<init>(XBeanNamespaceHandler.java:41) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:84) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:60) at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.initHandlerMappings(DefaultNamespaceHandlerResolver.java:122) at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.<init>(DefaultNamespaceHandlerResolver.java:96) at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.<init>(DefaultNamespaceHandlerResolver.java:82) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.createDefaultNamespaceHandlerResolver(XmlBeanDefinitionReader.java:526) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.createReaderContext(XmlBeanDefinitionReader.java:515) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:495) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:340) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:317) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:125) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:141) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:123) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:91) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:94) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:292) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:698) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:709) at org.apache.catalina.startup.Catalina.start(Catalina.java:551) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432) Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/support/ReaderContext at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.apache.xbean.spring.context.v2.XBeanV2Helper.createNamespaceHandler(XBeanV2Helper.java:45)
--James
Hi
I just run XFire book sample with Spring 2.0.2 with no problems.
>> I have tried adding the namespace within a <service> tag as described
Did you remove that namespace from bean tag ?
Hi, I am having a problem with registering a service in services.xml with xfire-1.2.4 and spring 2.0.2. I use xbean-spring-2.7 and wstx-asl-3.2.0 provided with xfire distribution. Currently our services.xml looks like this:
<beans>
<bean id="datasetService"
class="pl.infovide.crf.dataset.services.DataSetSer viceImpl" />
<service xmlns="http://xfire.codehaus.org/config/1.0">
<serviceBean>#datasetService</serviceBean>
<serviceFactory>#jaxbServiceFactory</serviceFactory>
<style>document</style>
<inHandlers>
<handler
handlerClass="org.codehaus.xfire.util.dom.DOMInHan dler" />
<bean
class="org.codehaus.xfire.security.wss4j.WSS4JInHa ndler" xmlns="">
<property name="properties">
<props>
<prop key="action">UsernameToken</prop>
<prop key="passwordCallbackClass">
pl.infovide.crf.dataset.services.PasswordHandler
</prop>
</props>
</property>
</bean>
</inHandlers>
</service>
<bean name="jaxbServiceFactory"
class="org.codehaus.xfire.jaxb2.JaxbServiceFactory ">
<constructor-arg ref="xfire.transportManager" />
</bean>
</beans>
I use XFireConfigurableServlet form xfire-spring-1.2.4. When I try to list registered services with url mapped to XFire servlet, I get the following exception:
org.springframework.beans.factory.BeanDefinitionSt oreException: Unexpected exception parsing XML document from class path resource [META-INF/xfire/services.xml]; nested exception is java.lang.IllegalArgumentException: Cannot locate BeanDefinitionDecorator for attribute [xmlns].
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:412)
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:340)
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:317)
at org.codehaus.xfire.spring.XFireConfigLoader.getXFi reApplicationContext(XFireConfigLoader.java:103)
at org.codehaus.xfire.spring.XFireConfigLoader.loadCo ntext(XFireConfigLoader.java:41)
at org.codehaus.xfire.transport.http.XFireConfigurabl eServlet.loadConfig(XFireConfigurableServlet.java: 86)
at org.codehaus.xfire.transport.http.XFireConfigurabl eServlet.createXFire(XFireConfigurableServlet.java :54)
at org.codehaus.xfire.transport.http.XFireServlet.ini t(XFireServlet.java:45)
Removing xmlns set to http://xfire.codehaus.org/config/1.0 results with no registered services, logs from XFireConfigurableServlet state that there where no services found.
We had been using spring1.2.8 and xfire1.2.2 before migrating to spring2 with xfire1.2.4 and this services.xml with default namesapce declared in 'beans' element worked fine. After having migrated to spring2 we started to have problems with xfire1.2.2, so we tried to upgrade to 1.2.4 with provided xbean-spring 2.7, but without any success.
Could any one give me a hint how to solve the problem, I will greatly appreciate any help,
Thank you in advance.
Hi
Its hard to tell what exactly is wrong without trying to reproduce this on my machine ( i can't do it right now ) :/ But because most of your config is in "plain" spring format you can replace <service> tag with its spring representation : ServiceBean bean. Then you can get rid of xbean namespace, so xbean-spring won't try parsing config entries and don't break anything
If you want to use <service> tag anyway, then you can create simple project which can reproduce your problem and send it on xfire mailing, i'm sure someone will helpl
Hi, thank you very much for your quick reply, After further investigation, I have noticed that the entry within 'inHandler' defining handler impl with the overriden namespace xmlns="" was the source of the exception. In the xfire user guide section, there is a suggestion to mark all of the spring beans within service namespace to xmlns="", but in my case this caused an error. Changing services.xml to the following solved the problem:
Code:<beans> <bean id="datasetService" class="pl.infovide.crf.dataset.services.DataSetServiceImpl" /> <service xmlns="http://xfire.codehaus.org/config/1.0" xmlns:s="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-2.0.xsd"> <serviceBean>#datasetService</serviceBean> <serviceFactory>#jaxbServiceFactory</serviceFactory> <style>document</style> <inHandlers> <handler handlerClass="org.codehaus.xfire.util.dom.DOMInHandler" /> <s:bean class="org.codehaus.xfire.security.wss4j.WSS4JInHandler"> <s:property name="properties"> <s:props> <s:prop key="action">UsernameToken</s:prop> <s:prop key="passwordCallbackClass"> pl.infovide.crf.dataset.services.PasswordHandler </s:prop> </s:props> </s:property> </s:bean> </inHandlers> </service> <bean name="jaxbServiceFactory" class="org.codehaus.xfire.jaxb2.JaxbServiceFactory"> <constructor-arg ref="xfire.transportManager" /> </bean> </beans>
The problem i was reporting in this thread is a mysterious error 417
So it turns out this error is nothing more then an http error code "Expectation Failed". Here is how this error is described here: http://www.modemhelp.net/httperrors/417.shtml
The client's expect header requested certain server behaviors that the server could not perform.
So at this point i pretty much traced it to the lighttpd that i'm trying to frontend my WS with (everything works fine in the local configuration).
There is something catchy going on on the http header level that lighttpd refuses to process.
Although it turns out to be a not a Spring problem, i would greatly appreciate any help, suggestion, perhaps cross-reference to some other forum. Is anybody out there ever tried to frontend a WS with lighttpd? Is there anything special that the client must do with the http header to make it work in this configuration?
really appreciate any feedback