2017-02-19 13 views
0

CXFサービスのタイムアウトを指定しようとしています。 私はJAX-RSとCXFと一緒にPlay Frameworkを使用しています(私は複数のバージョン、3.07と3.10を試しました)。CXFタイムアウトを設定しようとすると例外が発生する

これは私が得る例外です:私は唯一のhttp-confの場合は、このメッセージを受け取る

 
2017-02-19 13:07:09,786 [error] - controllers.GPSWebServiceController - Error calling wsSanctionsPEPCheckV2 operation on GPS endpoint. 
java.util.concurrent.CompletionException: javax.xml.ws.soap.SOAPFaultException: Error creating bean with name '*.http-conduit': Cannot create inner bean '(inner bean)#741a1e82' of type [org.a 
pache.cxf.configuration.spring.JAXBBeanFactory] while setting bean property 'client'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with nam 
e '(inner bean)#741a1e82': Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.lang.Object]: Fa 
ctory method 'createJAXBBean' threw exception; nested exception is java.lang.RuntimeException: javax.xml.bind.UnmarshalException 
- with linked exception: 
[com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'h' (code 104) in start tag Expected a quote 
at [row,col {unknown-source}]: [1,35]] 
     at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273) 
     at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280) 
     at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592) 
     at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:56) 
     at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:39) 
     at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:405) 
     at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) 
     at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) 
     at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) 
     at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) 
Caused by: javax.xml.ws.soap.SOAPFaultException: Error creating bean with name '*.http-conduit': Cannot create inner bean '(inner bean)#741a1e82' of type [org.apache.cxf.configuration.spring. 
JAXBBeanFactory] while setting bean property 'client'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#741a1e82': Bean 
instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.lang.Object]: Factory method 'createJAXBBean' t 
hrew exception; nested exception is java.lang.RuntimeException: javax.xml.bind.UnmarshalException 
- with linked exception: 
[com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'h' (code 104) in start tag Expected a quote 
at [row,col {unknown-source}]: [1,35]] 
     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161) 
     at com.sun.proxy.$Proxy69.wsSanctionsPEPCheckV2(Unknown Source) 
     at services.pepcheck.PepCheckServiceImpl.lambda$performPepCheck$33(PepCheckServiceImpl.java:114) 
     at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) 
     ... 7 common frames omitted 
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '*.http-conduit': Cannot create inner bean '(inner bean)#741a1e82' of type [org.apache.cxf.co 
nfiguration.spring.JAXBBeanFactory] while setting bean property 'client'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner be 
an)#741a1e82': Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.lang.Object]: Factory method 
'createJAXBBean' threw exception; nested exception is java.lang.RuntimeException: javax.xml.bind.UnmarshalException 
- with linked exception: 
[com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'h' (code 104) in start tag Expected a quote 
at [row,col {unknown-source}]: [1,35]] 
     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:313) 
     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:129) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1486) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1231) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.configureBean(AbstractAutowireCapableBeanFactory.java:323) 
     at org.springframework.beans.factory.wiring.BeanConfigurerSupport.configureBean(BeanConfigurerSupport.java:147) 
     at org.apache.cxf.configuration.spring.ConfigurerImpl.configureBean(ConfigurerImpl.java:177) 
     at org.apache.cxf.configuration.spring.ConfigurerImpl.configureWithWildCard(ConfigurerImpl.java:202) 

そして、これはbeans.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"                                    
     xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"                             
     xmlns:cxf="http://cxf.apache.org/core"                                     
     xsi:schemaLocation="http://www.springframework.org/schema/beans                               
     http://www.springframework.org/schema/beans/spring-beans-4.3.xsd                               
     http://cxf.apache.org/configuration/security                                    
     http://cxf.apache.org/schemas/configuration/security.xsd                                 
     http://cxf.apache.org/transports/http/configuration                                  
     http://cxf.apache.org/schemas/configuration/http-conf.xsd                                 
     http://cxf.apache.org/core                                        
     http://cxf.apache.org/schemas/core.xsd                                     
     http://cxf.apache.org/jaxws                                        
     http://cxf.apache.org/schemas/jaxws.xsd">                                     


    <jaxws:client id="mySoapClient"                                      
        serviceClass="ro.vdin.ServiceSoap"                             
        address="https://example.com"/>                                    

    <http-conf:conduit name="*.http-conduit">                                     
     <http-conf:client ConnectionTimeout="60000"                                    
          ReceiveTimeout="60000"                                    
          AllowChunking="false"/>                                    
    </http-conf:conduit> 
</beans> 

です:コンジットmatchesサービス。私がいくつかのランダムな名前を付けた場合、例外はありません(ただし、タイムアウトもありません)。

アイデア?

答えて

0

Play FrameworkでCXFを使用しているときも同様の問題がありました。 理由はわかりませんが、*.http-conduitワイルドカードを使用することはできません。 <http-conf:conduit name="https://example.com">

複数のWebサービスがある場合は、regexpを使用してそれらのすべてに一致させることができます。

例:あなたはhttps://example.com/service1https://example.com/service2エンドポイントを持っている場合、構成が提案を<http-conf:conduit name="https://example.com/.*">

+0

おかげだろう!残念ながら、私はそれを試みましたが、私はまだ同じエラーを受け取ります(; regex name = "https: //example.com:5678.* "と名前=" https://example.com:5678/service.asmx.* ") –

+0

@VladDinulescuプロトコルを追加しようとしましたか?私はあなたがそれを指定しなければならないと思う: 'name =" https://example.com:5678/.* "'。多分、http-conf:conduitでは問題ではないでしょう。 'jaxws:client'の' address'が '' https://example.com ''ですか? '' https://example.com:5678/service.asmx "' –

+0

まあ...プロトコルを追加しました。私はStackOverflowが私のコメントを書式設定したと私は気付かなかったと思う。また、jaxws:clientアドレスについては、私は完全なWebサービスエンドポイントを置いていますが、私はプライバシー目的のためにそれを置いていません。 (私が説明したように、私は完全にサービスにアクセスできます、それは私がタイムアウトを適切に設定できないということです)。 –

関連する問題