Some changes to make it easier to run the sample with the database driver as part of the jetty plugin configuration, preventing classloader leaks.

This commit is contained in:
Luke Taylor 2009-05-05 03:21:07 +00:00
parent 6d655aa514
commit 331a04c07c
2 changed files with 28 additions and 6 deletions

View File

@ -66,16 +66,16 @@
<groupId>net.sf.ehcache</groupId> <groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId> <artifactId>ehcache</artifactId>
</dependency> </dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>
<dependency> <dependency>
<groupId>hessian</groupId> <groupId>hessian</groupId>
<artifactId>hessian</artifactId> <artifactId>hessian</artifactId>
<version>3.0.1</version> <version>3.0.1</version>
</dependency> </dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
@ -96,11 +96,21 @@
<configuration> <configuration>
<contextPath>/contacts</contextPath> <contextPath>/contacts</contextPath>
<!--jettyConfig>${basedir}/src/test/resources/jetty.xml</jettyConfig--> <!--jettyConfig>${basedir}/src/test/resources/jetty.xml</jettyConfig-->
<scanIntervalSeconds>10</scanIntervalSeconds> <scanIntervalSeconds>5</scanIntervalSeconds>
<!--scanTargets> <!--scanTargets>
<scanTarget>src/main/webapp/css</scanTarget> <scanTarget>src/main/webapp/css</scanTarget>
</scanTargets--> </scanTargets-->
</configuration> </configuration>
<!--
<dependencies>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.7</version>
<scope>runtime</scope>
</dependency>
</dependencies>
-->
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View File

@ -76,6 +76,18 @@ public class DataSourcePopulator implements InitializingBean {
AuthorityUtils.createAuthorityList("ROLE_IGNORED")); AuthorityUtils.createAuthorityList("ROLE_IGNORED"));
SecurityContextHolder.getContext().setAuthentication(authRequest); SecurityContextHolder.getContext().setAuthentication(authRequest);
try {
template.execute("DROP TABLE CONTACTS");
template.execute("DROP TABLE AUTHORITIES");
template.execute("DROP TABLE USERS");
template.execute("DROP TABLE ACL_ENTRY");
template.execute("DROP TABLE ACL_OBJECT_IDENTITY");
template.execute("DROP TABLE ACL_CLASS");
template.execute("DROP TABLE ACL_SID");
} catch(Exception e) {
System.out.println("Failed to drop tables: " + e.getMessage());
}
template.execute( template.execute(
"CREATE TABLE ACL_SID(" + "CREATE TABLE ACL_SID(" +
"ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY," + "ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY," +