-
1. Re: JbpmContext is always null
dkmorb Nov 26, 2008 9:02 AM (in response to dkmorb)Probably i must describe my scenario:
1) I have my application running on same AS (jboss) of jbpm-console
2) My application run on 8082 and it must show the list of deployed processes by jpdl.
3) My application uses its hibernate.cfg.xml and the error makes me wonder to some conflicts with jbpm session.
4) I use jbpm 3.2.2
5) Processdefinition files are deployed on local jbpm-console (just during development)
Thanks again. -
2. Re: JbpmContext is always null
salaboy21 Nov 26, 2008 9:39 AM (in response to dkmorb)Where are you running this code?
if you are doing this in a JUnit test, you must ensure that jbpm.cfg.xml is in your classpath, so you can do the following:JbpmConfiguration conf= JbpmConfiguration.getInstance(); JbpmContext context=conf.createJbpmContext();
Then you should check that your context is not null. -
3. Re: JbpmContext is always null
dkmorb Nov 26, 2008 9:58 AM (in response to dkmorb)Ok, salaboy21
I follow your suggestion but nothing change...it seems jbpm.cfg.xml is not correct because an error regarding a class of my application is required. The error isCaused by: org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="it.eurosoft.mapping....
How do this two simple called functions want MY mapping class? Is jbpm reading my hibernate.cfg.xml? :-(
Bye. -
4. Re: JbpmContext is always null
salaboy21 Nov 26, 2008 10:20 AM (in response to dkmorb)Of course, if you not have content in your jbpm.cfg.xml, the content is taken from default.jbpm.cfg.xml that is in jbpm-jpdl.jar. Inside this file, there is a reference to hibernate.cfg.xml.
So check your mappings in hibernate.cfg.xml in order to fix your problem -
5. Re: JbpmContext is always null
dkmorb Nov 26, 2008 11:09 AM (in response to dkmorb)Oh my god...I don't understand...so I need to add to MY hibernate.cfg.xml the mappings, for instance, from hibernate.cfg.xml of jbpm-console...but then it should require me to put in my jar all mapping xml...
Thanks! -
6. Re: JbpmContext is always null
salaboy21 Nov 26, 2008 11:24 AM (in response to dkmorb)If you want to create or use a JbpmContext you need to know where is the structe of the processDefinitions and the processInstances. For this, of course that you need to know where and how all the structure are mapped.
So if you also add entities in variables, you need to map it too...
If you are in a standalone app, you will need the same hibernate mappings that you have in the console.. and may you must change where the Datasource is pointing.
Hope it helps -
7. Re: JbpmContext is always null
dkmorb Nov 26, 2008 11:47 AM (in response to dkmorb)Perfect salaboy21,
and how can I know where is the structure of the processDefinitions and the processInstances? -
8. Re: JbpmContext is always null
salaboy21 Nov 26, 2008 11:53 AM (in response to dkmorb)this is why you need hibernate.cfg.xml with the correct mappings..
because there is the structure of your process and the data of your instances.
If you create a sample project with eclipse you should see that a hibernate.cfg.xml is created for you and an empty jbmp.cfg.xml is also created.