wangl@cmbchina
Sep 26th, 2008, 09:03 PM
hi
all,I want to replace hsqldb with mysql in contacts example.so I first created a
database named springacls,then I got a sql script from spring-security-acl-2.0.3.jar and modified it to mysql version ddl like this:
drop table if exists ACL_SID;
/*================================================= =============*/
/* Table: ACL_SID */
/*================================================= =============*/
create table ACL_SID
(
ID bigint auto_increment not null,
PRINCIPAL bool not null,
SID varchar(100) not null,
primary key (ID),
unique key ukey_1 (PRINCIPAL,SID)
)
auto_increment = 100;
DROP TABLE IF EXISTS ACL_CLASS;
CREATE TABLE ACL_CLASS(
ID BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY,
CLASS VARCHAR(100) NOT NULL,
UNIQUE KEY UNIQUE_UK_2 (CLASS))
auto_increment = 100;
INSERT INTO ACL_CLASS VALUES (1, 'sample.contact.Contact');
DROP TABLE IF EXISTS ACL_OBJECT_IDENTITY;
CREATE TABLE ACL_OBJECT_IDENTITY(
ID BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY,
OBJECT_ID_CLASS BIGINT NOT NULL,
OBJECT_ID_IDENTITY BIGINT NOT NULL,
PARENT_OBJECT BIGINT,
OWNER_SID BIGINT,
ENTRIES_INHERITING BOOLEAN NOT NULL,
UNIQUE KEY UNIQUE_UK_3 (OBJECT_ID_CLASS,OBJECT_ID_IDENTITY),
CONSTRAINT FOREIGN_FK_1 FOREIGN KEY(PARENT_OBJECT)REFERENCES ACL_OBJECT_IDENTITY(ID),
CONSTRAINT FOREIGN_FK_2 FOREIGN KEY(OBJECT_ID_CLASS)REFERENCES ACL_CLASS(ID),
CONSTRAINT FOREIGN_FK_3 FOREIGN KEY(OWNER_SID)REFERENCES ACL_SID(ID));
DROP TABLE IF EXISTS ACL_ENTRY;
CREATE TABLE ACL_ENTRY(
ID BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY,
ACL_OBJECT_IDENTITY BIGINT NOT NULL,
ACE_ORDER INT NOT NULL,
SID BIGINT NOT NULL,
MASK INTEGER NOT NULL,
GRANTING BOOLEAN NOT NULL,
AUDIT_SUCCESS BOOLEAN NOT NULL,
AUDIT_FAILURE BOOLEAN NOT NULL,
UNIQUE KEY UNIQUE_UK_4 (ACL_OBJECT_IDENTITY,ACE_ORDER),
CONSTRAINT FOREIGN_FK_4 FOREIGN KEY(ACL_OBJECT_IDENTITY) REFERENCES ACL_OBJECT_IDENTITY(ID),
CONSTRAINT FOREIGN_FK_5 FOREIGN KEY(SID) REFERENCES ACL_SID(ID));
and then I modified the applicationContext-common-business.xml, replace hsql with mysql
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerD ataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/springacls" />
<property name="username" value="root" />
<property name="password" value="root" />
</bean>
when I started the tomcat,I got error :
严重: Error listenerStart
how can i solve this problem ?
looking forward for your answer.
all,I want to replace hsqldb with mysql in contacts example.so I first created a
database named springacls,then I got a sql script from spring-security-acl-2.0.3.jar and modified it to mysql version ddl like this:
drop table if exists ACL_SID;
/*================================================= =============*/
/* Table: ACL_SID */
/*================================================= =============*/
create table ACL_SID
(
ID bigint auto_increment not null,
PRINCIPAL bool not null,
SID varchar(100) not null,
primary key (ID),
unique key ukey_1 (PRINCIPAL,SID)
)
auto_increment = 100;
DROP TABLE IF EXISTS ACL_CLASS;
CREATE TABLE ACL_CLASS(
ID BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY,
CLASS VARCHAR(100) NOT NULL,
UNIQUE KEY UNIQUE_UK_2 (CLASS))
auto_increment = 100;
INSERT INTO ACL_CLASS VALUES (1, 'sample.contact.Contact');
DROP TABLE IF EXISTS ACL_OBJECT_IDENTITY;
CREATE TABLE ACL_OBJECT_IDENTITY(
ID BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY,
OBJECT_ID_CLASS BIGINT NOT NULL,
OBJECT_ID_IDENTITY BIGINT NOT NULL,
PARENT_OBJECT BIGINT,
OWNER_SID BIGINT,
ENTRIES_INHERITING BOOLEAN NOT NULL,
UNIQUE KEY UNIQUE_UK_3 (OBJECT_ID_CLASS,OBJECT_ID_IDENTITY),
CONSTRAINT FOREIGN_FK_1 FOREIGN KEY(PARENT_OBJECT)REFERENCES ACL_OBJECT_IDENTITY(ID),
CONSTRAINT FOREIGN_FK_2 FOREIGN KEY(OBJECT_ID_CLASS)REFERENCES ACL_CLASS(ID),
CONSTRAINT FOREIGN_FK_3 FOREIGN KEY(OWNER_SID)REFERENCES ACL_SID(ID));
DROP TABLE IF EXISTS ACL_ENTRY;
CREATE TABLE ACL_ENTRY(
ID BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY,
ACL_OBJECT_IDENTITY BIGINT NOT NULL,
ACE_ORDER INT NOT NULL,
SID BIGINT NOT NULL,
MASK INTEGER NOT NULL,
GRANTING BOOLEAN NOT NULL,
AUDIT_SUCCESS BOOLEAN NOT NULL,
AUDIT_FAILURE BOOLEAN NOT NULL,
UNIQUE KEY UNIQUE_UK_4 (ACL_OBJECT_IDENTITY,ACE_ORDER),
CONSTRAINT FOREIGN_FK_4 FOREIGN KEY(ACL_OBJECT_IDENTITY) REFERENCES ACL_OBJECT_IDENTITY(ID),
CONSTRAINT FOREIGN_FK_5 FOREIGN KEY(SID) REFERENCES ACL_SID(ID));
and then I modified the applicationContext-common-business.xml, replace hsql with mysql
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerD ataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/springacls" />
<property name="username" value="root" />
<property name="password" value="root" />
</bean>
when I started the tomcat,I got error :
严重: Error listenerStart
how can i solve this problem ?
looking forward for your answer.