Errors on a Simple Example

115 views
Skip to first unread message

Sean

unread,
Aug 4, 2010, 2:43:58 PM8/4/10
to gwtrpccommlayer
Hello, This project seems like a great idea and I am giving it a
whirl. I'm running into some problems though, I've created a fresh GWT
Project using the Eclipse plugin and so far the only thing I changed
was having GreetingServiceImpl extend GwtRpcCommLayerServlet and
added the httpcomponents-client-4.0.1 jars to the path.

I then created a simple Main to test:
System.out.println("Testing RPC");
URL url = new URL("http://127.0.0.1:8888/RPCCommLayer.html?
gwt.codesvr=127.0.0.1:9997");
GwtRpcCommLayerClient client = new GwtRpcCommLayerClient(url);

GreetingServiceAsync stub = (GreetingServiceAsync)
client.createRemoteServicePojoProxy(GreetingServiceAsync.class);

stub.greetServer("Sean Patrick William Loughran!", new
AsyncCallback<String>()
{
public void onSuccess(String result)
{
System.out.println("Asynch-Call #1 Result->" + result);
}
public void onFailure(Throwable caught)
{
System.out.println("Asynch-Call #1 Failure " + caught);
}
});
System.out.println("Executed Asynch-Call #1 ");

And I get the error:

Testing RPC
Response Error=Content-Type must be 'binary/octet-stream'
Executed Asynch-Call #1
Asynch-Call #1 Failure java.lang.RuntimeException: No valid
GwtRpcCommLayerPojoResponse returned. Check for http errors in log.

I was wondering if anyone had some insight, I feel like this will be
superpowerful once I get it running.

jeff mchugh

unread,
Aug 4, 2010, 6:46:23 PM8/4/10
to gwtrpccommlayer
Hi Sean -

I think the issue at hand is that you are using the URL to the "launch
page" rather than the URL to the actual servlet.
Take a look at the web.xml file and note the full servlet path.
This should fix the problem. let me know otherwise...

Sean

unread,
Aug 5, 2010, 8:17:17 AM8/5/10
to gwtrpccommlayer
You are absolutely right, thank you! It worked on my machine like a
charm. I can't wait to use this.

I'm not sure this was intended use but, I am on a Webserver where I
can't execute my own Java files, so to run Chron jobs I have to use
perl or php. This will allow me to set up the Chron job on my own
machine and call the functions on my server! This came at a perfect
time, thank you!
Reply all
Reply to author
Forward
0 new messages