A solution to this kind of problem, but not involving applets, that we've used is to implement the server as an MBean service. This allows it to be deployed as a .sar archive within the JBoss server. This is getting JBoss specific but I guess from your package names this is not really an issue. If you look in the JBoss user guide at
It explains how to write an MBean service. You would implement the startService method to start your server. You can also provide configuration attributes to your server this way. For example the port number.
To ensure the service is started before the war is deployed I think you can add a jboss-web.xml file into the war WEB-INF folder that contains the name of the mbean in a element. It may not be needed because in JBoss 4 I don't think the Tomcat connectors pass on any requests to a servlet until everything as started.