I have post this problem before, but have not solved.
Thanks all.
The next is my detail process:
1: I execute oracle database script to build database, there are Group_List
table and some other tables
2: I execute "mvn appfuse:gen-mode" to create POJO for Group_List
3: I exectue "mvn appfuse:gen -Dentity=GroupList" to generate dao, service,
web code.
4: I execute "mvn package" to package the project. then the log will be
like:
[INFO] Scanning for projects...
[INFO]
----------------------------------------------------------------------------
[INFO] Building AppFuse Struts 2 Application
[INFO] task-segment: [package]
[INFO]
----------------------------------------------------------------------------
[INFO] [aspectj:compile {execution: default}]
[INFO] [native2ascii:native2ascii {execution: native2ascii-utf8}]
[INFO] [native2ascii:native2ascii {execution: native2ascii-8859_1}]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] Preparing hibernate3:hbm2ddl
[WARNING] Removing: hbm2ddl from forked lifecycle, to prevent
recursive invocation.
[INFO] [aspectj:compile {execution: default}]
[INFO] [native2ascii:native2ascii {execution: native2ascii-utf8}]
[INFO] [native2ascii:native2ascii {execution: native2ascii-8859_1}]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[WARNING] POM for 'org.hibernate:jtidy:pom:r8-20060801:runtime' is
invalid. It will be ignored for
artifact resolution. Reason: Parse error reading POM. Reason: TEXT must
be immediately followed by
END_TAG and not START_TAG (position: START_TAG seen
...<licenses>\n\t\t\t<license>... @12:13)
[WARNING] POM for 'org.hibernate:jtidy:pom:r8-20060801:runtime' is
invalid. It will be ignored for
artifact resolution. Reason: Parse error reading POM. Reason: TEXT
must be immediately followed by
END_TAG and not START_TAG (position: START_TAG seen
...<licenses>\n\t\t\t<license>... @12:13)
[INFO] [hibernate3:hbm2ddl {execution: default}]
[INFO] Configuration XML file loaded:
D:\AppFuse2-MySQL5\DQViewer\src\main\resources\hibernate.cfg.xml
[INFO] Configuration XML file loaded:
D:\AppFuse2-MySQL5\DQViewer\src\main\resources\hibernate.cfg.xml
[INFO] Configuration Properties file loaded:
D:\AppFuse2-MySQL5\DQViewer\target\classes\jdbc.properties
drop table DATA_QUALITY_ISSUE_DQ_USER cascade constraints;
drop table DQTRACER.DATA_QUALITY_ISSUE cascade constraints;
drop table DQTRACER.DICT_FLAG_TYPE cascade constraints;
drop table DQTRACER.DICT_STATUS cascade constraints;
drop table DQTRACER.DQ_MENU cascade constraints;
drop table DQTRACER.DQ_PRIVILEGE cascade constraints;
drop table DQTRACER.DQ_ROLE cascade constraints;
drop table DQTRACER.DQ_USER cascade constraints;
drop table DQTRACER.EMERGENCY cascade constraints;
drop table DQTRACER.GENERATOR cascade constraints;
drop table DQTRACER.GROUP_LIST cascade constraints;
drop table DQ_MENU_DQ_PRIVILEGE cascade constraints;
drop table DQ_MENU_DQ_ROLE cascade constraints;
drop table DQ_PRIVILEGE_DQ_ROLE cascade constraints;
drop table DQ_ROLE_DQ_USER cascade constraints;
drop table GROUP_LIST_DATA_QUALITY_ISSUE cascade constraints;
drop table GROUP_LIST_DQ_USER cascade constraints;
drop table GROUP_LIST_GENERATOR cascade constraints;
drop table app_user cascade constraints;
drop table role cascade constraints;
drop table user_role cascade constraints;
drop sequence hibernate_sequence;
create table DATA_QUALITY_ISSUE_DQ_USER (dataQualityIssues_id
number(19,2) not null, dqUsers_id number(19,2) not null, primary key
(dataQualityIssues_id, dqUsers_id));
create table DQTRACER.DATA_QUALITY_ISSUE (id number(19,2) not null,
ATTRIBUTE_NAME varchar2(4000 char), ENTITY_NAME varchar2(4000 char), ROW_ID
varchar2(4000 char), ISSUE_NAME varchar2(255 char) not null, ISSUE_DESC
varchar2(4000 char), CURRENT_ATTRIBUTE_VALUE varchar2(4000 char), NOTES
clob, DEADLINE date, SERIALIZED_OBJECT clob, MYCOMMENT clob, USER_NAME
varchar2(255 char), TIME_STAMP date, DQISSUE_GENERATOR_ID number(19,2) not
null, EMERGENCY number(19,2), STATUS number(19,2) not null, FLAG_TYPE
number(19,2), primary key (id));
create table DQTRACER.DICT_FLAG_TYPE (id number(19,2) not null, NAME
varchar2(50 char), primary key (id));
create table DQTRACER.DICT_STATUS (id number(19,2) not null, NAME
varchar2(50 char), primary key (id));
create table DQTRACER.DQ_MENU (id number(19,2) not null, PARENTNAME
varchar2(255 char), ISVISIBLE number(22,0), NAME varchar2(255 char),
LOCATION varchar2(255 char), TITLE varchar2(255 char), primary key (id));
create table DQTRACER.DQ_PRIVILEGE (id number(19,2) not null, NAME
varchar2(255 char), DESCRIPTION varchar2(255 char), primary key (id));
create table DQTRACER.DQ_ROLE (id number(19,2) not null, NAME
varchar2(255 char), DESCRIPTION varchar2(255 char), primary key (id));
create table DQTRACER.DQ_USER (id number(19,2) not null, EMAIL
varchar2(255 char) not null unique, FIRST_NAME varchar2(255 char) not null,
LAST_NAME varchar2(255 char) not null, BT_EMPLOYEE_ID number(22,0) not null
unique, primary key (id), unique (EMAIL), unique (BT_EMPLOYEE_ID));
ERROR [main] SchemaExport.create(274) | Unsuccessful: create table
DQTRACER.DQ_USER (id number(19,2) not null, EMAIL varchar2(255 char) not
null unique, FIRST_NAME varchar2(255 char) not null, LAST_NAME varchar2(255
char) not null, BT_EMPLOYEE_ID number(22,0) not null unique, primary key
(id), unique (EMAIL), unique (BT_EMPLOYEE_ID))
ERROR [main] SchemaExport.create(275) | ORA-02261: such unique or primary
key already exists in the table
create table DQTRACER.EMERGENCY (id number(19,2) not null, NAME
varchar2(50 char), primary key (id));
create table DQTRACER.GENERATOR (id number(19,2) not null, NAME
varchar2(255 char) unique, DESCRIPTION varchar2(4000 char), primary key
(id), unique (NAME));
ERROR [main] SchemaExport.create(274) | Unsuccessful: create table
DQTRACER.GENERATOR (id number(19,2) not null, NAME varchar2(255 char)
unique, DESCRIPTION varchar2(4000 char), primary key (id), unique (NAME))
ERROR [main] SchemaExport.create(275) | ORA-02261: such unique or
primary key already exists in the table
create table DQTRACER.GROUP_LIST (id number(19,0) not null, GROUP_NAME
varchar2(255 char) unique, primary key (id), unique (GROUP_NAME));
ERROR [main] SchemaExport.create(274) | Unsuccessful: create table
DQTRACER.GROUP_LIST (id number(19,0) not null, GROUP_NAME varchar2(255 char)
unique, primary key (id), unique (GROUP_NAME))
ERROR [main] SchemaExport.create(275) | ORA-02261: such unique or
primary key already exists in the table
create table DQ_MENU_DQ_PRIVILEGE (dqMenus_id number(19,2) not null,
dqPrivileges_id number(19,2) not null, primary key (dqMenus_id,
dqPrivileges_id));
create table DQ_MENU_DQ_ROLE (dqMenus_id number(19,2) not null,
dqRoles_id number(19,2) not null, primary key (dqMenus_id, dqRoles_id));
create table DQ_PRIVILEGE_DQ_ROLE (dqPrivileges_id number(19,2) not
null, dqRoles_id number(19,2) not null, primary key (dqPrivileges_id,
dqRoles_id));
create table DQ_ROLE_DQ_USER (dqRoles_id number(19,2) not null,
dqUsers_id number(19,2) not null, primary key (dqRoles_id, dqUsers_id));
create table GROUP_LIST_DATA_QUALITY_ISSUE (groupLists_id number(19,0)
not null, dataQualityIssues_id number(19,2) not null, primary key
(groupLists_id, dataQualityIssues_id));
create table GROUP_LIST_DQ_USER (GROUP_LIST_id number(19,0) not null,
dqUsers_1_id number(19,2) not null, groupLists_1_id number(19,0) not null,
dqUsers_id number(19,2) not null, primary key (groupLists_1_id,
dqUsers_id));
create table GROUP_LIST_GENERATOR (groupLists_id number(19,0) not
null, generators_id number(19,2) not null, primary key (groupLists_id,
generators_id));
create table app_user (id number(19,0) not null, username varchar2(50
char) not null unique, email varchar2(255 char) not null unique,
password_hint varchar2(255 char), first_name varchar2(50 char) not null,
last_name varchar2(50 char) not null, phone_number varchar2(255 char),
website varchar2(255 char), account_expired number(1,0) not null,
account_locked number(1,0) not null, credentials_expired number(1,0) not
null, city varchar2(50 char) not null, province varchar2(100 char),
postal_code varchar2(15 char) not null, address varchar2(150 char), country
varchar2(100 char), account_enabled number(1,0), version number(10,0),
password varchar2(255 char) not null, primary key (id));
create table role (id number(19,0) not null, name varchar2(20 char),
description varchar2(64 char), primary key (id));
create table user_role (user_id number(19,0) not null, role_id
number(19,0) not null, primary key (user_id, role_id));
alter table DATA_QUALITY_ISSUE_DQ_USER add constraint FK1091CC822432966
foreign key (dqUsers_id) references DQTRACER.DQ_USER;
ERROR [main] SchemaExport.create(274) | Unsuccessful: alter table
DATA_QUALITY_ISSUE_DQ_USER add constraint FK1091CC822432966 foreign key
(dqUsers_id) references DQTRACER.DQ_USER
ERROR [main] SchemaExport.create(275) | ORA-00942: table or view does
not exist
alter table DATA_QUALITY_ISSUE_DQ_USER add constraint
FK1091CC823D75D09E foreign key (dataQualityIssues_id) references
DQTRACER.DATA_QUALITY_ISSUE;
alter table DQTRACER.DATA_QUALITY_ISSUE add constraint
FK18CB0584616DF393 foreign key (EMERGENCY) references DQTRACER.EMERGENCY;
alter table DQTRACER.DATA_QUALITY_ISSUE add constraint
FK18CB05843BDF123E foreign key (DQISSUE_GENERATOR_ID) references
DQTRACER.GENERATOR;
ERROR [main] SchemaExport.create(274) | Unsuccessful: alter table
DQTRACER.DATA_QUALITY_ISSUE add constraint FK18CB05843BDF123E foreign key
(DQISSUE_GENERATOR_ID) references DQTRACER.GENERATOR
ERROR [main] SchemaExport.create(275) | ORA-00942: table or view does
not exist
alter table DQTRACER.DATA_QUALITY_ISSUE add constraint
FK18CB05843C19C8B8 foreign key (FLAG_TYPE) references
DQTRACER.DICT_FLAG_TYPE;
alter table DQTRACER.DATA_QUALITY_ISSUE add constraint
FK18CB058487A1CE9 foreign key (STATUS) references DQTRACER.DICT_STATUS;
alter table DQ_MENU_DQ_PRIVILEGE add constraint FK946F950DEE24928E
foreign key (dqMenus_id) references DQTRACER.DQ_MENU;
alter table DQ_MENU_DQ_PRIVILEGE add constraint FK946F950D4F115800
foreign key (dqPrivileges_id) references DQTRACER.DQ_PRIVILEGE;
alter table DQ_MENU_DQ_ROLE add constraint FK1C91CC7AEE24928E foreign
key (dqMenus_id) references DQTRACER.DQ_MENU;
alter table DQ_MENU_DQ_ROLE add constraint FK1C91CC7A240053C foreign
key (dqRoles_id) references DQTRACER.DQ_ROLE;
alter table DQ_PRIVILEGE_DQ_ROLE add constraint FKCFC9CE084F115800
foreign key (dqPrivileges_id) references DQTRACER.DQ_PRIVILEGE;
alter table DQ_PRIVILEGE_DQ_ROLE add constraint FKCFC9CE08240053C
foreign key (dqRoles_id) references DQTRACER.DQ_ROLE;
alter table DQ_ROLE_DQ_USER add constraint FKE7209BE62432966 foreign
key (dqUsers_id) references DQTRACER.DQ_USER;
ERROR [main] SchemaExport.create(274) | Unsuccessful: alter table
DQ_ROLE_DQ_USER add constraint FKE7209BE62432966 foreign key (dqUsers_id)
references DQTRACER.DQ_USER
ERROR [main] SchemaExport.create(275) | ORA-00942: table or view does
not exist
alter table DQ_ROLE_DQ_USER add constraint FKE7209BE6240053C foreign
key (dqRoles_id) references DQTRACER.DQ_ROLE;
alter table GROUP_LIST_DATA_QUALITY_ISSUE add constraint
FK9D8888E5D951DB2 foreign key (groupLists_id) references
DQTRACER.GROUP_LIST;
ERROR [main] SchemaExport.create(274) | Unsuccessful: alter table
GROUP_LIST_DATA_QUALITY_ISSUE add constraint FK9D8888E5D951DB2 foreign key
(groupLists_id) references DQTRACER.GROUP_LIST
ERROR [main] SchemaExport.create(275) | ORA-00942: table or view does
not exist
alter table GROUP_LIST_DATA_QUALITY_ISSUE add constraint
FK9D8888E53D75D09E foreign key (dataQualityIssues_id) references
DQTRACER.DATA_QUALITY_ISSUE;
alter table GROUP_LIST_DQ_USER add constraint FKA635B37C61055240
foreign key (groupLists_1_id) references DQTRACER.GROUP_LIST;
ERROR [main] SchemaExport.create(274) | Unsuccessful: alter table
GROUP_LIST_DQ_USER add constraint FKA635B37C61055240 foreign key
(groupLists_1_id) references DQTRACER.GROUP_LIST
ERROR [main] SchemaExport.create(275) | ORA-00942: table or view does
not exist
alter table GROUP_LIST_DQ_USER add constraint FKA635B37C81C51B34
foreign key (dqUsers_1_id) references DQTRACER.DQ_USER;
ERROR [main] SchemaExport.create(274) | Unsuccessful: alter table
GROUP_LIST_DQ_USER add constraint FKA635B37C81C51B34 foreign key
(dqUsers_1_id) references DQTRACER.DQ_USER
ERROR [main] SchemaExport.create(275) | ORA-00942: table or view does
not exist
alter table GROUP_LIST_DQ_USER add constraint FKA635B37C2432966
foreign key (dqUsers_id) references DQTRACER.DQ_USER;
ERROR [main] SchemaExport.create(274) | Unsuccessful: alter table
GROUP_LIST_DQ_USER add constraint FKA635B37C2432966 foreign key (dqUsers_id)
references DQTRACER.DQ_USER
ERROR [main] SchemaExport.create(275) | ORA-00942: table or view does
not exist
alter table GROUP_LIST_DQ_USER add constraint FKA635B37C54BA6ECA
foreign key (GROUP_LIST_id) references DQTRACER.GROUP_LIST;
ERROR [main] SchemaExport.create(274) | Unsuccessful: alter table
GROUP_LIST_DQ_USER add constraint FKA635B37C54BA6ECA foreign key
(GROUP_LIST_id) references DQTRACER.GROUP_LIST
ERROR [main] SchemaExport.create(275) | ORA-00942: table or view does
not exist
alter table GROUP_LIST_GENERATOR add constraint FK2F2EA632D951DB2
foreign key (groupLists_id) references DQTRACER.GROUP_LIST;
ERROR [main] SchemaExport.create(274) | Unsuccessful: alter table
GROUP_LIST_GENERATOR add constraint FK2F2EA632D951DB2 foreign key
(groupLists_id) references DQTRACER.GROUP_LIST
ERROR [main] SchemaExport.create(275) | ORA-00942: table or view does
not exist
alter table GROUP_LIST_GENERATOR add constraint FK2F2EA6322A67B4FE
foreign key (generators_id) references DQTRACER.GENERATOR;
ERROR [main] SchemaExport.create(274) | Unsuccessful: alter table
GROUP_LIST_GENERATOR add constraint FK2F2EA6322A67B4FE foreign key
(generators_id) references DQTRACER.GENERATOR
ERROR [main] SchemaExport.create(275) | ORA-00942: table or view does
not exist
alter table user_role add constraint FK143BF46ADBE02EC9 foreign key
(user_id) references app_user;
alter table user_role add constraint FK143BF46A36B56AE9 foreign key
(role_id) references role;
create sequence hibernate_sequence;
[WARNING] 21 errors occurred while performing <hbm2ddl>.
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-02261: such unique or
primary key already exists in the table
[ERROR] Error #1: java.sql.SQLException: ORA-02261: such unique or
primary key already exists in the table
[ERROR] Error #1: java.sql.SQLException: ORA-02261: such unique or
primary key already exists in the table
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[ERROR] Error #1: java.sql.SQLException: ORA-00942: table or view does
not exist
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [dbunit:operation {execution: test-compile}]
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error executing database operation: CLEAN_INSERT
Embedded error: GROUP_LIST
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 12 seconds
[INFO] Finished at: Mon Oct 22 10:03:18 CST 2007
[INFO] Final Memory: 15M/27M
[INFO]
------------------------------------------------------------------------
5: After that, Table Group_List disappeared, and generated many tables
automatically for those many-to-many relationship.
It seemed that "mvn package" delete tables in database and generates
oracle database schema again.
Maybe there are something wrong in my hibernate.cfg.xml or
hibernate.reveng.xml. So, I paste xml for you,
Hibernate.cfg.xml:
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate
Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<mapping class="com.bt.agora.dqviewer.model.User"/>
<mapping class="com.bt.agora.dqviewer.model.Role"/>
<mapping
class="com.bt.agora.dqviewer.model.DataQualityIssue"/>
<mapping class="com.bt.agora.dqviewer.model.DictFlagType"/>
<mapping class="com.bt.agora.dqviewer.model.DictStatus"/>
<mapping class="com.bt.agora.dqviewer.model.DqMenu"/>
<mapping class="com.bt.agora.dqviewer.model.DqPrivilege"/>
<mapping class="com.bt.agora.dqviewer.model.DqRole"/>
<mapping class="com.bt.agora.dqviewer.model.DqUser"/>
<mapping class="com.bt.agora.dqviewer.model.Emergency"/>
<mapping class="com.bt.agora.dqviewer.model.Generator"/>
<mapping class="com.bt.agora.dqviewer.model.GroupList"/>
</session-factory>
</hibernate-configuration>
Hibernate.reveng.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering
SYSTEM
"http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
<hibernate-reverse-engineering>
<type-mapping>
<!-- jdbc-type is name fom java.sql.Types -->
<sql-type jdbc-type="VARCHAR" length='1'
hibernate-type="yes_no"/>
<!-- length, scale and precision can be used to specify the
mapping precisly -->
<sql-type jdbc-type="NUMERIC" precision='1'
hibernate-type="boolean"/>
<!-- the type-mappings are ordered. This mapping will be
consulted last,
thus overriden by the previous one if precision=1 for the
column -->
<sql-type jdbc-type="BIGINT" hibernate-type="java.lang.Long"/>
<sql-type jdbc-type="INTEGER"
hibernate-type="java.lang.Long"/>
<sql-type jdbc-type="NUMERIC"
hibernate-type="java.lang.Long"/>
</type-mapping>
<!-- BIN$ is recycle bin tables in Oracle -->
<table-filter match-name="BIN$.*" exclude="true"/>
<table-filter match-schema="DQTRACER" match-name=".*"
exclude="false"/>
</hibernate-reverse-engineering>
Thanks a lot.
Matthew
--
View this message in context:
http://www.nabble.com/why-the-table-is-disappeared-after-i-execute-%22mvn-package%22-tf4681498s2369.html#a13377456
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]