|
From: <ian...@us...> - 2007-09-04 15:26:48
|
Revision: 356
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=356&view=rev
Author: iansmith
Date: 2007-09-04 08:26:50 -0700 (Tue, 04 Sep 2007)
Log Message:
-----------
1) Fixed poms to work properly if you simply do "clean install" in the master dir. This does leave a server running if the integrations tests "error" instead of fail.
2) log4j now undercontrol (shuts up hibernate).
3) you can boot tomcat with "mvn -Pboot-server cargo:start" in the master pom dir.
4) To send a war to the booted server use "mvn war:war cargo:deploy" in server directory
Modified Paths:
--------------
maven/trunk/ogoglio/pom.xml
maven/trunk/ogoglio-appdev/pom.xml
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java
maven/trunk/ogoglio-integration-test/pom.xml
maven/trunk/ogoglio-server/pom.xml
Added Paths:
-----------
maven/trunk/ogoglio-integration-test/src/test/resources/log4j.properties
maven/trunk/ogoglio-server/src/main/resources/log4j/log4j.properties
Removed Paths:
-------------
maven/trunk/ogoglio-server/src/main/resources/log4j/log4j.properties
Modified: maven/trunk/ogoglio/pom.xml
===================================================================
--- maven/trunk/ogoglio/pom.xml 2007-09-03 23:33:13 UTC (rev 355)
+++ maven/trunk/ogoglio/pom.xml 2007-09-04 15:26:50 UTC (rev 356)
@@ -19,6 +19,41 @@
<module>../dev-plugins</module>
</modules>
+ <profiles>
+ <profile>
+ <id>boot-server</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>0.3-SNAPSHOT</version>
+ <!-- CARGO INTERACTIONS WITH TOMCAT FOR BOOTING SERVER ONLY -->
+ <configuration>
+ <wait>true</wait>
+ <!-- tomcat 5.5 running on the same machine...-->
+ <container>
+ <containerId>tomcat5x</containerId>
+ <home>${cargo.tomcat5x.home}</home>
+ <log>${basedir}/tomcat5x.log</log>
+ <output>${basedir}/tomcat5x.out</output>
+ </container>
+ <!-- tomcat configuration -->
+ <configuration>
+ <type>standalone</type>
+ <home>${ogoglio.tmp.tomcat5x}</home>
+ <properties>
+ <cargo.servlet.port>
+ 8080
+ </cargo.servlet.port>
+ </properties>
+ </configuration>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
<ciManagement>
<system>continuum</system>
@@ -44,6 +79,7 @@
</url>
</scm>
+
<build>
<pluginManagement>
<plugins>
@@ -57,5 +93,18 @@
</plugins>
</pluginManagement>
</build>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.12</version>
+ <scope>runtime</scope>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
</project>
Modified: maven/trunk/ogoglio-appdev/pom.xml
===================================================================
--- maven/trunk/ogoglio-appdev/pom.xml 2007-09-03 23:33:13 UTC (rev 355)
+++ maven/trunk/ogoglio-appdev/pom.xml 2007-09-04 15:26:50 UTC (rev 356)
@@ -35,6 +35,11 @@
<artifactId>commons-io</artifactId>
<version>1.3</version>
</dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ </dependency>
<!-- used by some code in the project -->
<dependency>
Modified: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java 2007-09-03 23:33:13 UTC (rev 355)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java 2007-09-04 15:26:50 UTC (rev 356)
@@ -4,6 +4,7 @@
import javax.naming.NamingException;
import javax.servlet.ServletConfig;
+import org.apache.commons.logging.LogFactory;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
@@ -20,6 +21,7 @@
public static final boolean DDL_MODE_UPDATE=true;
public static final boolean DDL_MODE_CREATE=false;
+ static org.apache.commons.logging.Log log = LogFactory.getLog("com.ogoglio.migrate");
public MigrationSupport() {
}
@@ -33,7 +35,7 @@
SessionFactory sessionFactory = getCurrentConfiguration().buildSessionFactory();
int version = DBVersionPersistTasks.findVersion(sessionFactory);
if (version != getVersionNumber()) {
- System.err.println("DB Version Mismatch! Expected (" + getVersionNumber() + ") but got " + version + "!");
+ log.error("DB Version Mismatch! Expected (" + getVersionNumber() + ") but got " + version + "!");
sessionFactory.close();
return tryUpgrade(servletConf, ctx, version, getVersionNumber(),
DDL_MODE_UPDATE, true, null);
@@ -42,10 +44,10 @@
return true; // we are at the expected version
} catch (PersistException e) {
if (e.innerThrowable == null) {
- System.out.println("Serious problem with hibernate:" + e.getMessage());
+ log.error("Serious problem with hibernate:" + e.getMessage());
return false;
}
- System.err.println("Unable to figure out DB version number. Likely this is a fresh database....(" + e.innerThrowable.getClass().getName() + ")");
+ log.info("Unable to figure out DB version number. Likely this is a fresh database....(" + e.innerThrowable.getClass().getName() + ")");
return initVersionAndUpgrade(servletConf, ctx);
}
}
@@ -61,7 +63,7 @@
factory.close();
return true;
} catch (Throwable t) {
- System.err.println("Error trying initialized DB:" + t.getMessage());
+ log.error("Error trying initialized DB:" + t.getMessage());
return false;
}
}
@@ -95,7 +97,7 @@
try {
return DBVersionPersistTasks.updateVersion(targetVersion, expectedSize, sessionFactory);
} catch (PersistException e) {
- System.err.println("Problem updating the version of the database to version " + targetVersion + ":" + e.getMessage());
+ log.error("Problem updating the version of the database to version " + targetVersion + ":" + e.getMessage());
return false;
}
}
@@ -103,7 +105,7 @@
public boolean tryUpgrade(ServletConfig servletConfig, Context ctx, int db_is,
int db_wants_to_be, boolean isUpdate, boolean useJNDI, PropStorage propStore) {
if (getMigrationList().length != getVersionNumber()) {
- System.out.println("Internal error! Migration list length should be " + getVersionNumber() + " but is " + getMigrationList().length + "!");
+ log.error("Internal error! Migration list length should be " + getVersionNumber() + " but is " + getMigrationList().length + "!");
return false;
}
boolean canMigrate = false;
@@ -120,12 +122,12 @@
canMigrate = true;
}
} catch (NamingException e) {
- System.err.println("Naming exception trying to access " + MIGRATION_KEY + " from naming context!");
+ log.error("Naming exception trying to access " + MIGRATION_KEY + " from naming context!");
canMigrate=false;
}
if (!canMigrate) {
- System.err.println("Cannot migrate data! Property ogoglio.okToMigrateDB is false or non-existent!");
+ log.error("Cannot migrate data! Property ogoglio.okToMigrateDB is false or non-existent!");
return false;
}
String hbm_auto_flag="update";
@@ -136,8 +138,7 @@
for (int i = db_is; i < db_wants_to_be; ++i) {
Migration current = getMigrationList()[i];
- System.out.println("------------------------------------------------\n");
- System.out.println("DB: Attempting migration from " + i + " to " + (i + 1) + " with auto HBM:"+hbm_auto_flag);
+ log.info("DB: Attempting migration from " + i + " to " + (i + 1) + " with auto HBM:"+hbm_auto_flag);
//try to get hibernate to do the work
Configuration config = createConfigurationForHibernate(i + 1, hbm_auto_flag, useJNDI, propStore);
@@ -156,26 +157,25 @@
return false;
}
} catch (PersistException e) {
- System.err.println("Whoa! Patch failed at revision!"+(i+1)+" on class "+current.getClass().getName());
- System.err.println("Whoa! Persistance layer problem was:"+e.getMessage());
+ log.error("Whoa! Patch failed at revision!"+(i+1)+" on class "+current.getClass().getName());
+ log.error("Whoa! Persistance layer problem was:"+e.getMessage());
}
try {
if (!isUpdate) {
//we need to go ahead and create the data
if (!current.populate(factory, i, i+1)) {
- System.err.println("Whoa! Populate failed at revision!"+(i+1)+" on class "+current.getClass().getName());
+ log.error("Whoa! Populate failed at revision!"+(i+1)+" on class "+current.getClass().getName());
factory.close();
return false;
}
}
} catch (PersistException e) {
- System.err.println("Whoa! Populate failed at revision!"+(i+1)+" on class "+current.getClass().getName());
- System.err.println("Whoa! Persistance layer problem was:"+e.getMessage());
+ log.error("Whoa! Populate failed at revision!"+(i+1)+" on class "+current.getClass().getName());
+ log.error("Whoa! Persistance layer problem was:"+e.getMessage());
}
factory.close();
- System.out.println("------------------------------------------------\n");
}
return true;
}
Modified: maven/trunk/ogoglio-integration-test/pom.xml
===================================================================
--- maven/trunk/ogoglio-integration-test/pom.xml 2007-09-03 23:33:13 UTC (rev 355)
+++ maven/trunk/ogoglio-integration-test/pom.xml 2007-09-04 15:26:50 UTC (rev 356)
@@ -7,11 +7,11 @@
<!-- About this project -->
<parent>
- <groupId>com.ogoglio</groupId>
- <artifactId>ogoglio</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <relativePath>../ogoglio</relativePath>
- </parent>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <relativePath>../ogoglio</relativePath>
+ </parent>
<artifactId>ogoglio-integration-test</artifactId>
<packaging>pom</packaging>
@@ -25,12 +25,13 @@
<include>basic-config.properties</include>
<include>bootstrap.properties</include>
</includes>
- </testResource>
+ </testResource>
<testResource>
<filtering>false</filtering>
<directory>src/test/resources</directory>
<includes>
+ <include>log4j.properties</include>
<include>mail/*</include>
<include>sample-art3d/*</include>
</includes>
@@ -58,7 +59,7 @@
</execution>
</executions>
<configuration>
- <skip>true</skip> <!--skip unit tests -->
+ <skip>true</skip><!--skip unit tests -->
</configuration>
</plugin>
<!--need to compile b/c POM packaging doesn't get it by def -->
@@ -87,15 +88,14 @@
</goals>
</execution>
</executions>
- <configuration/>
+ <configuration />
</plugin>
<!--lots of CARGO magic to bring server up, do deploys... -->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>0.3-SNAPSHOT</version>
- <configuration>
- </configuration>
+ <configuration></configuration>
<executions>
<execution>
<!--bring up server in /tmp -->
@@ -106,14 +106,13 @@
</goals>
<configuration>
<wait>false</wait>
-
<container>
<containerId>tomcat5x</containerId>
<home>${cargo.tomcat5x.home}</home>
<log>${basedir}/tomcat5x.log</log>
<output>${basedir}/tomcat5x.out</output>
</container>
- <!-- tomcat configuration -->
+ <!-- container configuration -->
<configuration>
<type>standalone</type>
<home>${ogoglio.tmp.tomcat5x}</home>
@@ -121,19 +120,19 @@
<cargo.servlet.port>
8080
</cargo.servlet.port>
- <cargo.logging>
- high
- </cargo.logging>
+ <cargo.logging>high</cargo.logging>
</properties>
<!-- tricky: this gets put in *before* the server even boots -->
<deployables>
<deployable>
- <groupId>com.ogoglio</groupId>
- <artifactId>ogoglio-server</artifactId>
- <type>war</type>
- <properties>
- <context>og</context>
- </properties>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>
+ ogoglio-server
+ </artifactId>
+ <type>war</type>
+ <properties>
+ <context>og</context>
+ </properties>
</deployable>
</deployables>
</configuration>
@@ -144,7 +143,7 @@
</plugins>
</build>
-
+
<dependencies>
<dependency>
<groupId>junit</groupId>
@@ -167,6 +166,14 @@
<artifactId>ogoglio-viewer-applet</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <!-- version, scope, optional inherited but overwritable -->
+ </dependency>
+
+
</dependencies>
</project>
Added: maven/trunk/ogoglio-integration-test/src/test/resources/log4j.properties
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/resources/log4j.properties (rev 0)
+++ maven/trunk/ogoglio-integration-test/src/test/resources/log4j.properties 2007-09-04 15:26:50 UTC (rev 356)
@@ -0,0 +1,49 @@
+### direct log messages to stdout ###
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+### direct messages to file hibernate.log ###
+#log4j.appender.file=org.apache.log4j.FileAppender
+#log4j.appender.file.File=hibernate.log
+#log4j.appender.file.layout=org.apache.log4j.PatternLayout
+#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+### set log levels - for more verbose logging change 'info' to 'debug' ###
+
+log4j.rootLogger=warn, stdout
+
+log4j.logger.com.ogoglio.migrate=info
+
+log4j.logger.org.hibernate=error
+#log4j.logger.org.hibernate=debug
+
+### log HQL query parser activity
+#log4j.logger.org.hibernate.hql.ast.AST=debug
+
+### log just the SQL
+#log4j.logger.org.hibernate.SQL=debug
+
+### log JDBC bind parameters ###
+#log4j.logger.org.hibernate.type=info
+#log4j.logger.org.hibernate.type=debug
+
+### log schema export/update ###
+#log4j.logger.org.hibernate.tool.hbm2ddl=info
+
+### log HQL parse trees
+#log4j.logger.org.hibernate.hql=debug
+
+### log cache activity ###
+#log4j.logger.org.hibernate.cache=debug
+
+### log transaction activity
+#log4j.logger.org.hibernate.transaction=debug
+
+### log JDBC resource acquisition
+#log4j.logger.org.hibernate.jdbc=debug
+
+### enable the following line if you want to track down connection ###
+### leakages when using DriverManagerConnectionProvider ###
+#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
Modified: maven/trunk/ogoglio-server/pom.xml
===================================================================
--- maven/trunk/ogoglio-server/pom.xml 2007-09-03 23:33:13 UTC (rev 355)
+++ maven/trunk/ogoglio-server/pom.xml 2007-09-04 15:26:50 UTC (rev 356)
@@ -76,6 +76,7 @@
<filtering>false</filtering>
<directory>src/test/resources</directory>
<includes>
+ <include>log4j.properties</include>
<include>mail/*</include>
<include>templates/*</include>
</includes>
@@ -197,6 +198,13 @@
<artifactId>commons-httpclient</artifactId>
<version>3.0.1</version>
</dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <!-- version, scope, optional inherited but overwritable -->
+ </dependency>
+
<dependency>
<groupId>com.sun</groupId>
<artifactId>mail</artifactId>
Deleted: maven/trunk/ogoglio-server/src/main/resources/log4j/log4j.properties
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/log4j/log4j.properties 2007-09-03 23:33:13 UTC (rev 355)
+++ maven/trunk/ogoglio-server/src/main/resources/log4j/log4j.properties 2007-09-04 15:26:50 UTC (rev 356)
@@ -1,47 +0,0 @@
-### direct log messages to stdout ###
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
-
-### direct messages to file hibernate.log ###
-#log4j.appender.file=org.apache.log4j.FileAppender
-#log4j.appender.file.File=hibernate.log
-#log4j.appender.file.layout=org.apache.log4j.PatternLayout
-#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
-
-### set log levels - for more verbose logging change 'info' to 'debug' ###
-
-log4j.rootLogger=warn, stdout
-
-#log4j.logger.org.hibernate=warn
-#log4j.logger.org.hibernate=debug
-
-### log HQL query parser activity
-#log4j.logger.org.hibernate.hql.ast.AST=debug
-
-### log just the SQL
-#log4j.logger.org.hibernate.SQL=debug
-
-### log JDBC bind parameters ###
-#log4j.logger.org.hibernate.type=info
-#log4j.logger.org.hibernate.type=debug
-
-### log schema export/update ###
-#log4j.logger.org.hibernate.tool.hbm2ddl=info
-
-### log HQL parse trees
-#log4j.logger.org.hibernate.hql=debug
-
-### log cache activity ###
-#log4j.logger.org.hibernate.cache=debug
-
-### log transaction activity
-#log4j.logger.org.hibernate.transaction=debug
-
-### log JDBC resource acquisition
-#log4j.logger.org.hibernate.jdbc=debug
-
-### enable the following line if you want to track down connection ###
-### leakages when using DriverManagerConnectionProvider ###
-#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
Added: maven/trunk/ogoglio-server/src/main/resources/log4j/log4j.properties
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/log4j/log4j.properties (rev 0)
+++ maven/trunk/ogoglio-server/src/main/resources/log4j/log4j.properties 2007-09-04 15:26:50 UTC (rev 356)
@@ -0,0 +1,49 @@
+### direct log messages to stdout ###
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+### direct messages to file hibernate.log ###
+#log4j.appender.file=org.apache.log4j.FileAppender
+#log4j.appender.file.File=hibernate.log
+#log4j.appender.file.layout=org.apache.log4j.PatternLayout
+#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+### set log levels - for more verbose logging change 'info' to 'debug' ###
+
+log4j.rootLogger=warn, stdout
+
+log4j.logger.com.ogoglio.migrate=info
+
+log4j.logger.org.hibernate=error
+#log4j.logger.org.hibernate=debug
+
+### log HQL query parser activity
+#log4j.logger.org.hibernate.hql.ast.AST=debug
+
+### log just the SQL
+#log4j.logger.org.hibernate.SQL=debug
+
+### log JDBC bind parameters ###
+#log4j.logger.org.hibernate.type=info
+#log4j.logger.org.hibernate.type=debug
+
+### log schema export/update ###
+#log4j.logger.org.hibernate.tool.hbm2ddl=info
+
+### log HQL parse trees
+#log4j.logger.org.hibernate.hql=debug
+
+### log cache activity ###
+#log4j.logger.org.hibernate.cache=debug
+
+### log transaction activity
+#log4j.logger.org.hibernate.transaction=debug
+
+### log JDBC resource acquisition
+#log4j.logger.org.hibernate.jdbc=debug
+
+### enable the following line if you want to track down connection ###
+### leakages when using DriverManagerConnectionProvider ###
+#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|