Saturday, 3 January 2009

GWT + Servlet - working!

Late last night I was able to press a button in a browser and Pink Floyd paused, resuming on a subsequent button-press.

Yay! GWT front-end working into Java Servlet back-end over RPC. In Eclipse I could even set a breakpoint in the servlet implementation.

Fine and dandy in the debug environment. Can't deploy. Am using tomcat6.

Now deployed, I think I had web.xml wrong, also didn't spot the need to put a path of folders under web-inf/classes (see tomcat docs).

Now I'm getting runtime exception:

03-Jan-2009 11:16:49 org.apache.catalina.core.ApplicationContext log
SEVERE: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract int net.dnsdojo.slm.music.client.MusicService.togglePlay(int[])' threw an unexpected exception: java.security.AccessControlException: access denied (java.io.FilePermission <> execute)

Putting this in tomcat's policy.d/50local.policy fixed the exception:


grant codeBase "http://fuji.slm.dnsdojo.net:8080/music/*" {
permission java.io.FilePermission "/usr/bin/xmms2", "execute";
};

but now I have some server error, no info, try replacing exec call with sysout.

Found this excellent guide to using stdout from java runtime exec:

Executing Unix command from java : problem

No comments:

Post a Comment