shuber 2005/09/01 15:33:55 CEST
Modified files:
core maven.xml
core/src/java/org/jahia/bin Jahia.java
JahiaJetspeedServlet.java
Log:
- Improved shutdown of Jahia and Jetspeed servlets after configuration wizard
completes. Under Tomcat we can now simply wait until Jahia has restarted and
access Jahia.
- Modified the reset:tomcat goal in Maven so that it replaces the default DB
values with the files that include markers.
Revision Changes Path
1.45 +4 -0 jahia/core/maven.xml
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/maven.xml.diff?r1=1.44&r2=1.45&f=h
1.32 +5 -1 jahia/core/src/java/org/jahia/bin/Jahia.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/bin/Jahia.java.diff?r1=1.31&r2=1.32&f=h
1.3 +5 -10
jahia/core/src/java/org/jahia/bin/JahiaJetspeedServlet.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/bin/JahiaJetspeedServlet.java.diff?r1=1.2&r2=1.3&f=h
Index: maven.xml
===================================================================
RCS file: /home/cvs/repository/jahia/core/maven.xml,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- maven.xml 1 Sep 2005 12:00:37 -0000 1.44
+++ maven.xml 1 Sep 2005 13:33:54 -0000 1.45
@@ -35,7 +35,11 @@
<j:set var="use_contextclassloader" value=""/>
</j:otherwise>
</j:choose>
+ <!-- Now let's reset all the files that contain markers that are
replaced during configuration wizard -->
<copy overwrite="true" file="${context_file}"
tofile="${context_dir}/jahia.xml"/>
+ <copy overwrite="true"
file="./src/webapp/WEB-INF/var/db/default.values"
tofile="${deploy.war.dir}/${webapp.name}/WEB-INF/var/db/default.values"/>
+ <copy overwrite="true"
file="./src/webapp/WEB-INF/var/db/default_corporate_portal_templates.values"
tofile="${deploy.war.dir}/${webapp.name}/WEB-INF/var/db/default_corporate_portal_templates.values"/>
+ <copy overwrite="true"
file="./src/webapp/WEB-INF/var/db/default_corporate_portal_templates_postgres.values"
tofile="${deploy.war.dir}/${webapp.name}/WEB-INF/var/db/default_corporate_portal_templates_postgres.values"/>
<delete failonerror="false"
file="${deploy.war.dir}/${webapp.name}/WEB-INF/etc/config/jahia.properties" />
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${deploy.war.dir}/${webapp.name}/WEB-INF/var/dbdata"
includes="**/*"/>
Index: Jahia.java
===================================================================
RCS file: /home/cvs/repository/jahia/core/src/java/org/jahia/bin/Jahia.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- Jahia.java 30 Aug 2005 14:39:13 -0000 1.31
+++ Jahia.java 1 Sep 2005 13:33:54 -0000 1.32
@@ -1,4 +1,4 @@
-// $Id: Jahia.java,v 1.31 2005/08/30 14:39:13 xlawrence Exp $
+// $Id: Jahia.java,v 1.32 2005/09/01 13:33:54 shuber Exp $
//
// ____.
// __/\ ______| |__/\. _______
@@ -601,6 +601,10 @@
}
public void destroy() {
+ // check first if Jahia was initialized or if we just ran the
configuration wizard.
+ if (!mInitiated) {
+ return;
+ }
try {
ServicesRegistry.getInstance().shutdown();
} catch (JahiaException je) {
Index: JahiaJetspeedServlet.java
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/java/org/jahia/bin/JahiaJetspeedServlet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JahiaJetspeedServlet.java 17 Aug 2005 16:08:11 -0000 1.2
+++ JahiaJetspeedServlet.java 1 Sep 2005 13:33:55 -0000 1.3
@@ -63,6 +63,8 @@
private static final String INIT_START_MSG = "Jetspeed Starting
Initialization...";
private static final String INIT_DONE_MSG = "Jetspeed Initialization
complete, Ready to service requests.";
+ private boolean jahiaConfigured = false;
+
/**
* Intialize Servlet.
*/
@@ -283,19 +285,12 @@
String jahiaConfigFile = config.getInitParameter("jahia.config");
ServletContext context = config.getServletContext();
String configFileOnDisk = context.getRealPath(jahiaConfigFile);
- return new File(configFileOnDisk).exists();
+ jahiaConfigured = new File(configFileOnDisk).exists();
+ return jahiaConfigured;
}
private boolean isJahiaConfigured() {
- try {
- String jahiaConfigFile =
getServletConfig().getInitParameter("jahia.config");
- ServletContext context = getServletContext();
- String configFileOnDisk = context.getRealPath(jahiaConfigFile);
- return new File(configFileOnDisk).exists();
- } catch (Throwable t) {
- logger.error("Error while trying to determine if Jahia was
previously configured", t);
- return false;
- }
+ return jahiaConfigured;
}
}