0

我一直在尝试在我的 google appengine 帐户上设置一个基于 httpinvoker 的服务器。我遵循了 spring 文档中给出的说明,但它似乎不起作用。有人可以在下面查看我的代码并让我知道出了什么问题。

我的 web.xml:

<servlet>
<servlet-name>remoting</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>remoting</servlet-name>
<url-pattern>/remoting/*</url-pattern>
</servlet-mapping>

我的远程处理-servlet.xml

<bean name="/AccountService" class="org.springframework.remoting.httpinvoker.Ht tpInvokerServiceExporter">
<property name="service" ref="accountService"/>
<property name="serviceInterface" value="app.server.AccountService"/>
</bean>

我的客户xml:

<bean id="httpInvokerProxy" class="org.springframework.remoting.httpinvoker.Ht tpInvokerProxyFactoryBean">
<property name="serviceUrl" value="http://<google appid>.appspot.com/remoting/AccountService"/>
<property name="serviceInterface" value="app.server.AccountService"/>
</bean>

我的客户端代码:

public static void main(String[] args) throws Exception {
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("springClientConfig .xml");
AccountService testService = (AccountService) applicationContext.getBean("httpInvokerProxy");
String retVal = testService.getAccounts("test");
System.out.println(retVal);
}

我不断收到异常(org.springframework.remoting.RemoteAccessException):无法在 [http://googleappId.appspot.com/remoting/AccountService] 访问 HTTP 调用程序远程服务;嵌套异常是 java.io.IOException:没有收到成功的 HTTP 响应:状态码 = 500,状态消息 = [Internal Server Error]

4

1 回答 1

0

检查app.server.AccountService是类还是接口,应该是接口,如果是类,500会发生。

于 2013-06-22T03:19:50.123 回答