[JBoss jBPM] - Re: hibernate exception not hidden from ejb client
by gogoasa
After some research, I found that my problem is not caused by a Hibernate specific exception that gets thrown.
I use the GetProcessInstancesCommand in order to experiment with querying the remote ejb. This command returns a list with ProcessInstances. A ProcessInstance is read by Hibernate from the database. As Hibernate uses specific lazy-loading-aware implementations for collections -- the ProcessInstance.instances attribute, which is declared of type java.util.Map, is actually implemented by org.hibernate.collections.PersistentMap.
Which generates class loading exception while deserializing to hibernate-unaware ejb clients.
The solution would then be for the Command implementations to return clean JDK collections, by replacing Hibernate collection with JDK standard ones. Note that IIUC only the collections must be replaced, not the collection contents too, so the "cleaning" operation should not be that expensive.
For people querying the SLSB remotely that should be no problem really, compared to the network marshalling cost. I wonder if other in-JVM uses of various Command's would be more sensitive performance-wise to adding some cleaning code to the standard Command implementions in jbpm-jpdl.jar.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059447#4059447
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059447
17Â years, 4Â months
[JBoss jBPM] - Re: jBPM on JBossAS already installed
by gogoasa
Download the jbpm-jpdl-suite-3.2.1.zip file from sourceforge.
Inside you'll find deploy/jbpm-enterprise.ear. That's the main ear you'll deploy.
It needs :
* a datasource called JbpmDS which you'll have to configure.
* an authentication policy called jbpm, to add to conf/login-config.xml
The latter looks like this if you choose to keep your users in database :
<application-policy name = "jbpm">
| <authentication>
| <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
| flag="required">
| <module-option name="dsJndiName">java:/JbpmDS</module-option>
| <module-option name="principalsQuery">
| SELECT PASSWORD_ FROM JBPM_ID_USER WHERE NAME_=?
| </module-option>
| <module-option name="rolesQuery">
| SELECT g.NAME_ ,'Roles'
| FROM JBPM_ID_USER u,
| JBPM_ID_MEMBERSHIP m,
| JBPM_ID_GROUP g
| WHERE g.TYPE_='security-role'
| AND m.GROUP_ = g.ID_
| AND m.USER_ = u.ID_
| AND u.NAME_=?
| </module-option>
| </login-module>
| </authentication>
| </application-policy>
You may want to use some properties files for authentication and the configuration may be simpler.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059446#4059446
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059446
17Â years, 4Â months
EJB3.0 and JBoss AOP
by Ioannis Polyzos
Hello everybody ,
I;m trying 3 or 4 days now to use JBoss AOP with EJB 3.0 and does not
work, I have followed several tutorials as well as the "JBoss AOP
Hands-on Tutorial" but still no results. Is there anybody that have made
any working code with EJB 3.0 and JBoss AOP that can help ?
Thank you in advance
Ioannis
17Â years, 4Â months
[JBoss jBPM] - [newbie] problem with hibernate mapping while trying to save
by colablade
Hello,
Working on JBoss IDE 2.0.0 BETA2 with jBPM 3.1.3, I was trying to store some data to my own table, instead of jbpm_variableinstance. The JUnit test ran perfectly, but an "org.hibernate.MappingException: Unknown entity" exception occurred while running on Tomcat 5.5 after deployment.
Here goes the details:
1. the table creation script:
| create table student (
| id varchar(100) not null default '',
| name varchar(20) default '',
| age int(11) default 0,
| primary key (id)
| );
|
2. the corresponding Student classes (generated by hibernate synchronizer):
| package dgbdatamodel;
| ...
| // primary key
| private java.lang.String id;
|
| // fields
| private java.lang.String name;
| private java.lang.Integer age;
| ...
| // getters and setters
|
3. the mapping file (also generated by hibernate synchronizer):
| <?xml version="1.0"?>
| <!DOCTYPE hibernate-mapping PUBLIC
| "-//Hibernate/Hibernate Mapping DTD//EN"
| "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
|
| <hibernate-mapping package="dgbdatamodel">
| <class
| name="Student"
| table="student"
| >
| <meta attribute="sync-DAO">false</meta>
| <id
| name="Id"
| type="string"
| column="id"
| >
| <generator class="uuid.hex"/>
| </id>
|
| <property
| name="Name"
| column="name"
| type="string"
| not-null="false"
| length="20"
| />
| <property
| name="Age"
| column="age"
| type="integer"
| not-null="false"
| length="11"
| />
| </class>
| </hibernate-mapping>
|
I used the auto-generated simple process, and added the following code to the MessageActionHandler.execute function:
| stu = new Student();
| stu.setName("the hell");
| JbpmConfiguration cfg = JbpmConfiguration.getInstance();
| JbpmContext jbpmContext = cfg.createJbpmContext();
| try {
| // Invoke persistence operations here
| Session s = jbpmContext.getSession();
| s.save(stu);
| } finally {
| jbpmContext.close();
| }
|
the 'stu' is a member variable of MessageActionHandler.
I first ran the sample SimpleProcessTest as JUnit test, and got 2 students named "the hell" in the table student ('cos the action was called twice in the test). Then I used JBoss IDE to deploy the process. The deployed archive includes the process, MessageActionHandler, the dgbdatamodel package, hibernate.cfg.xml as well as Student.hbm.xml. After logging in in the browser I started a new 'simple' process, after input 'color' and 'size' and clicked "Save and Close Task" (and the action handler is called), i got
| javax.servlet.ServletException: Error calling action method of component with id taskform:transitionButton
| ...
| root cause
| javax.faces.FacesException: Error calling action method of component with id taskform:transitionButton
| ...
|
the log says sth like:
| ...
| 19:39:53,765 DEBUG [Services] closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@ec1e6f
| 19:39:53,765 DEBUG [DbPersistenceService] committing hibernate transaction
| 19:39:53,781 DEBUG [DbPersistenceService] closing hibernate session
| 19:39:53,781 ERROR [GraphElement] action threw exception: Unknown entity: dgbdatamodel.Student
| org.hibernate.MappingException: Unknown entity: dgbdatamodel.Student
| at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:610)
| at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1246)
| ...
|
I guess the deployed version didn't include the mapping declared in "Student.hbm.xml" (since if I don't call "s.save(stu)" in the action handler, no exception was thrown).
I searched the forum for the answer, but in vain, the closest one I got is:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=89365
However, I just started learning jBPM and got stuck in here for quite a few days. Anyone's kind enough to give me some clues? Or what is the right way to do the job? Thanks a million!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059442#4059442
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059442
17Â years, 4Â months