Re: [jboss-user] [JBoss Web Services Development] - JBWS-2210 : CXF Username Token JAAS integration
by Sergey Beryozkin
Sergey Beryozkin [http://community.jboss.org/people/sergeyb] replied to the discussion
"JBWS-2210 : CXF Username Token JAAS integration"
To view the discussion, visit: http://community.jboss.org/message/537517#537517
--------------------------------------------------------------
Hi
I've created the initial patch for [1].
The reason it has to be a patch is that JBossCXF currently depends on CXF 2.2.6 while the system test which I've added depends on CXF 2.2.8-SNAPSHOT.
The [UsernameAuthorizingTestCase] test is quite simple but it demonstrates the idea of separating authentication and authorization actions into separate phases.
SubjectCreatingInterceptor extends [2] and authenticates and populates a Subject using a (legacy) JBossSX api which will need to be updated to use PicketBox API. SubjectCreatingInterceptor could've also overridden a createSecurityContext() from its superclass if the default SecurityContext.isUserInRole was not working (but it does in this case). Eventually this interceptor should likely make it into JBossCXF/trunk/src/main. At the moment some of the code required to deal with digests is missing, it is commented out but classes like NonceStore can be ported from JBossNative.
Finally, CXF-based interceptor [3] is used to authorize the requests, here is a sample configuration :
<util:map id="methodPermissions">
<entry key="sayHello" value="friend colleague"/>
<entry key="greetMe" value="snoopies"/>
</util:map>
<bean id="AuthorizeIn" class="org.apache.cxf.interceptor.security.SimpleAuthorizingInterceptor">
<property name="methodRolesMap" ref="methodPermissions"/>
</bean>
Other authorizing interceptors can be added easily. For example, one can extend SimpleAuthorizingInterceptor and set a property identifying a service class on it. The setter would load and introspect a class for @RolesAllowed, @DenyAll, etc and set a roles map on the superclass. [4] can also be extended if say PicketBox AuthorizationManager were to be used.
One thing which will need to be addressed at CXF level is a policy-first case, where interceptors are added by the policy runtime, so some work has to be done to ensure interceptors like SubjectCreatingInterceptor can be added when needed too.I'm planning to investigate what needs to be done...
Any comments - let me know please
cheers, Sergey
[1] https://jira.jboss.org/jira/browse/JBWS-2210 https://jira.jboss.org/jira/browse/JBWS-2210
[2] http://svn.apache.org/repos/asf/cxf/trunk/rt/ws/security/src/main/java/or... http://svn.apache.org/repos/asf/cxf/trunk/rt/ws/security/src/main/java/or...
[3] http://svn.apache.org/repos/asf/cxf/trunk/rt/core/src/main/java/org/apach... http://svn.apache.org/repos/asf/cxf/trunk/rt/core/src/main/java/org/apach...
[4] http://svn.apache.org/repos/asf/cxf/trunk/rt/core/src/main/java/org/apach... http://svn.apache.org/repos/asf/cxf/trunk/rt/core/src/main/java/org/apach...
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/537517#537517]
Start a new discussion in JBoss Web Services Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
Re: [jboss-user] [jBPM] - Async Fork Transaction Issues
by Rachel Hodos
Rachel Hodos [http://community.jboss.org/people/rhodos] replied to the discussion
"Async Fork Transaction Issues"
To view the discussion, visit: http://community.jboss.org/message/537515#537515
--------------------------------------------------------------
Maciej,
With the source code I sent you, I get a NullPointerException because repositoryService isn't defined.
When I add the following lines to the end of ConcurrencyTest.initialize() (and import the RepositoryService class):
repositoryService = processEngine.get(RepositoryService.class);
executionService = processEngine.getExecutionService();
the process gets farther but then throws the following exception:
13:48:55,893 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.SignalCmd@15a4523
org.jbpm.api.JbpmException: execution[TestConcurrencySimple.7.to A] is not active: async
Then, if I comment out signalExecutionById, I get the original exception I was complaining about:
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#7]
How the heck did you get my source code to work??
(Sorry to keep throwing new questions at you.)
Rachel
*Full output from last scenario:*
java jpl.mipl.pgs.test.ConcurrencyTest
ConcurrencyTest.main, beginning
ConcurrencyTest, before super.setup()
jpl/mipl/pgs/test/jbpm.cfg.xml
building ProcessEngine from resource jpl/mipl/pgs/test/jbpm.cfg.xml
14:02:57,395 INF | [DispatcherThread] starting DispatcherThread
14:02:57,432 INF | [Environment] Hibernate 3.3.1.GA
14:02:57,445 INF | [Environment] hibernate.properties not found
14:02:57,457 INF | [Environment] Bytecode provider name : javassist
14:02:57,473 INF | [Environment] using JDK 1.4 java.sql.Timestamp handling
14:02:57,632 INF | [Configuration] configuring from resource: jbpm.hibernate.cfg.xml
14:02:57,633 INF | [Configuration] Configuration resource: jbpm.hibernate.cfg.xml
14:02:57,752 INF | [Configuration] Reading mappings from resource : jbpm.repository.hbm.xml
14:02:58,233 INF | [Configuration] Reading mappings from resource : jbpm.execution.hbm.xml
14:02:58,668 INF | [Configuration] Reading mappings from resource : jbpm.history.hbm.xml
14:02:58,901 INF | [Configuration] Reading mappings from resource : jbpm.task.hbm.xml
14:02:59,014 INF | [Configuration] Reading mappings from resource : jbpm.identity.hbm.xml
14:02:59,098 INF | [Configuration] Configured SessionFactory: null
14:02:59,162 INF | [DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
14:02:59,163 INF | [DriverManagerConnectionProvider] Hibernate connection pool size: 20
14:02:59,164 INF | [DriverManagerConnectionProvider] autocommit mode: false
14:02:59,194 INF | [DriverManagerConnectionProvider] using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:mem:.
14:02:59,195 INF | [DriverManagerConnectionProvider] connection properties: {user=sa, password=****}
14:02:59,698 INF | [Dialect] Using dialect: org.hibernate.dialect.HSQLDialect
14:02:59,729 INF | [TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)
14:02:59,736 INF | [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
14:02:59,750 INF | [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
14:02:59,914 INF | [SessionFactoryImpl] building session factory
14:03:01,825 INF | [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
14:03:01,851 INF | [SchemaExport] Running hbm2ddl schema export
14:03:01,853 INF | [SchemaExport] exporting generated schema to database
14:03:01,906 INF | [SchemaExport] schema export complete
14:03:02,643 INF | [CheckDbCmd] jBPM version info: library[4.3], schema[null]
ConcurrencyTest, after super.setup()
setUp completed...
testActivityOrder: number of children = 2
testActivityOrder: signaling TestConcurrencySimple.7.to A
testActivityOrder: signaling TestConcurrencySimple.7.to B
ConcurrencyTest.main, after testActivityOrder
my name is A
my name is B
concurrencyTest.main, after tearDown
my name is A
my name is B
my name is A
my name is A
my name is B
my name is A
my name is B
In PrintNameMulti: state of execution: active-concurrent
In PrintNameMulti: execution id: TestConcurrencySimple.7.to A
my name is A2
14:03:09,097 WRN | [HSQLDialect] HSQLDB supports only READ_UNCOMMITTED isolation
### EXCEPTION ###########################################
14:03:09,108 SEV | [ExecuteJobCmd] exception while executing 'message[9]'
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#7]
at org.hibernate.dialect.lock.SelectLockingStrategy.lock(SelectLockingStrategy.java:102)
at org.hibernate.dialect.HSQLDialect$ReadUncommittedLockingStrategy.lock(HSQLDialect.java:306)
at org.hibernate.persister.entity.AbstractEntityPersister.lock(AbstractEntityPersister.java:1361)
at org.hibernate.event.def.AbstractLockUpgradeEventListener.upgradeLock(AbstractLockUpgradeEventListener.java:108)
at org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:611)
at org.hibernate.impl.SessionImpl.lock(SessionImpl.java:603)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:68)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:49)
at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:656)
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:597)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
at org.jbpm.pvm.internal.model.ExecutionImpl_$$_javassist_5.performAtomicOperationSync(ExecutionImpl_$$_javassist_5.java)
at org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage.execute(ExecuteEventListenerMessage.java:154)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:76)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:42)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
### EXCEPTION ###########################################
### EXCEPTION ###########################################
14:03:09,117 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.ExecuteJobCmd@1a998c7
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#7]
at org.hibernate.dialect.lock.SelectLockingStrategy.lock(SelectLockingStrategy.java:102)
at org.hibernate.dialect.HSQLDialect$ReadUncommittedLockingStrategy.lock(HSQLDialect.java:306)
at org.hibernate.persister.entity.AbstractEntityPersister.lock(AbstractEntityPersister.java:1361)
at org.hibernate.event.def.AbstractLockUpgradeEventListener.upgradeLock(AbstractLockUpgradeEventListener.java:108)
at org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:611)
at org.hibernate.impl.SessionImpl.lock(SessionImpl.java:603)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:68)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:49)
at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:656)
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:597)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
at org.jbpm.pvm.internal.model.ExecutionImpl_$$_javassist_5.performAtomicOperationSync(ExecutionImpl_$$_javassist_5.java)
at org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage.execute(ExecuteEventListenerMessage.java:154)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:76)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:42)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
### EXCEPTION ###########################################
my name is B
In PrintNameMulti: state of execution: active-concurrent
In PrintNameMulti: execution id: TestConcurrencySimple.7.to B
my name is B2
14:03:11,700 WRN | [HSQLDialect] HSQLDB supports only READ_UNCOMMITTED isolation
### EXCEPTION ###########################################
14:03:11,702 SEV | [ExecuteJobCmd] exception while executing 'message[12]'
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#7]
at org.hibernate.dialect.lock.SelectLockingStrategy.lock(SelectLockingStrategy.java:102)
at org.hibernate.dialect.HSQLDialect$ReadUncommittedLockingStrategy.lock(HSQLDialect.java:306)
at org.hibernate.persister.entity.AbstractEntityPersister.lock(AbstractEntityPersister.java:1361)
at org.hibernate.event.def.AbstractLockUpgradeEventListener.upgradeLock(AbstractLockUpgradeEventListener.java:108)
at org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:611)
at org.hibernate.impl.SessionImpl.lock(SessionImpl.java:603)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:68)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:49)
at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:656)
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:597)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
at org.jbpm.pvm.internal.model.ExecutionImpl_$$_javassist_5.performAtomicOperationSync(ExecutionImpl_$$_javassist_5.java)
at org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage.execute(ExecuteEventListenerMessage.java:154)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:76)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:42)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
### EXCEPTION ###########################################
### EXCEPTION ###########################################
14:03:11,703 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.ExecuteJobCmd@1fd9cd5
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#7]
at org.hibernate.dialect.lock.SelectLockingStrategy.lock(SelectLockingStrategy.java:102)
at org.hibernate.dialect.HSQLDialect$ReadUncommittedLockingStrategy.lock(HSQLDialect.java:306)
at org.hibernate.persister.entity.AbstractEntityPersister.lock(AbstractEntityPersister.java:1361)
at org.hibernate.event.def.AbstractLockUpgradeEventListener.upgradeLock(AbstractLockUpgradeEventListener.java:108)
at org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:611)
at org.hibernate.impl.SessionImpl.lock(SessionImpl.java:603)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:68)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:49)
at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:656)
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:597)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
at org.jbpm.pvm.internal.model.ExecutionImpl_$$_javassist_5.performAtomicOperationSync(ExecutionImpl_$$_javassist_5.java)
at org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage.execute(ExecuteEventListenerMessage.java:154)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:76)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:42)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
### EXCEPTION ###########################################
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/537515#537515]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
[JBoss Tools] - Seam project configuration problem
by nitzan tomer
nitzan tomer [http://community.jboss.org/people/nitm] created the discussion
"Seam project configuration problem"
To view the discussion, visit: http://community.jboss.org/message/537503#537503
--------------------------------------------------------------
Hello all,
I checked out a seam project from a subversion repository and I'm trying to configure the properties of these projects but got stuck.
The project actually includes 4 projects: the main one, the ejb, ear and test.
I managed to configure them all except for the ear project for which I'm getting the following error:
Target runtime JBoss 5.1 Runtime is not defined. OurProject-ear Unknown Faceted Project Problem
In the properties of this project, under the Server section it states: "The project is not associated with any servers." but I do not have an "add" button or a list of servers to select from.
I have a JBoss AS (5.1) server defined in the workspace and I even associated the project with the server (from within the servers view).
Any ideas on what's the problem and how I can fix it?
I'm using: eclipse 3.5.2, JBoss AS 5.1.0 and Seam 2.2.0
Thanks, Nitzan;
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/537503#537503]
Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
[jBPM] - jBPM - XA transaction
by Ranendra Das
Ranendra Das [http://community.jboss.org/people/ranendas] created the discussion
"jBPM - XA transaction"
To view the discussion, visit: http://community.jboss.org/message/537478#537478
--------------------------------------------------------------
Hello,
I want to do Xa transaction with jBPM and another Datasource of my application. Both cases, I am using only Hibernate, no spring.
I started with UserTransaction, then started normal hibernate operation, here DS for Normal Hibertane is XA and JTA is the transaction mode and I am using Weblogic 10 AS.
Now my normal Hibernate transaction using JTA is working fine, but jBPM part is not working fine, I can commit both the DS together, but if there is any exception in my Normal DS, jBPM still commits which is WRONG. I stringly believe I made a mistake somewhere in jBPM configuration. Can anyone tell me where am I wrong?
Here is my code base :-
jbpm.cfg.xml
<
jbpm-configuration>
<!--The default configurations can be found in org/jbpm/default.jbpm.cfg.xml
Those configurations can be overwritten by putting this file called
jbpm.cfg.xml on the root of the classpath and put in the customized values.
-->
<jbpm-context>
<service name="persistence">
<factory>
<bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
<field name="isTransactionEnabled"><false /></field>
<field name="isCurrentSessionEnabled"><true /></field>
<field name="sessionFactoryJndiName">
<string value="java:/myHibSessFactJndiName" />
</field>
<!--<field name="sessionFactoryJndiName">java:/myHibSessFactJndiName</field>-->
</bean>
</factory>
</service>
</jbpm-context>
<string name="resource.hibernate.cfg.xml" value="hibernate.cfg.xml" /></jbpm-configuration>
hibernate.cfg.xml file
<?
xml version='1.0' encoding='utf-8'?>
<!
DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<
hibernate-configuration>
<session-factory>
<!-- hibernate dialect -->
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<property name="hibernate.connection.datasource">jdbc/JbpmDataSource</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>
<property name="hibernate.current_session_context_class">jta</property>
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public void doXATransWithHiber()
{
try{
tx = (UserTransaction)new InitialContext().lookup("java:comp/UserTransaction");
tx.begin();
HibernateConfig objHbCfg = null;
objHbCfg = OfferHibernateUtil.getHibernateConfig(OfferServiceConstant.OFFER_DOMAIN);
Session session1 = null;
if(objHbCfg !=null){
session1 = objHbCfg.currentSession(HibernateConfigType.OFFER);
}
OfferPo offerPo= new OfferPo();
Long offerId= new Long(2574);
Criteria crit = session1.createCriteria(OfferPo.class);
crit.add(Restrictions.eq("offerId", offerId));
offerPo = (OfferPo) crit.list().get(0);
String processId = offerPo.getOfferProcessId();
offerPo.setOfferId(offerId);
offerPo.setOfferName("NewTest_XA_13thApril_2-0");
session1.persist(offerPo);
jbpmContext = jbpmConfiguration.createJbpmContext();
SessionFactory sessfac = (SessionFactory)new InitialContext().lookup("java:/myHibSessFactJndiName");
jbpmContext.setSession(sessfac.getCurrentSession());
long processInstanceId = 126694;
ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
processInstance.signal();
jbpmContext.save(processInstance);
tx.commit();
}catch(Exception e)
{
e.printStackTrace();
try{
if(tx !=null){
tx.rollback();
}
}catch(Exception sqle)
{
sqle.printStackTrace();
}
} finally{
jbpmContext.close();
}
}
Regards,
Ranen
Regards,
Ranen
Regards,
Ranen
Regards,
Ranen
Regards,
Ranen
Regards,
Ranen
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/537478#537478]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years