2013-05-15 2 views
0

메모리 내장 데이터베이스를 만들 때 오류가 발생합니다. Tomcat 서버에서 프로그램을 시작할 때 데이터베이스에 삽입 할 때까지 제대로 실행되는 것 같습니다. 내 톰캣 로그 계시 다음 갑자기이 오류를 일으키는 이유를 모르겠어요봄에서 최대 절전 모드 데이터베이스 생성 오류

Hibernate: alter table BrokerReferrerJoin drop constraint FK_cfc40c4c7e94cd7d7f0f0 
Hibernate: alter table BrokerTable drop constraint FK_85c86a6cd9d14a23840e4746545 
Hibernate: alter table LeadTable drop constraint FK_26c301acde8d4daa93734bda8ff 
Hibernate: alter table LeadTable drop constraint FK_d358f93455874bcba7ed6afd996 
Hibernate: alter table ReferrerBrokerJoin drop constraint FK_60dc4e2e6a44406a8fdf4e869e8 
Hibernate: alter table ReferrerTable drop constraint FK_910ad4a791e9434da73fbc24ba5 
Hibernate: drop table BrokerReferrerJoin if exists 
Hibernate: drop table BrokerTable if exists 
Hibernate: drop table LeadTable if exists 
Hibernate: drop table Person if exists 
Hibernate: drop table ReferrerBrokerJoin if exists 
Hibernate: drop table ReferrerTable if exists 
Hibernate: alter table BrokerReferrerJoin drop constraint FK_7100b66fe58043ed9fcba0c116c 
Hibernate: alter table BrokerTable drop constraint FK_b5a6bbb0789c46b39597c4eb788 
Hibernate: alter table LeadTable drop constraint FK_e19293e489d2443f80cef09bf10 
Hibernate: alter table LeadTable drop constraint FK_0a56acd9932f4f4f930f1b4c23b 
Hibernate: alter table ReferrerBrokerJoin drop constraint FK_c700fee7563d461fb33336901e7 
Hibernate: alter table ReferrerTable drop constraint FK_c449adf2fb9e4f4d985c944d852 
Hibernate: drop table BrokerReferrerJoin if exists 
Hibernate: drop table BrokerTable if exists 
Hibernate: drop table LeadTable if exists 
Hibernate: drop table Person if exists 
Hibernate: drop table ReferrerBrokerJoin if exists 
Hibernate: drop table ReferrerTable if exists 
Hibernate: create table BrokerReferrerJoin (FlexRowIDLink varchar(255) not null, InternalReferrerIDLink varchar(255) not null) 
Hibernate: create table BrokerTable (AdminID varchar(255), isAdmin boolean, FlexRowID varchar(255) not null, primary key (FlexRowID)) 
Hibernate: create table LeadTable (LeadID varchar(255) generated by default as identity (start with 1), Amount double, FlexRowID varchar(255), LeadEmail varchar(50), LeadFName varchar(50) not null, HPhoneNo integer, LeadLName varchar(50) not null, MPhoneNo bigint, Notes varchar(4095), WPhoneNo integer, Status varchar(255), LoanType varchar(255), leadBroker_FlexRowID varchar(255), leadReferrer_FlexRowID varchar(255), primary key (LeadID)) 
Hibernate: create table Person (FlexRowID varchar(255) not null, CreatedOn date, Email varchar(255), FName varchar(255), LName varchar(255), LastUpdated date, OrgID varchar(255), OrgName varchar(255), Username varchar(255), primary key (FlexRowID)) 
Hibernate: create table ReferrerBrokerJoin (InternalReferrerIDLink varchar(255) not null, FlexRowIDLink varchar(255) not null) 
Hibernate: create table ReferrerTable (LTSRowID varchar(255), FlexRowID varchar(255) not null, primary key (FlexRowID)) 
Hibernate: alter table BrokerReferrerJoin add constraint UK_bc91f298149c4420bc453811411 unique (InternalReferrerIDLink) 
Hibernate: alter table BrokerReferrerJoin add constraint FK_7100b66fe58043ed9fcba0c116c foreign key (FlexRowIDLink) references BrokerTable 
Hibernate: alter table BrokerTable add constraint FK_b5a6bbb0789c46b39597c4eb788 foreign key (FlexRowID) references Person 
Hibernate: alter table LeadTable add constraint FK_e19293e489d2443f80cef09bf10 foreign key (leadBroker_FlexRowID) references BrokerTable 
Hibernate: alter table LeadTable add constraint FK_0a56acd9932f4f4f930f1b4c23b foreign key (leadReferrer_FlexRowID) references ReferrerTable 
Hibernate: alter table ReferrerBrokerJoin add constraint UK_836e448745504545aaa39709e22 unique (FlexRowIDLink) 
Hibernate: alter table ReferrerBrokerJoin add constraint FK_c700fee7563d461fb33336901e7 foreign key (FlexRowIDLink) references BrokerTable 
Hibernate: alter table ReferrerTable add constraint UK_b0c668bb487b4a1d8b5f7b9657b unique (LTSRowID) 
Hibernate: alter table ReferrerTable add constraint FK_c449adf2fb9e4f4d985c944d852 foreign key (FlexRowID) references Person 
18:52:45.573 [http-bio-8080-exec-3] ERROR com.au.curtin.Lead.HibernateLeadDao - The sessionFactory was set: [email protected]028 
18:52:45.592 [http-bio-8080-exec-3] ERROR com.au.curtin.Lead.LeadServiceClass - The HibernateLeadDao was set: [email protected] 
18:52:49.862 [http-bio-8080-exec-7] ERROR com.au.curtin.LoginController - Starting logger 
18:52:54.253 [http-bio-8080-exec-9] ERROR com.au.curtin.LeadController - Returning Referrer Home View 
18:53:01.035 [http-bio-8080-exec-10] ERROR com.au.curtin.LeadController - org.springframework.validation.BeanPropertyBindingResult: 0 errors 
18:53:01.035 [http-bio-8080-exec-10] ERROR com.au.curtin.Lead.LeadServiceClass - Home Phone Number: 94572707Work Phone Number : nullMobile Phone Number: nullEmail : 
18:53:01.098 [http-bio-8080-exec-10] ERROR com.au.curtin.Lead.LeadServiceClass - [email protected] 
18:53:01.098 [http-bio-8080-exec-10] ERROR com.au.curtin.Lead.HibernateLeadDao - Lead : Lead [leadID=null, flexRowID=null, leadFirstName=James, leadLastName=Massey, leadHomePhoneNumber=94572707, leadWorkPhoneNumber=null, leadMobilePhoneNumber=null, borrowingAmount=1000.0, leadEmail=, loanType=null, leadNotes=, leadBroker=null, leadReferrer=null, loanStatus=null]Session is: SessionImpl(PersistenceContext[entityKeys=[],collectionKeys=[]];ActionQueue[insertions=[] updates=[] deletions=[] collectionCreations=[] collectionRemovals=[] collectionUpdates=[] unresolvedInsertDependencies=UnresolvedEntityInsertActions[]]) 
Hibernate: insert into LeadTable (LeadID, Amount, FlexRowID, leadBroker_FlexRowID, LeadEmail, LeadFName, HPhoneNo, LeadLName, MPhoneNo, Notes, leadReferrer_FlexRowID, WPhoneNo, Status, LoanType) values (default, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 

. 모든 필드는 주석으로 설정됩니다. 당신은 내가 데이터베이스를 설정하기위한 주석을 사용하여, 내 거래에있어 볼 수 있듯이 여기

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx" 
    xmlns:jdbc="http://www.springframework.org/schema/jdbc" 
    xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd 
     http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd 
     http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd 
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd 
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd 
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"> 

    <tx:annotation-driven transaction-manager="transactionManager" /> 
    <jdbc:embedded-database id="LTSDatabase" type="HSQL" /> 
    <context:component-scan base-package="x.y" /> 

    <bean id="sessionFactory" 
     class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> 
     <property name="dataSource" ref="LTSDatabase" /> 
     <property name="annotatedClasses"> 
      <list> 
       <value>x.y.Lead</value> 
       <value>x.y.Broker</value> 
       <value>x.y.Referrer</value> 
      </list> 
     </property> 
     <property name="hibernateProperties"> 
      <props> 
       <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop> 
       <prop key="hibernate.show_sql">true</prop> 
       <prop key="hibernate.hbm2ddl.auto">update</prop> 
      </props> 
     </property> 
    </bean> 

    <bean id="PersistenceAnnotationPostProcessor" 
     class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /> 
    <bean id="hibernateExceptionTranslator" 
     class="org.springframework.orm.hibernate4.HibernateExceptionTranslator" /> 
    <bean 
     class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" 
     id="PersistenceExceptionTranslator" depends-on="hibernateExceptionTranslator" /> 

    <bean id="transactionManager" 
     class="org.springframework.orm.hibernate4.HibernateTransactionManager"> 
     <property name="sessionFactory" ref="sessionFactory" /> 
    </bean> 
</beans> 

.XML 나의 봄이다. 왜이 오류가 발생하는지 알 수 없습니다. 왜 이런 일이 일어 났는지 아는 사람이라면 알려주세요.

스프링 3, 하이버 네이트 4.2, 톰캣 7이 도움이된다면 사용하고 있습니다.

답변

0

이 경우 누구에게나 도움이되는 경우 내 문제는 내가 문자열로 선언 된 기본 키가 될 필드를 만들려고한다는 것입니다. Hibernate는 숫자가 아닌 자동 생성 기본 키를 처리 할 수 ​​없다.