[JBoss Seam] - Conversion Error
by koriel
My user entity
| @Entity
| @Table(name="USERS")
| public abstract class User implements Serializable
| {
|
| private String password;
| private List<Names> name;
| private long id;
|
|
| @Id
| @GeneratedValue
| public long getId() {
| return id;
| }
|
| public void setId(long id) {
| this.id = id;
| }
|
| public User(List<Names> name, String password)
| {
| this.name = name;
| this.password = password;
|
| }
|
| public User() {}
|
|
|
| @NotNull
| @Length(min=5, max=15, message="Password must be at least 5 characters")
| public String getPassword()
| {
| return password;
| }
| public void setPassword(String password)
| {
| this.password = password;
| }
|
| @NotNull
| @OneToMany
| public List<Names> getName() {
| return name;
| }
|
| public void setName(List<Names> name) {
| this.name = name;
| }
|
|
| public String toString()
| {
| return "User(" + password + ")";
| }
| }
|
my AuthorUser class
| @Entity
| @DiscriminatorValue("AuthorUser")
| @Scope(ScopeType.SESSION)
| public class AuthorUser extends User implements Serializable {
|
| public String gender;
| public String title;
|
| public AuthorUser() {}
|
|
| public String getGender() {
| return gender;
| }
|
| public void setGender(String gender) {
| this.gender = gender;
| }
|
| public String getTitle() {
| return title;
| }
|
| public void setTitle(String title) {
| this.title = title;
| }
|
|
|
| }
|
my registerAction class
| @Stateful
|
| @Scope(ScopeType.SESSION)
|
| @Name("register")
|
| public class RegisterAction implements Register
|
| {
|
|
|
| @In(create = true)
|
| private AuthorUser authorUser;
|
|
|
| @In(create = true)
|
| private Names names;
|
|
|
| @Logger
|
| private Log log;
|
|
|
| @PersistenceContext
|
| private EntityManager em;
|
|
|
| @In(create=true)
|
| private transient FacesMessages facesMessages;
|
|
|
| private String verify;
|
|
|
| public String register()
|
| {
|
|
|
| log.info("hi");
| }
| }
|
|
and my xhtml page
| <h:form id="testForm">
|
| <table border="0">
| <s:validateAll>
|
|
|
| <tr>
| <td>Lastname</td>
| <td><h:inputText value="#{names.lastname}" /></td>
| </tr>
| <tr>
| <td>Firstname</td>
| <td><h:inputText value="#{names.firstname}" /></td>
| </tr>
| <tr>
| <td>Middlename</td>
| <td><h:inputText value="#{names.middlename}" /></td>
| </tr>
|
|
| <tr>
| <td>Gender</td>
| <td><h:inputText value="#{authorUser.gender}" /></td>
| </tr>
| <tr>
| <td>Title</td>
| <td><h:inputText value="#{authorUser.title}" /></td>
| </tr>
| <tr>
| <td>Password</td>
| <td><h:inputText value="#{authorUser.password}" /></td>
| </tr>
|
|
| <tr>
| <td></td>
| <td><h:commandButton value="Submit" action="#{register.register}" /></td>
| </tr>
| </s:validateAll>
| <h:messages />
| </table>
|
| </h:form>
|
|
By submiting the form I get conversion error for authorUser.title,gender and password..
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964561#3964561
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964561
19 years, 9 months
[JBoss jBPM] - Re: about process-state
by erzed
Hi erverbody!
I've got a similar problem. I've created to process definitions. One includes a process state that should start the other process. I deployed both definitions and I can see them in the database.
However when I start the super process i get the followin message:
[WARN ] [11 Aug 2006 10:54:25,217] [main] org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog.Narrowing proxy to class org.jbpm.graph.node.StartState - this operation breaks ==
The super process instance is created. But the first call to signal() results in an exception. When I analyse the database i see that also the root token has been created. Unfortunately, it never leaves the start state of my super process (the log table in the database shows only a line with the token id and class "I" but no more occurences of the same token).
My processes are:<?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="urn:bearingpoint.com:pdl-3.1"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| name="SuperFlow">
|
| <!-- GENERAL PART OF EVERY PROCESS DEFINITION -->
| <!-- This general action has to be present in order to use the sla functionality -->
| <action name="slaAction"
| class="com.bearingpoint.infonova.workflow.jbpm.SlaActionHandler" />
|
| <!-- Needed for retry/wait message cleanup after a node is finished -->
| <event type="node-leave">
| <action name="nodeLeaveAction"
| class="com.bearingpoint.infonova.workflow.jbpm.NodeLeaveActionHandler" />
| </event>
|
| <start-state name="start">
| <transition name="" to="prior sub-process"></transition>
| </start-state>
| <end-state name="end"></end-state>
| <node name="prior sub-process">
| <transition name="" to="callSubProcess"></transition>
| </node>
| <node name="after sub-process">
| <transition name="" to="end"></transition>
| </node>
| <process-state name="callSubProcess">
| <sub-process name="SubFlow"></sub-process>
| <transition name="" to="after sub-process"></transition>
| </process-state>
|
| </process-definition>
<?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="urn:bearingpoint.com:pdl-3.1"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| name="SubFlow">
|
| <!-- GENERAL PART OF EVERY PROCESS DEFINITION -->
| <!-- This general action has to be present in order to use the sla functionality -->
| <action name="slaAction"
| class="com.bearingpoint.infonova.workflow.jbpm.SlaActionHandler" />
|
| <!-- Needed for retry/wait message cleanup after a node is finished -->
| <event type="node-leave">
| <action name="nodeLeaveAction"
| class="com.bearingpoint.infonova.workflow.jbpm.NodeLeaveActionHandler" />
| </event>
| <node name="sub-node 1">
| <transition name="" to="sub-node 2"></transition>
| </node>
| <node name="sub-node 2">
| <transition name="" to="sub-node 3"></transition>
| </node>
| <node name="sub-node 3">
| <transition name="" to="end1"></transition>
| </node>
| <start-state name="start">
| <transition name="" to="sub-node 1"></transition>
| </start-state>
| <end-state name="end1"></end-state>
| </process-definition>
Anyone had this problem as well?
Or any ideas what this error message means?
Thanks a million!
roman
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964560#3964560
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964560
19 years, 9 months
[EJB 3.0] - Displaying EJBs within JavaScript: what about the EntityMana
by SmokingAPipe
Here's the scenario: I have a Servlet which uses JNDI to get a stateless session bean. That stateless session bean has a method like "load" which loads up one of my entities.
So now my Servlet has gotten a hold of its entity bean. Let's say this entity is an Invoice which contains a List of Items.
Then the Servlet puts that Invoice object into the request as an attribute, and uses JSP to do the display. The JSP now iterates through the List of Items.
Here's the problem: What if that List of Items hasn't been initialized? That List might be just a stub. It needs to get all its Items, and then it needs to get values out of the Items (like price, description, etc). But by now, there is no more entity manager.
How can these proxies be resolved in a situation like this? What is the way to handle this?
It seems like a common problem. I know that back when I was using Hibernate and plain old Tomcat (not within JBoss), I set up a Filter for everything. The Filter would create a Hibernate Session, load the objects it needed, call doFilter() to actually display everything, and then call session.close() so the session wouldn't be left dangling.
What's the right way to do this within JBoss? I have a feeling that the answer might be "use Seam", but I don't want to do that at this stage, because a) I have a lot of existing JSPs that I can't rewrite and b) I'm still getting myself comfortable with JBoss / EJB and I don't want to add in yet another technology I need to learn before I can demo this project to customers.
Any thoughts on this?
By the way, using EJBs within JBoss is quite amazing. I set up my classes, I deploy them, all the tables magically appear, and it is just cool. So this question is the last barrier I have to being able to use EJBs + JBoss as an effective tool.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964559#3964559
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964559
19 years, 9 months
[JBoss jBPM] - delegation for ActionHandler - what am I missing?
by wasperen
I have the following node in my process:
<node name="sensor news">
| <action name="conduct news sensor" class="com.paconsulting.cucumber.rules.impl.RulesActionHandler" config-type="bean">
| <ruleEngineJndiName>java:/cucumber/RulesEngine</ruleEngineJndiName>
| <ruleBaseName>news-sensor</ruleBaseName>
| </action>
| <transition to="check errors"></transition>
| </node>
The entire process deploys fine.
The ActionHandler code is, simply:
package com.paconsulting.cucumber.rules.impl;
|
| imports...
|
| public class RulesActionHandler implements ActionHandler {
| private static final long serialVersionUID = 1L;
|
| private static Log log = LogFactory.getLog(RulesActionHandler.class);
|
| private String ruleEngineJndiName = "";
| private String ruleBaseName = "";
|
| public String getRuleBaseName() {
| return ruleBaseName;
| }
| public void setRuleBaseName(String ruleBaseName) {
| this.ruleBaseName = ruleBaseName;
| }
| public String getRuleEngineJndiName() {
| return ruleEngineJndiName;
| }
| public void setRuleEngineJndiName(String ruleEngineJndiName) {
| this.ruleEngineJndiName = ruleEngineJndiName;
| }
|
| private RulesEngine getRulesEngine() {
| <snip>
| }
| public void execute(ExecutionContext executionContext) throws Exception {
| long engineId = getRulesEngine().createNewEngine(getRuleBaseName());
| assertVariables(engineId,executionContext.getContextInstance().getVariables());
| getRulesEngine().fireRules(engineId);
| refreshVariables(engineId,executionContext.getContextInstance().getVariables());
| }
| private void assertVariables(long engineId, Map variables) {
| <snip>
| }
| private void refreshVariables(long engineId, Map variables) {
| <snip>
| }
| }
When the process engine reaches this node, is tells me:
11:15:07,172 ERROR [BeanInstantiator] couldn't set property 'ruleEngineJndiName' to value '<ruleEngineJndiName>java:/cucumber/RulesEngine</ruleEngineJndiName>'
| 11:15:07,173 ERROR [BeanInstantiator] couldn't set property 'ruleBaseName' to value '<ruleBaseName>news-sensor</ruleBaseName>'
| 1
I have tried config-type="field", config-type="bean" and leaving config-type out.
What am I missing?
Thanks,
Willem
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964558#3964558
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964558
19 years, 9 months