わかりました、これはまったくわかりません!
Spring 3.1.1 と Hessian 4.0.7 を使用して Tomcat 6.0.29 にデプロイしています
簡単な Hessian リモート インターフェイスを作成しましたが、テストが失敗し続けます。
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 にデプロイされると (エラーや警告なしで開始されます)、別のテスト アプリのメイン メソッドからすべてを呼び出しています。
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 は間違いなく webapp サーバーに到達しており、まるで URL を変更したかのように、testapp が悪い URL を訴えます。ただし、ログや警告はなく、サーバーからログに記録されたデバッグもまったくありません。500 は、実際の Impl の前にどこかに投げ出されます!?
すべてのキッカーは、Spring 2.0.5 で実行している古いサーバーに統合された上記の同じコードが、Burlap 2.1.12 で問題なく動作することです。