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