Check if Server singleton exists before trying to get the list of extensions from it.
This commit is contained in:
parent
c583133234
commit
5c9df59014
2 changed files with 37 additions and 28 deletions
|
@ -269,6 +269,7 @@ public final class Application implements IPathElement, Runnable {
|
|||
*/
|
||||
public void init()
|
||||
throws DatabaseException, ScriptingException, MalformedURLException {
|
||||
if (Server.getServer() != null) {
|
||||
Vector extensions = Server.getServer().getExtensions();
|
||||
|
||||
for (int i = 0; i < extensions.size(); i++) {
|
||||
|
@ -281,6 +282,7 @@ public final class Application implements IPathElement, Runnable {
|
|||
e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// read the sessions if wanted
|
||||
if ("true".equalsIgnoreCase(getProperty("persistentSessions"))) {
|
||||
|
@ -387,6 +389,7 @@ public final class Application implements IPathElement, Runnable {
|
|||
typemgr = null;
|
||||
|
||||
// tell the extensions that we're stopped.
|
||||
if (Server.getServer() != null) {
|
||||
Vector extensions = Server.getServer().getExtensions();
|
||||
|
||||
for (int i = 0; i < extensions.size(); i++) {
|
||||
|
@ -394,6 +397,7 @@ public final class Application implements IPathElement, Runnable {
|
|||
|
||||
ext.applicationStopped(this);
|
||||
}
|
||||
}
|
||||
|
||||
// store the sessions if wanted
|
||||
if ("true".equalsIgnoreCase(getProperty("persistentSessions"))) {
|
||||
|
@ -1630,6 +1634,7 @@ public final class Application implements IPathElement, Runnable {
|
|||
}
|
||||
|
||||
// update extensions
|
||||
if (Server.getServer() != null) {
|
||||
Vector extensions = Server.getServer().getExtensions();
|
||||
|
||||
for (int i = 0; i < extensions.size(); i++) {
|
||||
|
@ -1638,6 +1643,8 @@ public final class Application implements IPathElement, Runnable {
|
|||
try {
|
||||
ext.applicationUpdated(this);
|
||||
} catch (ConfigurationException e) {
|
||||
logEvent("Error updating extension "+ext+": "+e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@ public class RhinoEngine implements ScriptingEngine {
|
|||
// context.putThreadLocal ("engine", this);
|
||||
extensionGlobals = new HashMap();
|
||||
|
||||
if (Server.getServer() != null) {
|
||||
Vector extVec = Server.getServer().getExtensions();
|
||||
|
||||
for (int i = 0; i < extVec.size(); i++) {
|
||||
|
@ -108,6 +109,7 @@ public class RhinoEngine implements ScriptingEngine {
|
|||
e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// context.removeThreadLocal ("reval");
|
||||
// context.removeThreadLocal ("engine");
|
||||
|
|
Loading…
Add table
Reference in a new issue