[Persistence] - Re: how to create PersistenceUnit and map to dataSource prog
by getaceres
I have the same problem as you. I need to use different databases with the same tables in the same application (the difference is that for me is that redeploying or even restarting JBoss is permitted, but in this case, it doesn't matter).
The idea is to use the same persistence unit changing only the datasource that they use, so the name of the persistence unit can be the same (I think, somebody correct me if I'm wrong). The name has to be defined in persistence.xml because it's mandatory in JPA as well as a default datasource. Then, you can use the Persistence.createEntityManagerFactory method passing it:
- The name of the unit that you gave in persistence.xml
- javax.persistence.jtaDataSource or javax.persistence.nonJtaDataSource properties pointing to the JNDI address of the datasource that you want to use, previously configured with access to your database. The case here (and the problem for me) is that I cannot use a JTA datasource, so I don't know why the property is there.
Anyway. I havent's tested it deeply but in theory, this should work.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266699#4266699
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266699
14 years, 11 months
[Security] - Custom CallbackHandler with jboss 4.2 AS
by hisnamewasjaan
Hi all
I have 2 related questions:
1) Is it possible to configure a custom CallbackHandler with JBoss4.2 AS?
I found a posting stating how to do it for JBoss5:
http://anil-identity.blogspot.com/2009/05/as51-specifying-custom-call-bac...
Are any these methods applicable with JBoss4.2?
2) I would like to configure my application for web authentication, using an auth-method that does not prompt the user. Is this possible? Which auth-method can I use for this? I guess I'm failing to understand what exactly causes the container to prompt the user when using e.g. BASIC auth? Can it be controlled with the CallbackHandler?
For those interested, my scenario is:
Users are authenticating in a foreign system (of which I basically know nothing), and requests (including a simple username parameter) are then sent to an application in my jboss. The application in JBoss is configured for web authentication, but I do not want the users to be prompted for credentials when they are coming from the foreign system. I just want my custom login modules to create the necessary prinipals based on the username (from request parameter).
That's why I'm planning on putting a custom callbackhandler in place to provide the username without prompting.
And, I also need to figure out with which auth-method to configure my applications so that users are NOT prompted.
Thanks
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266697#4266697
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266697
14 years, 11 months
[jBPM Users] - Process is not restored after restart?
by 4ntoine
The problem is that the process in wait state ("state" element) can not be found after application server restart, where application with jbpm is deployed:
Searching of process looks like this:
------------------
String processInstanceRefId = getProcessInstanceRefId(context, messageKind); // (GUID)
String executionId = MessageFormat.format("{0}.{1}", messageKind.getProcessDefinitionKey(), processInstanceRefId);
log.debug(MessageFormat.format("Searching processInstance with executionId={0} in {1} state",
executionId, messageKind.getState()));
ProcessInstance processInstance = processEngine.getExecutionService().findProcessInstanceById(executionId);
if (processInstance == null) {
log.error(MessageFormat.format("processInstance with executionId={0} in {1} not found",
executionId, messageKind.getState()));
return;
}
------------------
Are process instances waiting in "state" restored after application server restart?
jbpm db data is stored in hsqldb file (not in memory):
jdbc:hsqldb:file:WorkflowDB
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266693#4266693
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266693
14 years, 11 months
[jBPM Users] - SQLException throws after changing C3P0 configuration
by darshgohel
Hi All,
We are developing a work flow based system using JBPM 3.1.4, Struts and Hibernate 3. All is working good until we changed some configuration to implement the Threading and C3P0 for concurrent users. The configuration for this in hibernate.cfg.xml is as below:
| <property name="hibernate.connection.url">jdbc:oracle:thin:@<hostname>:1521:orcl</property>
| <property name="hibernate.connection.username">username</property>
| <property name="hibernate.connection.password">pass</property>
| <property name="hibernate.current_session_context_class">thread</property>
| <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider
| </property>
|
| <property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
| <property name="hibernate.cache.use_second_level_cache">true</property>
| <property name="show_sql">false</property>
|
| <property name="hibernate.c3p0.max_size">4</property>
| <property name="hibernate.c3p0.min_size">4</property>
| <property name="hibernate.c3p0.timeout">5000</property>
| <property name="hibernate.c3p0.max_statements">0</property>
| <property name="hibernate.c3p0.idle_test_period">300</property>
| <property name="hibernate.c3p0.acquire_increment">1</property>
|
|
There are two types of errors throwing after implementing the same,
1) Closed ResultSet : Error Console for the error is as below:
|
| java.sql.SQLException: Closed Resultset: next
| at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
| at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
| at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:916)
| at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:181)
| at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)
| at com.elitecore.workorder.subscriberapplication.dao.SubscriberApplicationDao.getSearchedGroupCusto
| merByCustomerId(SubscriberApplicationDao.java:739)
| at com.elitecore.workorder.subscriberapplication.manager.BulkNewProvisionManager.getSearchedGroupCu
| stomerByCustomerId(BulkNewProvisionManager.java:321)
| at com.elitecore.workorder.subscriberapplication.action.SearchCustomerAction.searchGroupCustomer(Se
| archCustomerAction.java:121)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
| at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
| at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
| at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
| at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
| at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
| 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 com.elitecore.workorder.jbpm.session.JbpmSessionConversationFilter.doFilter(JbpmSessionConversat
| ionFilter.java:78)
| 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:128)
| 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:286)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
|
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
|
|
The code snap for the same is :
| JbpmContext jbpmContext = JbpmContextManager.getJbpmContext();
| PreparedStatement pst = null;
| StringBuffer sbQuery = new StringBuffer();
|
| sbQuery.append("select DISTINCT c.id,c.clientName,c.clientTitle, c.PANGIRNO,c.headquarteraddressid, ");
| sbQuery.append("c.customerid,c.PANGIRNO from tblmclient c ");
|
| if(accessLevel !=null && accessLevel.equalsIgnoreCase("LDCA")){
| sbQuery.append("join tbltassignedlocation al on al.locationtypeid=C.ldcabcaid ");
| }else if(accessLevel !=null && accessLevel.equalsIgnoreCase("Region")){
| sbQuery.append("join tbltassignedlocation al on al.locationtypeid=C.regionid ");
|
| }else if(accessLevel !=null && accessLevel.equalsIgnoreCase("Circle")){
| sbQuery.append("join tbltassignedlocation al on al.locationtypeid=c.circleid ");
| }
| sbQuery.append("where upper(c.customerid) like (?) ");
| sbQuery.append("and c.isdeleted like 'No' ");
| sbQuery.append("and al.staffid='"+staffId.trim()+"' order by c.CLIENTNAME ");
|
| pst = jbpmContext.getConnection().prepareStatement(sbQuery.toString());
| pst.setString(1,"%"+ customerId.toUpperCase()+"%");
| rs = pst.executeQuery();
|
|
| while(rs.next())// Error comes here.
| {
| searchGroupCustomer=new SearchGroupCustomer();
| searchGroupCustomer.setClientId(rs.getString("id"));
| searchGroupCustomer.setSubscriberName(rs.getString("CLIENTNAME"));
| searchGroupCustomer.setSubscriberTitle(rs.getString("clientTitle"));
| searchGroupCustomer.setCustomerId(rs.getString("customerId"));
| searchGroupCustomer.setPanGIRNo(rs.getString("PANGIRNO"));
| Address address1=(Address)abstractDao.initliaze(Address.class,rs.getString("headquarteraddressid"));
| searchGroupCustomer.setAddress(address1);
| lstCustomerName.add(searchGroupCustomer);
| }
|
|
Error Comes at this line:
anonymous wrote : while(rs.next())// Error comes here.
2) Invalid Cursor :Error Console for the error is as below:
| java.sql.SQLException: ORA-01001: invalid cursor
| at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
| at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
| at oracle.jdbc.ttc7.v8Odscrarr.receive(v8Odscrarr.java:192)
| at oracle.jdbc.ttc7.TTC7Protocol.describe(TTC7Protocol.java:592)
| at oracle.jdbc.driver.OracleStatement.describe(OracleStatement.java:5371)
| at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:5141)
| at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:698)
| at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1505)
| at com.mchange.v2.c3p0.impl.NewProxyResultSet.getString(NewProxyResultSet.java:3342)
| at com.elitecore.workorder.subscriberapplication.dao.SearchSubscriberApplicationDao.getSAStatusReport(SearchSubscriberApplicationDao.java:445)
| at com.elitecore.workorder.subscriberapplication.manager.SubscriberApplicationManager.getSAStatusReport(SubscriberApplicationManager.java:114)
| at com.elitecore.workorder.subscriberapplication.action.UpgradePostConnectionAction.listApplications(UpgradePostConnectionAction.java:259)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
| at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
| at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
| at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
| at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
| at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
| 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 com.elitecore.workorder.jbpm.session.JbpmSessionConversationFilter.doFilter(JbpmSessionConversationFilter.java:78)
| 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:128)
| 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:286)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
|
The code snap for the same is :
|
| PreparedStatement pst=null;
| JbpmContext jbpmContext = JbpmContextManager.getJbpmContext();
|
| pst = jbpmContext.getConnection().prepareStatement(getSAStatusReport);
| pst.setString(1, saId);
| rs = pst.executeQuery();
|
| while (rs.next())
| {
| saStatusInfo = new SaStatusInfo();
| AbstractDao abstractDao=new AbstractDao();
| Address endAAddress=(Address)abstractDao.initliaze(Address.class,rs.getString("endAAddressId"));
|
| Address endBAddress=(Address)abstractDao.initliaze(Address.class,rs.getString("endBAddressId"));//Error Comes here.
|
| log.debug(" endAAddress.getAddressAsString() "+endAAddress.getAddressAsString());
| log.debug(" endBAddress.getAddressAsString() "+endBAddress.getAddressAsString());
| saStatusInfo.setEndAInstallAddress(endAAddress.getAddressAsString());
| saStatusInfo.setEndBInstallAddress(endBAddress.getAddressAsString());
| }
|
|
Error Comes at this line:
anonymous wrote : Address endBAddress=(Address)abstractDao.initliaze(Address.class,rs.getString("endBAddressId"));//Error Comes here.
As from basic debugging we identify that the problem arises when the abstractDao.initliaze() is used. This class basically fetch the data of a table and prepare an object for the same. The code snap for the same is as below:
|
| public Object initliaze(Class clazz, String id) throws Exception
| {
| JbpmContext jbpmContext = JbpmContextManager.getJbpmContext();
| return jbpmContext.getSession().get(clazz,id);
| }
|
|
We are at a very critical stage in the project and this Errors are started.
Kindly suggest us a way by which we can be out with this problems.
Note: All this errors removed if we commented the hibernate.cfg.xml configuration for Thread and C3P0.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266690#4266690
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266690
14 years, 11 months
[jBPM Users] - Re: End tasks in a Fork
by saraswati.santanu
Hi Alla,
I am not able to reproduce the problem. This is Jpdl I executed:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="" name="parallel.two.sequential.one">
|
| <swimlane name="alla" />
|
| <start-state name="start">
| <transition to="fork1"></transition>
| </start-state>
|
| <fork name="fork1">
| <transition to="task-node1" name="to-task-1"></transition>
| <transition to="task-node2" name="to-task-2"></transition>
| </fork>
|
| <task-node name="task-node1" >
| <task name="Task 1" swimlane="alla">
| </task>
| <transition to="join1" name="to-the-end"></transition>
| </task-node>
|
| <task-node name="task-node2">
| <task name="Task 2" swimlane="alla">
| </task>
| <transition to="join1" name="to-the-end"></transition>
| </task-node>
|
| <join name="join1">
| <transition to="end"></transition>
| </join>
|
| <end-state name="end"></end-state>
| </process-definition>
|
And after execution of task1 when I ask for the current unfinished tasks I get task2 only. Below is the log I am getting:
09:12:55,546 DEBUG GraphElement:170 - event 'task-end' on 'Task(Task 1)' for 'Token(/to-task-1)'
09:12:55,546 DEBUG GraphElement:170 - event 'task-end' on 'Task(Task 1)' for 'Token(/to-task-1)'
09:12:55,546 DEBUG TaskInstance:484 - completion of task 'Task 1' results in taking the default transition
09:12:55,546 DEBUG TaskInstance:484 - completion of task 'Task 1' results in taking the default transition
09:12:55,546 DEBUG GraphElement:170 - event 'before-signal' on 'TaskNode(task-node1)' for 'Token(/to-task-1)'
09:12:55,546 DEBUG GraphElement:170 - event 'before-signal' on 'TaskNode(task-node1)' for 'Token(/to-task-1)'
09:12:55,546 DEBUG GraphElement:170 - event 'node-leave' on 'TaskNode(task-node1)' for 'Token(/to-task-1)'
09:12:55,546 DEBUG GraphElement:170 - event 'node-leave' on 'TaskNode(task-node1)' for 'Token(/to-task-1)'
09:12:55,562 DEBUG GraphElement:170 - event 'transition' on 'Transition(to-the-end)' for 'Token(/to-task-1)'
09:12:55,562 DEBUG GraphElement:170 - event 'transition' on 'Transition(to-the-end)' for 'Token(/to-task-1)'
09:12:55,562 DEBUG GraphElement:170 - event 'node-enter' on 'Join(join1)' for 'Token(/to-task-1)'
09:12:55,562 DEBUG GraphElement:170 - event 'node-enter' on 'Join(join1)' for 'Token(/to-task-1)'
09:12:55,562 DEBUG Join:115 - forcing version increment on parent token Token(/)
09:12:55,562 DEBUG Join:115 - forcing version increment on parent token Token(/)
Hibernate: update JBPM_TOKEN set VERSION_=? where ID_=? and VERSION_=?
09:12:55,578 DEBUG Join:206 - join will not yet reactivate parent: found concurrent token 'Token(/to-task-2)'
09:12:55,578 DEBUG Join:206 - join will not yet reactivate parent: found concurrent token 'Token(/to-task-2)'
09:12:55,578 DEBUG GraphElement:170 - event 'after-signal' on 'TaskNode(task-node1)' for 'Token(/to-task-1)'
09:12:55,578 DEBUG GraphElement:170 - event 'after-signal' on 'TaskNode(task-node1)' for 'Token(/to-task-1)'
I see nothing abnormal there as well.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266683#4266683
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266683
14 years, 11 months