I am trying to create SOAP webservice with the PLAY Framework, referred the sample from http://www.imind.eu/web/2013/11/07/developing-soap-services-using-play-framework-2-2-x/ . When I tried to execute the sample , getting this error. Please find my code as below. I not really sure what's the issue with the sample.
ERROR:
! @75olpeh6j - Internal server error, for (GET) [/service/hello?wsdl] ->
play.api.PlayException: Cannot init the Global object[Error creating bean with name 'org.apache.cxf.transport.play.CxfController#0' defined in class path resource [cxf.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.cxf.transport.play.CxfController$]: Factory method 'getInstance' threw exception; nested exception is java.lang.AbstractMethodError: org.apache.cxf.transport.play.CxfController$.play$api$mvc$Results$_setter_$TooManyRequests_$eq(Lplay/api/mvc/Results$Status;)V]
at play.api.GlobalSettings$.apply(GlobalSettings.scala:229)
at play.api.inject.guice.GuiceApplicationBuilder$$anonfun$1.apply(GuiceApplicationBuilder.scala:99)
at play.api.inject.guice.GuiceApplicationBuilder$$anonfun$1.apply(GuiceApplicationBuilder.scala:99)
at scala.Option.getOrElse(Option.scala:121)
at play.api.inject.guice.GuiceApplicationBuilder.applicationModule(GuiceApplicationBuilder.scala:99)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:123)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:168)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:164)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.transport.play.CxfController#0' defined in class path resource [cxf.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.cxf.transport.play.CxfController$]: Factory method 'getInstance' threw exception; nested exception is java.lang.AbstractMethodError: org.apache.cxf.transport.play.CxfController$.play$api$mvc$Results$_setter_$TooManyRequests_$eq(Lplay/api/mvc/Results$Status;)V
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:583)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1249)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1098)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:756)
Global.java:
import play.*;
import play.libs.*;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import play.Application;
import play.GlobalSettings;
public class Global extends GlobalSettings {
protected ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
@Override
public void onStart(Application app) {
ctx.start();
}
@Override
public void onStop(Application app) {
ctx.stop();
}
}
applicationContext.xml:
<!-- applicationContext.xml -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
">
<!-- Import Apache CXF configuration and Play! transport plugin. -->
<import resource="classpath:cxf.xml"/>
<!-- Define Hello World endpoint. It will be available at http://localhost:9000/service/hello -->
<jaxws:endpoint name="helloWorld"
transportId="http://schemas.xmlsoap.org/soap/http"
address="/service/hello"
implementor="services.hello.HelloWorldImpl"/>
</beans>
build.sbt
name := "play-cxf-hello"
version := "1.0-SNAPSHOT"
scalaVersion := "2.11.7"
libraryDependencies += "org.springframework" % "spring-context" % 5.0.1.RELEASE"
libraryDependencies += "eu.imind.play" %% "play-cxf_play24" % "1.2.1"
libraryDependencies += "org.apache.cxf" % "cxf-rt-bindings-soap" % "3.1.7"
libraryDependencies += "org.apache.cxf" % "cxf-rt-frontend-jaxws" % "3.1.7"
lazy val root = (project in file(".")).enablePlugins(PlayJava)
plugins.sbt
// Comment to get more information during initialization
logLevel := Level.Warn
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
resolvers += Resolver.typesafeRepo("releases")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.10")