2012-05-11 20 views
4

HessianConnectionException:(HTTP)Hessian 4.0.7およびSpring 3.1.1を使用しているときに500エラーが発生しました

私はシンプルなヘッセリモートインタフェースを作成しましたが、私のテストをして失敗し続けて

のTomcat 6.0.29に展開春の3.1.1とヘッセ行列4.0.7を使用しています。

Exception in thread "main" com.caucho.hessian.client.HessianConnectionException: 500: java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8080/client/remote/RemoteService 
    at com.caucho.hessian.client.HessianURLConnection.sendRequest(HessianURLConnection.java:142) 
    at com.caucho.hessian.client.HessianProxy.sendRequest(HessianProxy.java:283) 
    at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:170) 
    at $Proxy0.testConnection(Unknown Source) 
    at com.qualificationcheck.testserver.TestServer.main(TestServer.java:15) 
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8080/client/remote/remoteservice 
    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 sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source) 
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) 
    at com.caucho.hessian.client.HessianURLConnection.sendRequest(HessianURLConnection.java:122) 
    ... 4 more 
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8080/client/remote/RemoteService 
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) 
    at java.net.HttpURLConnection.getResponseCode(Unknown Source) 
    at com.caucho.hessian.client.HessianURLConnection.sendRequest(HessianURLConnection.java:109) 
    ... 4 more 

public interface QCClientRemoteService { 
    public String testConnection(String param); 
} 

public class QCClientRemoteServiceImpl implements QCClientRemoteService { 
    public String testConnection(String param) { 
     return "Recieved param of >" + param + "< successfully."; 
    } 
} 

web.xmlには、

<servlet> 
    <servlet-name>remoting</servlet-name> 
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
    <init-param> 
     <param-name>contextConfigLocation</param-name> 
     <param-value>/WEB-INF/config/web-app-config.xml</param-value> 
    </init-param> 
    <load-on-startup>2</load-on-startup> 
</servlet> 
<servlet-mapping> 
    <servlet-name>remoting</servlet-name> 
    <url-pattern>/remote/*</url-pattern> 
</servlet-mapping> 

そこに表示されているweb-app-config.xmlには(別のXMLからのインポートによって)含まれています。

<bean id="remoteService" class="com.example.QCClientRemoteServiceImpl"> 
    <!-- any additional properties, maybe a DAO? --> 
</bean> 

<bean name="/RemoteService" class="org.springframework.remoting.caucho.HessianServiceExporter"> 
    <property name="service" ref="remoteService"/> 
    <property name="serviceInterface" value="com.example.QCClientRemoteService"/> 
</bean> 

そして最後に、一度(エラーや警告なしで始まる)私が持つ別のテストアプリケーションのメインメソッドからすべてのことを呼んでいるのTomcatに配備thatsの。

String url = "http://localhost:8080/client/remote/RemoteService"; 

HessianProxyFactory factory = new HessianProxyFactory(); 
QCClientRemoteService basic = (QCClientRemoteService) factory.create(QCClientRemoteService.class, url); 

System.out.println(basic.testConnection("Input 123")); 

なぜこれが機能しないのでしょうか?非常にイライラする! 次の男は同じ問題を抱えていたようですが、Cauchoから答えはありませんでした。 http://forum.caucho.com/showthread.php?t=14906

testappとは間違いなく私がURLをのmungeかのようにtestappとは、悪いURLを訴えるWebアプリケーションサーバに到達しています。しかし、ログや警告はなく、まったくサーバからログに記録されたデバッグさえありません。 500は実際のImpl!の前のどこかに投げ込まれますか?

それはすべてのキッカーは、古いサーバーに統合され、上記と同じコードが、我々はヘッセのさまざまなバージョンを試した後(黄麻布とうまく春2.0.5著作2.1.12

+0

同じ問題がある場合は、hibernate3.0.8/tomcat6.0.32 but spring 3.1.1です。 Webブラウザでエンドポイントにアクセスすると、 'HessianServiceExporterはPOST要求のみをサポートしますが、適切な応答を返しますが、ヘッセンのクライアントは500エラーを返します。 – theZenPebble

答えて

4

問題は、私には春のリモート2.0.8のlibが含まれていたということでした。これはどこか(黙って)矛盾していました。これを削除するとすぐに問題が解決しました。

上記の設定とテストコードは、私が以下のライブラリを持っていれば完全に動作します(私はHessian/Springソリューションのすべてが必須ではないと考えています。完全性のためにここに記載)。

spring-core-3.1.1.RELEASE 
spring-asm-3.1.1.RELEASE 
spring-web-3.1.1.RELEASE 
spring-beans-3.1.1.RELEASE 
spring-context-3.1.1.RELEASE 
spring-aop-3.1.1.RELEASE 
spring-webmvc-3.1.1.RELEASE 
spring-context-support-3.1.1.RELEASE 
spring-expression-3.1.1.RELEASE 
hessian-4.0.7 
2

私のソリューション上で動作しているということです)を使用することでした:

org.springframework spring-remoting 2.0.8 
org.springframework spring-webmvc/orm/(whatever) 3.1.1.RELEASE 
com.caucho hessian 3.0.8 

私はMavenプロジェクトでこれらを使用していますので、これらは私が使用しています正確なバージョンであり、問​​題は姿を消しました。これは間違いなくSpring 3.1.1のバージョンのようです。

私はEclipse RCPアプリケーションでこれを使用しており、Eclipse RCP Hessianバンドルで動作します。

+1

このSpring-Remotingライブラリを削除してみてください。これは最新のhessian 4.0.7で動作するはずです。とにかく私のために働いた。非常に繊細な紛争の問題があるようです。 –

+0

古い互換性のないクライアントで使用しているので、3.xが必要ですが、4.xでうまく動作します – theZenPebble

関連する問題