[JBoss jBPM] - Ability to choose from determined values
by ccelgun
I am trying to make a JBoss jBPM application.While forming the process, i came across a problem.
All I want is to force program user to choose one of the determined values in a given list instead of asking program user to enter a text into a textbox.
In order to make it more clear, let me give an example.
Suppose that we have users that may request to go on holiday. Instead of asking the users to write down their reasons into a textbox <like "I need a break immeadiately" or "I just want it!!" or anything else...>
I want to determine some possible reasons <lets say "honeymoon","funeral","need a break"> and want the users to choose one of these.
It seemed easy to accomplish at first. But i couldn't find out how to do it.
A little help will be very nice at this point. Thanks..
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959729#3959729
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959729
19 years, 9 months
[JBoss jBPM] - Re: Web console failing
by lfaggioli
Hi Brad,
actually I haven't tried the 3.1.2 yet, mainly beacuse, I guess, most of the new features will be only available with 3.2, therefore I'm waiting for the 3.2
I could be wrong, but I guess the date pickers will be in the new version as well, along with all the new form features.
BTW Ronald, where can we get some examples regarding forms, like the one you posted some days ago, so we can start working with the alpha?
ciao
luca
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959728#3959728
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959728
19 years, 9 months
[JBoss Seam] - Re: how to configure a session bean managing entity beans wi
by dbatcn
I tried to follow all the instructions in the reference, but using the bean (see GroupManagerBean.create) causes a rollback/synchronization problem (which see at bottom of post)
I wouldn't be surprised if there were issues in how the @Role stuff was done, but I couldn't find a single example of its usage anywhere in real code. I also hope I configured the managed persistence context right.
Files and error:
User.java
| ...
| @Entity
| @Name("user")
| // default scope is CONVERSATION
| @Role(name="currentUser", scope=SESSION)
| @Table(name="USERS")
| public class User implements Serializable {
| ...
| private Set<Group> groups = new HashSet<Group>();
|
| @ManyToMany
| @JoinTable(name="USER_GROUP",
| joinColumns={@JoinColumn(name="USER_ID")},
| inverseJoinColumns={@JoinColumn(name="GROUP_ID")})
| public Set<Group> getGroups() {
| return groups;
| }
| public void setGroups( Set<Group> groups ) {
| this.groups = groups;
| }
| }
|
Group.java
| @Entity
| @Name("group")
| // default scope is CONVERSATION
| @Table(name="GROUPS")
| public class Group implements Serializable {
| ...
| private Set<User> users = new HashSet<User>();
|
| @ManyToMany(mappedBy="groups")
| public Set<User> getUsers() {
| return users;
| }
| public void setUsers( Set<User> users ) {
| this.users = users;
| }
| }
|
GroupManagerBean.java
| @Stateful
| @Name("groupManager")
| // default scope is CONVERSATION
| @LoggedIn
| public class GroupManagerBean implements GroupManager, Serializable {
| ...
| @DataModel
| private List<Group> groupList;
|
| @DataModelSelection
| @Out(required=false)
| private Group group;
|
| @In
| private User user;
|
| @PersistenceContext(type=EXTENDED)
| private EntityManager orgmobDatabase;
|
| @Factory("groupList")
| public void find() {
| groupList = new ArrayList<Group>( user.getGroups() );
| }
|
| public void create() {
| group = new Group();
| group.setGroupname( newGroupname() );
| user.getGroups().add( group );
| }
| }
|
LoginAction.java
| @Stateless
| @Name("login")
| public class LoginAction implements Login {
|
| @In @Out
| private User currentUser;
|
| // COMMENTING OUT user JUST MOVES THE ROLLBACK/SYNCHRONIZATION
| // PROBLEM TO OCCUR IN THE GROUP MANAGER
| @Out
| private User user;
|
| @PersistenceContext
| private EntityManager orgmobDatabase;
|
| public String login() {
| List<User> results = orgmobDatabase.createQuery(
| "from User where username=:username and password=:password")
| .setParameter("username", currentUser.getUsername())
| .setParameter("password", currentUser.getPassword())
| .getResultList();
| String action;
| if ( results.size()==0 ) {
| FacesMessages.instance().add("#{messages.errorInvalidLogin}");
| action = "login";
| }
| else {
| // IS THIS HOW YOU USE COMPONENT WITH MULTIPLE ROLES?
| // THERE ARE NO EXAMPLES OF @Role USAGE.
| user = currentUser = results.get(0);
|
| Contexts.getSessionContext().set(LOGGED_IN, true);
| FacesMessages.instance().add("#{messages.infoWelcome}");
| action = "groups";
| }
| return action;
|
| }
| }
|
faces-config.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE faces-config
| PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
| "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
| <faces-config>
|
| <!-- Navigation rules for the app -->
| <navigation-rule>
| ...
| </navigation-rule>
|
| <!-- Facelets support -->
| <application>
| <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
|
| <!-- ??? -->
| <navigation-handler>org.jboss.seam.jsf.SeamNavigationHandler</navigation-handler>
| <state-manager>org.jboss.seam.jsf.SeamStateManager</state-manager>
| <variable-resolver>org.jboss.seam.jsf.SeamVariableResolver</variable-resolver>
|
| </application>
|
|
| <!-- Phase listener needed for all Seam applications -->
|
| <lifecycle>
| <!-- phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener -->
| <phase-listener>
| org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener
| </phase-listener>
| </lifecycle>
|
| </faces-config>
|
components.xml
| <components>
|
| <component name="org.jboss.seam.core.init">
| <property name="myFacesLifecycleBug">true</property>
| <property name="jndiPattern">member/#{ejbName}/local</property>
| </component>
|
| <component class="org.jboss.seam.core.Ejb"
| installed="false"/>
|
|
| <!-- Configuring a managed persistence context -->
| <component name="orgmobDatabase"
| class="org.jboss.seam.core.ManagedPersistenceContext">
| <property name="persistenceUnitJndiName">java:/EntityManagerFactories/orgmobData</property>
| </component>
|
| </components>
|
persistence.xml
| <persistence>
| <persistence-unit name="orgmobDB">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/DefaultDS</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
| <property name="jboss.entity.manager.factory.jndi.name"
| value="java:/EntityManagerFactories/orgmobData" />
| </properties>
| </persistence-unit>
| </persistence>
|
rollback/synchronization exception:
anonymous wrote :
| 2006-07-20 14:54:06,226 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/member].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
| javax.faces.el.EvaluationException: Exception while invoking expression #{groupManager.create}
| at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:153)
| at org.jboss.seam.core.Pages.callAction(Pages.java:212)
| at org.jboss.seam.jsf.AbstractSeamPhaseListener.callPageActions(AbstractSeamPhaseListener.java:127)
| at org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:98)
| at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:50)
| at org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.beforePhase(SeamExtendedManagedPersistencePhaseListener.java:38)
| at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersBefore(LifecycleImpl.java:520)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:342)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.RuntimeException: org.hibernate.TransactionException: Could not register synchronization
| at org.jboss.ejb3.stateful.StatefulBeanContext.remove(StatefulBeanContext.java:273)
| at org.jboss.ejb3.AbstractPool.remove(AbstractPool.java:171)
| at org.jboss.ejb3.cache.simple.SimpleStatefulCache.remove(SimpleStatefulCache.java:299)
| at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:89)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:188)
| at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
| at $Proxy850.create(Unknown Source)
| 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.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
| ... 29 more
| Caused by: org.hibernate.TransactionException: Could not register synchronization
| at org.hibernate.transaction.CMTTransaction.registerSynchronization(CMTTransaction.java:159)
| at org.hibernate.ejb.EntityManagerImpl.close(EntityManagerImpl.java:59)
| at org.jboss.ejb3.stateful.StatefulBeanContext.closeExtendedPCs(StatefulBeanContext.java:284)
| at org.jboss.ejb3.stateful.StatefulBeanContext.remove(StatefulBeanContext.java:268)
| ... 47 more
| Caused by: javax.transaction.RollbackException: Already marked for rollback TransactionImpl:XidImpl[FormatId=257, GlobalId=diamond/9567, BranchQual=, localId=9567]
| at org.jboss.tm.TransactionImpl.registerSynchronization(TransactionImpl.java:635)
| at org.hibernate.transaction.CMTTransaction.registerSynchronization(CMTTransaction.java:156)
| ... 50 more
|
Putting the user variable into LoginAction moves the rollback/synchronization problem there. Commenting it out delays the problem to usage of the group manager bean.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959722#3959722
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959722
19 years, 9 months
[JBossCache] - TreeCache data integrity across cluster
by magicmac
Hey,
These are my first steps with JBossCache, but it seems like I already face some basic problem
Simple example:
2-node cluster, each with instance of treeCache. Out of AS.
REPL_SYNC, locking PESSIMISTIC, state is replicated on startup.
run the following algorithm on to machines concurrently:
Machine A:
for i=0..100
counter = tree.get(fqn,counter_key,counter_value);
counter++;
tree.set(fqn,counter_key);
Machine B:
exactly the same code
The result: of course counter is <<200 since we lack synchronization of given get-put blocks.
As I already found out there is no cluster-wide lock. The locks I can explicitly acquire on node are not broadcasted.
It seems that I need transactions for that.
Machine A:
for i=0..100
beginDummyTransaction
counter = tree.get(fqn,counter_key,counter_value);
counter++;
tree.put(fqn,counter_key);
commitDummyTransaction
Machine B: same as A.
Unfortunatelly with such approach I get TimeoutExceptions as B for some reason cant aquire write-lock (or A).
The commit is a 2PC and from logs it really seems to work sync. The lock-aquiring-problem occurs when the other transaction tries to commit.
Is there any way of providing 100% integity of data when heavy updates occur in multiple cluster nodes? In my particular case, I need to buffer the stats of user buisness-logic operations of very-heavy accessed web portal. Such updates occur up to 100/sec per machine. Since there is no explicit cluster-wide locking how can I achieve it? Is there a way of aquiring write-lock at the begining of transaction (on read) and force other readers to wait till this lock is realesed on commit ? Or something like that/simulation of critical section.
I may not express myself clearly here so if you need any more info let me know.
Thanks for any light
M.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959719#3959719
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959719
19 years, 9 months