Saturday, 17 January 2009

Netbeans

Couldn't get gwt deployed with eclipse, so trying netbeans. Couldn't add my (already-installed) tomcat to netbeans so wiped the lot - tomcat and netbeans - and started over.

Re-installation of netbeans, got same GTK reports as first attempt:


slm@fuji:/downloads/netbeans$ ./netbeans-6.5-ml-linux.sh
Configuring the installer...
Searching for JVM on the system...
Extracting installation data...
Running the installer wizard...

(:9282): Gtk-WARNING **: Attempting to add a widget with type GtkButton to a GtkComboBoxEntry (need an instance of GtkEntry or of a subclass)

(:9282): Gtk-CRITICAL **: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed

(:9282): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(:9282): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed
slm@fuji:/downloads/netbeans$

Of course, once I RTFM, I see that tomcat doesn't go in by default, you have to customize the installation, so re-installed again. Now I see that glassfish has swiped the 8080 port, no mention of where tomcat will sit [8084 iirc].

Having shut down netbeans, tomcat is no longer running. Re-installation of tomcat using Synaptic - no manager, examples or docs :(

Sunday, 4 January 2009

Google Site

My site on Google is guaranteed to be up but I haven't really figured out how best to drive it yet

tomcat re-installation

I now see log entries. Somehow I seem to have wound up with two mixed-up installations on fuji, and couldn't see any log traffic in response to my call log(string) in MusicServiceImpl.xmmsCmd.

I brutally re-installed tomcat and it's now working.

Use Eclipse, projectCreator and applicationCreator. Forget about Cypal - Ockham would NOT be amused.

Compile using Music-compile (generated by applicationCreator).

Deployment is by running script deploy.sh which implements

Deploying RPC

:

rsync -avz /home/slm/proging/eclipse/JEE/music/www/net.dnsdojo.slm.music.Music/ /var/lib/tomcat6/webapps/music/

if [ ! -d /var/lib/tomcat6/webapps/music/WEB-INF/ ]
then
echo "/var/lib/tomcat6/webapps/music/WEB-INF/ does not exist (creating)"
mkdir /var/lib/tomcat6/webapps/music/WEB-INF/
else
echo "/var/lib/tomcat6/webapps/music/WEB-INF/ exists"
fi

if [ ! -d /var/lib/tomcat6/webapps/music/WEB-INF/classes/ ]
then
echo "/var/lib/tomcat6/webapps/music/WEB-INF/classes/ does not exist (creating)"
mkdir /var/lib/tomcat6/webapps/music/WEB-INF/classes/
else
echo "/var/lib/tomcat6/webapps/music/WEB-INF/classes/ exists"
fi
if [ ! -d /var/lib/tomcat6/webapps/music/WEB-INF/lib/ ]
then
echo "/var/lib/tomcat6/webapps/music/WEB-INF/lib/ does not exist (creating)"
mkdir /var/lib/tomcat6/webapps/music/WEB-INF/lib/
else
echo "/var/lib/tomcat6/webapps/music/WEB-INF/lib/ exists"
fi

rsync -avz /home/slm/proging/eclipse/JEE/music/bin/ /var/lib/tomcat6/webapps/music/WEB-INF/classes/
cp /home/slm/proging/eclipse/JEE/music/web.xml /var/lib/tomcat6/webapps/music/WEB-INF/
cp /opt/gwt-linux/gwt-servlet.jar /var/lib/tomcat6/webapps/music/WEB-INF/lib/

J2EE, .NET

And Geronimo. And JBoss. There's a lot to consider here.

Tomcat 6 by itself is a lightweight solution. It does not come with all the JEE features and additional packages found in JBoss and Geronimo, but also doesn't require much memory and runs fast even on smaller servers.
my j2ee notebook on iGoogle contains notes and links

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

Friday, 2 January 2009

life without tunes

No house music here. Not since removing pulseaudio. I read to do this (clash with alsa?) to get sound working on YouTube vids. xmms - 2?

Good command-line support. How about a GWT front-end? What's already available? xmms2swi is a php client but tomcat log shows it fails to get through to the daemon.