[JBoss jBPM] - Re: Why doesn't work?
by ricardomarques
BTW, i'm trying to isolate the problem, now i've tried to execute the process from another way, this time using StartProcessInstanceCommand.
Using this code:
| Properties props = System.getProperties();
| try {
|
| props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
| props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
|
| Context ctx = new InitialContext(props);
|
| Object obj = ctx.lookup("CommandService");
|
| CommandServiceRemoteHome remoteCommandService = (CommandServiceRemoteHome) javax.rmi.PortableRemoteObject.narrow(obj,CommandServiceRemoteHome.class);
| CommandServiceRemote commandService = remoteCommandService.create();
|
| StartProcessInstanceCommand cmd = new StartProcessInstanceCommand();
|
| cmd.setProcessName("send mail 4");
| cmd.setCreateStartTask(false);
| cmd.setActorId("grover");
|
|
| System.out.println("RETURNING OBJECT: " + commandService.execute(cmd).toString());
|
| commandService.remove();
| ctx.close();
|
I get this exception:
| Caused by: org.jbpm.JbpmException: couldn't execute org.jbpm.command.StartProcessInstanceCommand@1d3510d
| at pep.workflow.server.beans.command.CommandServiceBean.execute(CommandServiceBean.java:71)
| 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.jboss.invocation.Invocation.performCall(Invocation.java:359)
| at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
| at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
| at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
| at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
| at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
| at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
| at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
| at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
| at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
| ... 24 more
| Caused by: org.jbpm.JbpmException: token 'Token(/)' can't be signalled cause it is currently not positioned in a node
| at org.jbpm.graph.exe.Token.signal(Token.java:134)
| at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:251)
| at org.jbpm.command.StartProcessInstanceCommand.execute(StartProcessInstanceCommand.java:32)
| at pep.workflow.server.beans.command.CommandServiceBean.execute(CommandServiceBean.java:67)
| ... 38 more
|
|
The process XML is this:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition
| xmlns="urn:jbpm.org:jpdl-3.1" name="sendmail">
| <start-state name="Inicio">
| <transition name="" to="Send Mail"></transition>
| </start-state>
| <end-state name="Fim"></end-state>
| <node name="Send Mail">
| <action class="pep.test.MailMeActionHandler"></action>
| <transition name="" to="Fim"></transition>
| </node>
| </process-definition>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047193#4047193
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047193
18 years, 11 months
[EJB/JBoss] - EJB2.1:UserTransaction with CMT- possible bug?
by mskonda
I have a CMT bean with a method set to Never as tx attribute.
- If I get the UserTransction from SessionContext(), I do get an IllegalStateException (java.lang.IllegalStateException: CMT beans are not allowed to get a UserTransaction) which is expected
- However, I am able to get the same UT from JNDI!
I am successful in getting TransactionManager and UserTransaction from JNDI in my ejbCreate() method.
Now, the following method executes without any exceptions/restrictions/constraints:
| private void doNonTxWork()
| {
| logger.info("<< Method: doNonTxWork >>");
| try
| {
| Transaction t = tm.suspend();
| ut.begin();
| logger.info("UserTransaction BEGIN: ");
| ut.commit();
| logger.info("UserTransaction COMMITTED: ");
| tm.resume(t);
| logger.info("Transaction Resumed: ");
| }
| catch (Exception e)
| {
| logger.info("Exception:" + e.getMessage());
| logger.error(e);
| throw new EJBException(e);
| }
| }
|
Note that the method that's calling this one is set to Never.
Now, in order to check whether I can do the same work in a Required method(which ideally should'nt work), I called this method from Required method. I didn't get any exceptions/errors and everything seems quite happy!!
Is it not strange behaviour(possible bug??) or am I missing something here?
Thanks
Madhu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047192#4047192
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047192
18 years, 11 months
[JBoss Seam] - Re: Question On @Datamodel Outjection
by baz
Hi,
now it is hopefully clear to me.
You have an object 'budgetOverview' which is managed by seam, due to the @name annotation .
At some stage in your workflow an object called budgetOverview is created (new ...) This object is NOT managed by seam. And you are outjecting this object into the same scope as the seam managed object resides in.
So the datamodel can not be outjected, since you are not having a managed object in the scope.
You should not create, with new, the budgetOverview object. Try to inject this bean into expresscalculator.
>From your code i suppose that you are not familar with the seam way of programming. Try to investigate the seam examples until you understand them. Or buy the very good new seam book, read documentation and experiment for yourself.
If you have questions abourt the examples or documentation do not hesitate to ask here.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047189#4047189
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047189
18 years, 11 months
[JBoss Seam] - How to get a facelets parameter into a seam component
by quilian
Hi Folks!
I have the following scenario:
I want to create a component that manages relationship between entities. To make it reusable, i have two general managers, which are templated EJB3 session beans and manage some buisness objects.
These entities are derived from two interfaces AssociationMaster and AssociationSlave respectively. Their methods can tell which fields of the two entitys map the relationship betweeen them. So the only thing my component should be depend on is that the two managers given to it manage entities which are derived from the two interfaces and behave accordingly. The component itself consists of a Listbox to select the master and a MultipleSelectCheckbox on the right side to select the Associated Slaves. A Common scenario in our application would be to map users to groups and groups to tasks etc.
I used the facelet-taglib with the source tag to define my component:
| myTaglib.xml:
|
| <facelet-taglib>
| <namespace>http://www.mobilanten.de/tags</namespace>
| <tag>
| <tag-name>associationTableInclude</tag-name>
| <source>tags/associationTable.xhtml</source>
| </tag>
|
| </facelet-taglib>
|
| testPage.xml:
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:mb="http://www.mobilanten.de/tags">
|
| <ui:define name="body">
| <tr:panelPage>
| <mb:associationTableInclude
| masterManager="#{gruppenManager}"
| slaveManager="#{benutzerManager}"/>
| </tr:panelPage>
| </ui:define>
| </ui:composition>
|
inside the associationTable.xhtml (not posted here) i can use #{masterManager} and get the concretized #{gruppenManager}.
when submitting the form, the called action method should call .save in the end.
So the question his how to get the facelet template parameter #{masterManager} into my code by whatever means?
I have tried many things like giving the masterManager as Parameter to the action method(always null) now but am stuck, so i wonder if theres any way at all to do this..
Many thanks for your suggestions!
Tobias Kilian
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047188#4047188
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047188
18 years, 11 months
[JBoss Seam] - Conversion Error
by kvchowdary_6699
hi
when i click submit button in jspx page i got this error.
i ran the application like registration.
|
| application.jspx
|
| <?xml version="1.0"?>
| <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns="http://www.w3.org/1999/xhtml"
| version="2.0">
| <jsp:output doctype-root-element="html"
| doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
| doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
| <jsp:directive.page contentType="text/html"/>
| <html>
| <head>
| <title>Application New User</title>
| </head>
| <body>
| <f:view>
| <h:form>
| <table border="0">
| <s:validateAll>
| <tr>
| <td>Application ID</td>
| <td><h:inputText value="#{app.appID}" required="true"/></td>
| </tr>
| <tr>
| <td>First Name</td>
| <td><h:inputText value="#{app.firstName}" required="true"/></td>
| </tr>
| <tr>
| <td>Last Name</td>
| <td><h:inputText value="#{app.lastName}" required="true"/></td>
| </tr>
| <tr>
| <td>SEX</td>
| <td><h:inputText value="#{app.sex}" required="true"/></td>
| </tr>
| <tr>
| <td>AGE</td>
| <td><h:inputText value="#{app.age}" required="true"/></td>
| </tr>
| </s:validateAll>
| </table>
| <h:messages/>
| <h:commandButton value="Approve" action="#{application.application}"/>
| </h:form>
| </f:view>
| </body>
| </html>
| </jsp:root>
|
|
| ApplicationUser.java
|
|
| package org.jboss.seam.example.application;
|
| import java.io.Serializable;
| import javax.persistence.Entity;
| import javax.persistence.Id;
| import javax.persistence.Table;
|
| import org.hibernate.validator.Length;
| import org.hibernate.validator.NotNull;
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Scope;
|
| @Entity
| @Name("app")
| @Scope(ScopeType.SESSION)
| @Table(name="applications")
|
| public class ApplicationUser implements Serializable
| {
| private int appID;
| private String firstName;
| private String lastName;
| private String sex;
| private int age;
|
| public ApplicationUser(int appID, String firstName, String lastName, String sex, int age)
| {
| this.appID = appID;
| this.firstName = firstName;
| this.lastName = lastName;
| this.sex = sex;
| this.age = age;
| }
|
| public ApplicationUser(){}
|
| //@NotNull @Length(min=1, max=2)
| public int getAge() {
| return age;
| }
|
| public void setAge(int age) {
| this.age = age;
| }
|
| //@Id @NotNull @Length(min=3, max=5)
| public int getAppID() {
| return appID;
| }
|
| public void setAppID(int appID) {
| this.appID = appID;
| }
|
| //@NotNull @Length(min=5, max=15)
| public String getFirstName() {
| return firstName;
| }
|
| public void setFirstName(String firstName) {
| this.firstName = firstName;
| }
|
| // @NotNull @Length(min=5, max=15)
| public String getLastName() {
| return lastName;
| }
|
| public void setLastName(String lastName) {
| this.lastName = lastName;
| }
|
| //@NotNull @Length(min=4, max=6)
| public String getSex() {
| return sex;
| }
|
| public void setSex(String sex) {
| this.sex = sex;
| }
| }
|
|
|
| and ApplicationAction.java
|
|
| package org.jboss.seam.example.application;
|
| import java.util.List;
|
| import javax.ejb.Stateless;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
| import org.apache.commons.logging.Log;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.core.FacesMessages;
|
| @Stateless
| @Name("application")
| public class ApplicationAction implements Application
| {
| @In
| private ApplicationUser app;
|
| @PersistenceContext
| private EntityManager em;
|
| @Logger
| private Log log;
|
| public String application() {
| List existing=em.createQuery("select appID from ApplicationUser where appID=#(app.appID)").getResultList();
| if(existing.size()==0){
| em.persist(app);
| log.debug("#(ApplicationUser.appID) approved sucessfully");
| return "/appApproved.jspx";
| }
| else{
| FacesMessages.instance().add("#(ApplicationUser.appID) approved already");
| return null;
| }
| }
|
|
|
|
| }
|
|
|
| could you suggest me?
|
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047185#4047185
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047185
18 years, 11 months