0

I've been trying to set up a httpinvoker based server on my google appengine account. I followed instructions given in spring documentation, but it doesn't seem to work. Can someone please review my code below and let me know whats wrong.

My 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>

My 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>

My client 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>

My client side code:

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);
}

I keep getting a exception (org.springframework.remoting.RemoteAccessException): Could not access HTTP invoker remote service at [http://googleappId.appspot.com/remoting/AccountService]; nested exception is java.io.IOException: Did not receive successful HTTP response: status code = 500, status message = [Internal Server Error]

user2177316
  • 1
  • 1
  • 2

1 Answers1

0

Check if the app.server.AccountService is a class or interface,it should be a interface,if it's a class ,500 will happen.

Amit
  • 15,217
  • 8
  • 46
  • 68