<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi ,kris ,thank you very much for your reply. I have orm.xml in META-INF folder.<BR>
Yesterday,i modified the persistence.xml to solve this problem like below:<BR>
<BR>
=================persistence.xml================<BR>
<BR>
<property name="hibernate.max_fetch_depth" value="3"/><BR> <FONT color=#ff0000><!--property name="hibernate.hbm2ddl.auto" value="create" /--><BR></FONT> <property name="hibernate.show_sql" value="true" /><BR>
<BR>
==================persistence.xml END==============<BR>
<BR>
I change the <FONT color=#ff0000><property name="hibernate.hbm2ddl.auto" value="create" /> </FONT><FONT color=#000000>into comments,then </FONT><BR>
<FONT color=#000000>create the table in DB using the SQL:</FONT><BR>
========SQL========<BR>
<FONT color=#000000>create table Notification_EmailNotificationHeader<BR> (Notification_id numeric(19,0) not null, emailHeaders_id numeric(19,0) not<BR>null, mapkey varchar(255) <FONT color=#ff0000>not null</FONT>, primary key (Notification_id, mapkey), unique (emailHeaders_id))</FONT><BR>
<BR>
=====SQL END========<BR>
<BR>
it works ok now~<BR>
<BR>
but i want to know where the SQL "creat table……" defined?<BR>
<BR> <BR>> From: kris.verlaenen@cs.kuleuven.be<BR>> To: rules-users@lists.jboss.org<BR>> Date: Tue, 27 Jul 2010 14:32:37 +0200<BR>> Subject: Re: [rules-users] Exception when use Human Task<BR>> <BR>> It doesn't seem to be able to find a query, which should be defined in the <BR>> orm.xml. Do you have the orm.xml file in your META-INF folder on your <BR>> classpath?<BR>> http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/orm.xml<BR>> <BR>> Kris<BR>> <BR>> ----- Original Message ----- <BR>> From: "XiaoMiTang" <dingyongchang@hotmail.com><BR>> To: <rules-users@lists.jboss.org><BR>> Sent: Tuesday, July 27, 2010 11:06 AM<BR>> Subject: [rules-users] Exception when use Human Task<BR>> <BR>> <BR>> ><BR>> > I got an exception when using Human Task ,caused by the following code:<BR>> ><BR>> > ===============code===========<BR>> > EntityManagerFactory emf = Persistence.createEntityManagerFactory("aaaa");<BR>> > TaskService taskService = new<BR>> > TaskService(emf,SystemEventListenerFactory.getSystemEventListener());<BR>> > ===============code end=======<BR>> ><BR>> > the error info in the Eclipse's Console llike this:<BR>> > ===========error info=====<BR>> > 严重: Unsuccessful: create table Notification_EmailNotificationHeader<BR>> > (Notification_id numeric(19,0) not null, emailHeaders_id numeric(19,0) not<BR>> > null, mapkey varchar(255) null, primary key (Notification_id, mapkey),<BR>> > unique (emailHeaders_id))<BR>> > 2010-7-27 16:39:38 org.hibernate.tool.hbm2ddl.SchemaExport create<BR>> > 严重: 无法在表 'Notification_EmailNotificationHeader' 中可为 Null 的列上定义 PRIMARY KEY<BR>> > 约束。<BR>> > 2010-7-27 16:39:38 org.hibernate.tool.hbm2ddl.SchemaExport create<BR>> > 严重: Unsuccessful: alter table Notification_EmailNotificationHeader add<BR>> >
constraint FK92169CC0379F97EA foreign key (emailHeaders_id) references<BR>> > EmailNotificationHeader<BR>> > 2010-7-27 16:39:38 org.hibernate.tool.hbm2ddl.SchemaExport create<BR>> > 严重: 找不到对象 "Notification_EmailNotificationHeader",因为它不存在或者您没有所需的权限。<BR>> > 2010-7-27 16:39:38 org.hibernate.tool.hbm2ddl.SchemaExport create<BR>> > 严重: Unsuccessful: alter table Notification_EmailNotificationHeader add<BR>> > constraint FK92169CC01B1E66DC foreign key (Notification_id) references<BR>> > Notification<BR>> > 2010-7-27 16:39:38 org.hibernate.tool.hbm2ddl.SchemaExport create<BR>> > 严重: 找不到对象 "Notification_EmailNotificationHeader",因为它不存在或者您没有所需的权限。<BR>> > 2010-7-27 16:39:38 org.hibernate.tool.hbm2ddl.SchemaExport execute<BR>> > 信息: schema export complete<BR>> > java.lang.IllegalArgumentException: Named query not found:<BR>> > UnescalatedDeadlines<BR>> > at<BR>> > org.hibernate.ejb.AbstractEntityManagerImpl.createNamedQuery(AbstractEntityManagerImpl.java:108)<BR>> > at org.drools.task.service.TaskService.<init>(TaskService.java:65)<BR>> > at org.drools.task.service.TaskService.<init>(TaskService.java:48)<BR>> > at com.demo.action.loginController.HumanTask(loginController.java:94)<BR>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<BR>> > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<BR>> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR>> > at java.lang.reflect.Method.invoke(Unknown Source)<BR>> > at<BR>> > org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:174)<BR>> > at<BR>> > org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:421)<BR>> > at<BR>> > org.springframework.web.servlet.mvc.annotatio
n.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:409)<BR>> > at<BR>> > org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771)<BR>> > at<BR>> > org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)<BR>> > at<BR>> > org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)<BR>> > at<BR>> > org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)<BR>> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)<BR>> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<BR>> > at<BR>> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)<BR>> > at<BR>> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<BR>> > at<BR>> > org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)<BR>> > at<BR>> > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)<BR>> > at<BR>> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)<BR>> > at<BR>> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<BR>> > at<BR>> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)<BR>> > at<BR>> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)<BR>> > at<BR>> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)<BR>> > at<BR>> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)<BR>> > at<BR>> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)<BR>> > at<BR>> > org.apache.catalina
.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)<BR>> > at<BR>> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)<BR>> > at<BR>> > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)<BR>> > at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)<BR>> > at java.lang.Thread.run(Unknown Source)<BR>> > =======error info end===============================================<BR>> ><BR>> > the top error info(chinese text) means that:<BR>> > [mapkey] is nullable, it can not be defined as primary key ;<BR>> ><BR>> > how to slove it?<BR>> > Thansks~<BR>> > -- <BR>> > View this message in context: <BR>> > http://drools-java-rules-engine.46999.n3.nabble.com/Exception-when-use-Human-Task-tp998703p998703.html<BR>> > Sent from the Drools - User mailing list archive at Nabble.com.<BR>> ><BR>> > _______________________________________________<BR>> > rules-users mailing list<BR>> > rules-users@lists.jboss.org<BR>> > https://lists.jboss.org/mailman/listinfo/rules-users<BR>> > <BR>> <BR>> <BR>> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm<BR>> _______________________________________________<BR>> rules-users mailing list<BR>> rules-users@lists.jboss.org<BR>> https://lists.jboss.org/mailman/listinfo/rules-users<BR>                                            <br /><hr />Hotmail: Powerful Free email with security by Microsoft. <a href='https://signup.live.com/signup.aspx?id=60969' target='_new'>Get it now.</a></body>
</html>