[JBoss jBPM] - Re: fault never reaches catchall
by meghanai_99
I followed the instructions on the wiki page to build JBPM locally and deploy to JBoss. Only difference in my environment is that I use JBoss.4.0.5.GA.
First I had manually copy jbpm-jpdl.jar to default\lib folder. Now I am getting following exception on server start up
12:14:22,182 ERROR [JobExecutorThread] exception in job executor thread. waiting
| 320000 milliseconds
| org.hibernate.MappingException: No discriminator found for org.jbpm.bpel.graph.d
| ef.BpelProcessDefinition. Discriminator is needed when 'single-table-per-hierarc
| hy' is used and a class has subclasses
| at org.hibernate.mapping.SingleTableSubclass.validate(SingleTableSubclas
| s.java:41)
| at org.hibernate.cfg.Configuration.validate(Configuration.java:1026)
| at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
| a:1211)
| at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory
| (DbPersistenceServiceFactory.java:91)
| at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPers
| istenceService.java:94)
| at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistence
| Service.java:98)
| at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersiste
| nceService.java:281)
| at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:526)
| at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread
| .java:109)
| at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56
Looks like something is misconfigured in one of the hibernate mapping files. Can you please tell me how I can fix this problem?
Thank you,
Meghana
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4042575#4042575
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4042575
17 years, 4 months
[JBoss Seam] - Security: access control at entity level?
by kingcu
After reading chapter 20 of the Seam book, it seems to me that Seam has built in security support for access control at the method level of session beans. I wonder if the @Restrict annotation can be put on entities to control access to certain entities.
Here is my situation: I have some business entities with various relationships between each other (one-to-one, one-to-many, etc) and through foreign keys or mapping tables, they are organized into a tree structure. I'd like to have the admin role to access all the tree entities, while other roles can only access a certain part of the tree. The accessible part of the tree should be defined dynamically, i.e., an admin user logs into a web UI and selects which part of the tree is accessible for each of the other roles.
Any suggestions/ideas on how this could be implemented with Seam? Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4042566#4042566
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4042566
17 years, 4 months
[Persistence, JBoss/CMP, Hibernate, Database] - CMP not inserting data nor its showing any error.
by samcode3
Hi to all,
First of all i would thankx in advance for any help or support provided.
I am not able to insert data in mysql database using CMP. Its getting deployed without any error. When i run the client its displaying no errors. Am not able to fix this since am getting no errors. Please help me. Have been trying from 4 days. The following is my code.
----------------------------------------------------------------------------------
Remote Interface:
package cmp.interfaces;
import javax.ejb.EJBObject;
import java.rmi.*;
public interface CMPRemote extends EJBObject {
public String getEmployeeName() throws RemoteException;
public String getEmpname() throws RemoteException;
public void setEmpname(String empname) throws RemoteException;
public String getEmpdept() throws RemoteException;
public void setEmpdept(String empdept) throws RemoteException;
}
----------------------------------------------------------------------------------
HomeInterface:
package cmp.interfaces;
import javax.ejb.EJBHome;
import java.rmi.*;
import javax.ejb.*;
public interface CMPHome extends EJBHome {
public CMPRemote create(String empName, String empDept) throws RemoteException, CreateException;
public CMPRemote findByPrimaryKey(java.lang.String empName) throws FinderException, RemoteException;
}
----------------------------------------------------------------------------------
PrimaryKey Class:
package cmp.classes;
import java.io.*;
public class CMPClassPK implements java.io.Serializable{
public String name;
public CMPClassPK(String name){
this.name=name;
}
public CMPClassPK(){
}
public String toString(){
return name.toString();
}
}
----------------------------------------------------------------------------------
Bean Class:
package cmp.classes;
import javax.ejb.*;
import java.rmi.RemoteException;
import javax.ejb.*;
import javax.naming.*;
import java.sql.*;
import javax.sql.*;
import java.util.*;
abstract public class CMPBean implements EntityBean {
private EntityContext ctx;
public CMPBean(){
}
public void setEntityContext(EntityContext ctx){
this.ctx=ctx;
}
public void unsetEntityContext(){
this.ctx=null;
}
abstract public String getEmpname();
abstract public void setEmpname(String empname);
abstract public String getEmpdept();
abstract public void setEmpdept(String empdept);
public void ejbLoad() throws EJBException, RemoteException {
// TODO Auto-generated method stub
}
public void ejbStore() throws EJBException, RemoteException{
// TODO Auto-generated method stub
}
public void ejbActivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub
}
public void ejbPassivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub
}
public void ejbRemove() throws EJBException, RemoteException {
// TODO Auto-generated method stub
}
public String ejbCreate(String empname, String empdept)throws RemoteException, CreateException{
setEmpname(empname);
setEmpdept(empdept);
return null;
}
public void ejbPostCreate(String empname, String empdept){
}
public String getEmployeeName(){
return getEmpname()+"";
}
}
----------------------------------------------------------------------------------
Client Class:
package cmp.client;
import java.util.*;
import javax.naming.*;
import javax.rmi.*;
import java.rmi.*;
import javax.ejb.*;
import cmp.interfaces.*;
import cmp.classes.*;
public class Client {
public static void main(String arg[]){
Properties props = new Properties();
try{
props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL, "localhost:1099");
Context ctx = new InitialContext(props);
CMPHome home = (CMPHome)ctx.lookup("cmp/Bean");
CMPRemote bean1 = home.create("d", "ddd");
System.out.println("Value received : " + bean1.getEmployeeName());
bean1.remove();
ctx.close();
}
catch(NamingException ne){ System.out.println("Error ne: " + ne); }
catch(RemoteException re){ System.out.println("Error re: " + re); }
catch(CreateException ce){ System.out.println("Error ce: " + ce); }
catch(Exception e){
System.out.println("Error : " + e);
}
}
}
----------------------------------------------------------------------------------
JBoss.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
<enterprise-beans>
<ejb-name>CMPBean</ejb-name>
<jndi-name>cmp/Bean</jndi-name>
</enterprise-beans>
<resource-managers>
</resource-managers>
----------------------------------------------------------------------------------
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<ejb-name>CMPBean</ejb-name>
cmp.interfaces.CMPHome
cmp.interfaces.CMPRemote
<ejb-class>cmp.classes.CMPBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
False
<cmp-version>2.x</cmp-version>
<abstract-schema-name>CMPBean</abstract-schema-name>
<cmp-field>
<field-name>empname</field-name>
</cmp-field>
<cmp-field>
<field-name>empdept</field-name>
</cmp-field>
<primkey-field>empname</primkey-field>
</enterprise-beans>
<assembly-descriptor>
</assembly-descriptor>
</ejb-jar>
----------------------------------------------------------------------------------
jbosscmp-jdbc.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
<jbosscmp-jdbc>
java:/DefaultDS
<datasource-mapping>mySQL</datasource-mapping>
<create-table>true</create-table>
<remove-table>true</remove-table>
<pk-constraint>true</pk-constraint>
<preferred-relation-mapping>foreign-key</preferred-relation-mapping>
<enterprise-beans>
<ejb-name>CMPBean</ejb-name>
<table-name>employee</table-name>
<cmp-field>
<field-name>empname</field-name>
<column-name>emp_name</column-name>
<not-null/>
</cmp-field>
<cmp-field>
<field-name>empdept</field-name>
<column-name>emp_dept</column-name>
</cmp-field>
</enterprise-beans>
</jbosscmp-jdbc>
----------------------------------------------------------------------------------
mysql-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<local-tx-datasource>
<jndi-name>DefaultDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/test</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>admin</user-name>
adminpwd
<type-mapping>mySQL</type-mapping>
</local-tx-datasource>
----------------------------------------------------------------------------------
Database
create table employee(
emp_name varchar(20) not null,
emp_dept varchar(20),
primary key(emp_name)
);
----------------------------------------------------------------------------------
Output when deployed on JBoss3.2.6
23:34:07,359 INFO [EjbModule] Deploying CMPBean
23:34:07,453 INFO [EJBDeployer] Deployed: file:/J:/Kits/jboss-3.2.6/server/default/deploy/CMPBean.jar
Please let me know where i have made a mistake.
Regards,
-sam
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4042564#4042564
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4042564
17 years, 4 months
[Beginners Corner] - CMP not inserting data nor its showing any error.
by samcode3
Hi to all,
First of all i would thankx in advance for any help or support provided.
I am not able to insert data in mysql database using CMP. Its getting deployed without any error. When i run the client its displaying no errors. Am not able to fix this since am getting no errors. Please help me. Have been trying from 4 days. Please let me know where i have made an mistake. The following is my code.
----------------------------------------------------------------------------------
Remote Interface:
package cmp.interfaces;
import javax.ejb.EJBObject;
import java.rmi.*;
public interface CMPRemote extends EJBObject {
public String getEmployeeName() throws RemoteException;
public String getEmpname() throws RemoteException;
public void setEmpname(String empname) throws RemoteException;
public String getEmpdept() throws RemoteException;
public void setEmpdept(String empdept) throws RemoteException;
}
----------------------------------------------------------------------------------
HomeInterface:
package cmp.interfaces;
import javax.ejb.EJBHome;
import java.rmi.*;
import javax.ejb.*;
public interface CMPHome extends EJBHome {
public CMPRemote create(String empName, String empDept) throws RemoteException, CreateException;
public CMPRemote findByPrimaryKey(java.lang.String empName) throws FinderException, RemoteException;
}
----------------------------------------------------------------------------------
PrimaryKey Class:
package cmp.classes;
import java.io.*;
public class CMPClassPK implements java.io.Serializable{
public String name;
public CMPClassPK(String name){
this.name=name;
}
public CMPClassPK(){
}
public String toString(){
return name.toString();
}
}
----------------------------------------------------------------------------------
Bean Class:
package cmp.classes;
import javax.ejb.*;
import java.rmi.RemoteException;
import javax.ejb.*;
import javax.naming.*;
import java.sql.*;
import javax.sql.*;
import java.util.*;
abstract public class CMPBean implements EntityBean {
private EntityContext ctx;
public CMPBean(){
}
public void setEntityContext(EntityContext ctx){
this.ctx=ctx;
}
public void unsetEntityContext(){
this.ctx=null;
}
abstract public String getEmpname();
abstract public void setEmpname(String empname);
abstract public String getEmpdept();
abstract public void setEmpdept(String empdept);
public void ejbLoad() throws EJBException, RemoteException {
// TODO Auto-generated method stub
}
public void ejbStore() throws EJBException, RemoteException{
// TODO Auto-generated method stub
}
public void ejbActivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub
}
public void ejbPassivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub
}
public void ejbRemove() throws EJBException, RemoteException {
// TODO Auto-generated method stub
}
public String ejbCreate(String empname, String empdept)throws RemoteException, CreateException{
setEmpname(empname);
setEmpdept(empdept);
return null;
}
public void ejbPostCreate(String empname, String empdept){
}
public String getEmployeeName(){
return getEmpname()+"";
}
}
----------------------------------------------------------------------------------
Client Class:
package cmp.client;
import java.util.*;
import javax.naming.*;
import javax.rmi.*;
import java.rmi.*;
import javax.ejb.*;
import cmp.interfaces.*;
import cmp.classes.*;
public class Client {
public static void main(String arg[]){
Properties props = new Properties();
try{
props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL, "localhost:1099");
Context ctx = new InitialContext(props);
CMPHome home = (CMPHome)ctx.lookup("cmp/Bean");
CMPRemote bean1 = home.create("d", "ddd");
System.out.println("Value received : " + bean1.getEmployeeName());
bean1.remove();
ctx.close();
}
catch(NamingException ne){ System.out.println("Error ne: " + ne); }
catch(RemoteException re){ System.out.println("Error re: " + re); }
catch(CreateException ce){ System.out.println("Error ce: " + ce); }
catch(Exception e){
System.out.println("Error : " + e);
}
}
}
----------------------------------------------------------------------------------
JBoss.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
<enterprise-beans>
<ejb-name>CMPBean</ejb-name>
<jndi-name>cmp/Bean</jndi-name>
</enterprise-beans>
<resource-managers>
</resource-managers>
----------------------------------------------------------------------------------
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<ejb-name>CMPBean</ejb-name>
cmp.interfaces.CMPHome
cmp.interfaces.CMPRemote
<ejb-class>cmp.classes.CMPBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
False
<cmp-version>2.x</cmp-version>
<abstract-schema-name>CMPBean</abstract-schema-name>
<cmp-field>
<field-name>empname</field-name>
</cmp-field>
<cmp-field>
<field-name>empdept</field-name>
</cmp-field>
<primkey-field>empname</primkey-field>
</enterprise-beans>
<assembly-descriptor>
</assembly-descriptor>
</ejb-jar>
----------------------------------------------------------------------------------
jbosscmp-jdbc.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
<jbosscmp-jdbc>
java:/DefaultDS
<datasource-mapping>mySQL</datasource-mapping>
<create-table>true</create-table>
<remove-table>true</remove-table>
<pk-constraint>true</pk-constraint>
<preferred-relation-mapping>foreign-key</preferred-relation-mapping>
<enterprise-beans>
<ejb-name>CMPBean</ejb-name>
<table-name>employee</table-name>
<cmp-field>
<field-name>empname</field-name>
<column-name>emp_name</column-name>
<not-null/>
</cmp-field>
<cmp-field>
<field-name>empdept</field-name>
<column-name>emp_dept</column-name>
</cmp-field>
</enterprise-beans>
</jbosscmp-jdbc>
----------------------------------------------------------------------------------
mysql-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<local-tx-datasource>
<jndi-name>DefaultDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/test</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>admin</user-name>
adminpwd
<type-mapping>mySQL</type-mapping>
</local-tx-datasource>
----------------------------------------------------------------------------------
Database
create table employee(
emp_name varchar(20) not null,
emp_dept varchar(20),
primary key(emp_name)
);
----------------------------------------------------------------------------------
Output when deployed on JBoss3.2.6
23:34:07,359 INFO [EjbModule] Deploying CMPBean
23:34:07,453 INFO [EJBDeployer] Deployed: file:/J:/Kits/jboss-3.2.6/server/default/deploy/CMPBean.jar
Please let me know if am making any mistake.
Regards
-sam
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4042562#4042562
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4042562
17 years, 4 months