我一直在尝试在我的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>我的remoting-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);
}我在http://googleappId.appspot.com/remoting/AccountService;上不断收到异常(org.springframework.remoting.RemoteAccessException):无法访问HTTP调用器远程服务嵌套异常为java.io.IOException:未收到成功的HTTP响应:状态代码= 500,状态消息=内部服务器错误
发布于 2013-06-22 11:19:50
检查app.server.AccountService是否是一个类或接口,它应该是一个接口,如果它是一个类,就会发生500。
https://stackoverflow.com/questions/15450993
复制相似问题