Am 10.12.2009 14:38, schrieb Harri:
> - on some machines the application does'n start at all because the
> connection to localhost:8080 doesn't work.
Is your Jetty already (and still) running when you start Prism? We had a
similar problem because our Tomcat shut down too early when Prism took
too long for copying the webapp to th user directory.
For the offline problems, I added the following code to the webapp.js:
// set online on startup
var ioService =
Cc["@
mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
ioService.offline = false;
function myObserver(){
this.register();
}
myObserver.prototype = {
observe: function(subject, topic, data) {
if (topic == "offline-requested") {
if (subject instanceof Components.interfaces.nsISupportsPRBool){
// try to veto going offline
subject.data = false;
}
}
if (topic == "network:offline-status-changed") {
if (data == "offline"){
// go back online
var ioService =
Cc["@
mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
ioService.offline = false;
}
}
},
register: function() {
var obsService =
Cc["@
mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
obsService.addObserver(this, "offline-requested", false);
obsService.addObserver(this, "network:offline-status-changed", false);
},
unregister: function() {
var obsService =
Cc["@
mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
obsService.removeObserver(this, "offline-requested");
obsService.removeObserver(this, "network:offline-status-changed",
false);
}
}
var observer = new myObserver();