[JBoss Seam] - pages.xml issues after upgrade to seam 1.2
by tazman
Hi all!
I upgraded today to Seam 1.2 and many functionalities of pages.xml have stopped working since then. Namely, page parameters and login redirection don't work anymore.
I have an ArticleHome like this:
| @Name("articleHome")
| public class ArticleHome extends EntityHome<Article> {
| @In(create = true)
| EntityManager entityManager;
|
| @In(required = false)
| Integer articleId;
|
| @Factory("article")
| public Article initArticle() { return getInstance(); }
|
| public Object getId() {
| return articleId;
| }
|
| @Override
| public EntityManager getEntityManager() {
| return entityManager;
| }
| ...
|
| }
|
|
And I have this in pages.xml for the articleId param:
| <page view-id="/article.seam">
| <param name="id" value="#{articleHome.articleId}" />
| </page>
|
The articleId is always null when the factory method is invoked. However, a query that returns comments for the article gets somehow the article's id. So in the article.seam page, I can see the article's comments but an empty article:
| <framework:entity-query name="commentsQuery" ejbql="select c from Comment c" max-results="10">
| <framework:restrictions>
| <value>article_id = #{article.id}</value>
| </framework:restrictions>
| </framework:entity-query>
|
When I try to paginate through the comments, I always get the first page back because firstResult page parameter is not set either.
If I use @RequestParameter(value="id") Integer articleId instead of page parameter, everything work but pagination.
My other problem is that login redirection doesn't work anymore.
All of these were working yesterday with Seam CVS version from Feb 26th. When I downgrade back to that version, they start working again. I cannot figure out what the issue is. I checked the seam examples and adapted my config files to 1.2 schemas.
I'm using JSF 1.2 RI, Ajax4JSF 1.0.5, and Facelets 1.1.11 on top of JBoss 4.0.5.
Does somebody have any idea?
tazman
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023860#4023860
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023860
17Â years, 10Â months
[JBoss jBPM] - Stateless Process Engine executor threading issues
by jorgemoralespou_2
Hi,
We've developed an engine for executing process instances. Until know, we only need execution of stateless processes, so we get the root token, and signal on it until reaching the final state. Everything works fine till here. We have a WS facade for starting the Process executions.
The problem is that execution times increase linearly as the number of clients increase, which isn't the desired behaviour.
Everything seems to scale up properly, but for the JBPM engine. Theres is plenty of cpu time left, plenty of threads configured in the AS, plenty of everything, but isn't scaling.
I post you here the execution logic we use so any of you can help us finding a solution.
Thanks
| JbpmContext ctx = null;
| boolean newContext = false;
| try {
| // Fetch JbpmContext
| ctx = getJbpmConfiguration().getCurrentJbpmContext();
| if (ctx == null) {
| ctx = getJbpmConfiguration().createJbpmContext();
| newContext = true;
| }
|
| // Get process definition
| ProcessDefinition processDefiniton = null;
| if (version == null) {
| processDefiniton = ctx.getGraphSession()
| .findLatestProcessDefinition(processName);
| } else {
| processDefiniton = ctx.getGraphSession().findProcessDefinition(
| processName, version);
|
| }
| if (processDefiniton == null) {
| throw new ProcessDefinitionNotFoundException(processName,
| version);
| }
|
| // Create instace, add input params as context variables
|
| ProcessInstance instance = new ProcessInstance(processDefiniton);
| instance.getContextInstance().setTransientVariable(
| "REQUEST", req);
|
| // Execute process
| do{
| instance.getRootToken().signal();
| } while (!EndState.class.isAssignableFrom(instance.getRootToken().getNode().getClass()));
|
| // Get output parameters
| Map<String, Serializable> response = (Map<String, Serializable>) instance.getContextInstance().getTransientVariable("RESPONSE");
| return response;
| } catch (Exception e) {
| throw new JbpmEngineException("Unexpected error", e);
| } finally {
| if (ctx != null && newContext) {
| ctx.close();
| }
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023855#4023855
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023855
17Â years, 10Â months
[JBoss Seam] - Nested conversation/seam object hidden by parent conversatio
by adam_just
I have the following simple scenario (a modification of the booking example): An aggregate entity, Business, with OneToMany relationships with Address, Contact, and Opportunity. For managing Business, I have a Conversation scoped Stateful Session Bean/Seam Component, that also models an Address, a Contact, and an Opportunity (so that one may be selected and acted upon).
Another Stateful Session Bean is used for each of CreateAddress, CreateContact, and CreateOpportunity. No matter what combination of annotations/code I use, the Seam Entity objects already visible in the parent conversation are found, and injected into the CreateXYZ Converstation, and the form is filled in with the existing values.
In the CreateXYZ form, specifically selecting form values not associated with the parent's Object, but instead with the CreateXYZ Object/Action leads to a "Error model data update." Using form values directly from the XYZ Entity leads Seam to inject the existing Entity from the Parent's conversation.
Attempts to reassign the @In XYZ object within the CreateXYZ Stateful Session Seam Component lead to a derived object not being properly created as a member of Parent (Business') Collection(s).
In the listings below, I have attempted to omit extraneous information. Consequently, please forgive omissions not related to the issue at hand.
Thank You, Adam
| @Entity
| @Name("business")
| public class Business implements Serializable {
|
| private long id;
|
| private Collection<Address> addresses = new ArrayList<Address>();
|
| private Collection<Contact> contacts = new ArrayList<Contact>();
|
| private Collection<Opportunity> opportunities = new ArrayList<Opportunity>();
|
| public Business() {
|
| }
|
| @Id @GeneratedValue
| public long getId() {
| return id;
| }
|
| public void setId(long id) {
| this.id = id;
| }
|
|
| @OneToMany(cascade={CascadeType.PERSIST,CascadeType.MERGE},fetch=FetchType.LAZY)
| public Collection<Address> getAddresses() {
| return addresses;
| }
|
| public void setAddresses(Collection<Address> addresses) {
| this.addresses = addresses;
| }
|
| @OneToMany(cascade={CascadeType.PERSIST,CascadeType.MERGE},fetch=FetchType.LAZY)
| public Collection<Contact> getContacts() {
| return contacts;
| }
|
| public void setContacts(Collection<Contact> contacts) {
| this.contacts = contacts;
| }
| @OneToMany(cascade={CascadeType.PERSIST,CascadeType.MERGE},fetch=FetchType.LAZY)
| public Collection<Opportunity> getOpportunities() {
| return opportunities;
| }
|
| public void setOpportunities(Collection<Opportunity> opportunities) {
| this.opportunities = opportunities;
| }
|
|
| @Override
| public String toString() {
| return "Business(" + id + ")";
| }
|
| }
|
|
| @Entity
| @Name("address")
| public class Address implements Serializable {
| /**
| *
| */
| private static final long serialVersionUID = 1L;
|
| private long id;
|
|
| /**
| * The public no-argument constructor for AddressBean.
| */
| public Address() {
| //
| }
|
| @Id @GeneratedValue
| public long getId() {
| return id;
| }
|
| public void setId(long id) {
| this.id = id;
| }
|
|
| }
|
| @Stateful
| @Name("businessManaging")
| @LoggedIn
| public class BusinessManagingAction implements BusinessManaging {
|
| @PersistenceContext(type=EXTENDED)
| private EntityManager em;
|
| @In(required=false) @Out
| private Business business;
|
| @In(required=false) @Out(required=false)
| private Contact contact;
|
| @In(required=false) @Out(required=false)
| private Address address;
|
| @In(required=false) @Out(required=false)
| private Opportunity opportunity;
|
| @In
| private FacesMessages facesMessages;
|
| @Logger
| private Log log;
|
| @Begin(join=true)
| public String selectBusiness(Business selectedBusiness) {
| log.info("Selected Business: #{selectedBusiness.id}");
| business = em.merge(selectedBusiness);
| return "business";
| }
|
| public String updateBusiness(Business modifiedBusiness) {
| business = em.merge(modifiedBusiness);
| return "business";
| }
|
| public String selectContact(Contact contact) {
| log.info("Selected Contact: #{contact.id}");
| this.contact = contact;
| return "editcontact";
| }
|
| public String updateContact() {
| log.info("Updating: #{contact.id}");
| em.merge(contact);
| return "business";
| }
|
| public String selectAddress(Address address) {
| log.info("Selected Address: #{address.id}");
| this.address = address;
| return "editaddress";
| }
|
| public String updateAddress() {
| log.info("Updating: #{address.id}");
| em.merge(address);
| return "business";
| }
|
| public String selectOpportunity(Opportunity opportunity) {
| log.info("Selected Opportunity: #{opportunity.id}");
| this.opportunity = opportunity;
| return "editopportunity";
| }
|
| public String updateOpportunity() {
| log.info("Updating: #{opportunity.id}");
| em.merge(opportunity);
| return "business";
| }
|
| public String addContact() {
| business.addContact(contact);
| return "business";
| }
|
| public String removeContact(Contact contact) {
| business.removeContact(contact);
| return "business";
| }
|
| public String addAddress() {
| business.addAddress(address);
| return "business";
| }
|
| public String removeAddress(Address address) {
| business.removeAddress(address);
| return "business";
| }
|
| public String addOpportunity() {
| business.addOpportunity(opportunity);
| return "business";
| }
|
| public String removeOpportunity(Opportunity opportunity) {
| business.removeOpportunity(opportunity);
| return "business";
| }
|
| @End
| public String cancel() {
| return "businesses";
| }
|
| @Destroy @Remove
| public void destroy() {
|
| }
|
| }
|
| @Stateful
| @Scope(CONVERSATION)
| @Name("createAddress")
| public class CreateAddressAction implements CreateAddress {
|
| @In(required=false) @Out
| private Business business;
|
| @In(required=false)
| private Address a = new Address();
|
| @PersistenceContext(type=EXTENDED)
| private EntityManager em;
|
| @In
| private FacesMessages facesMessages;
|
| @Logger
| private Log log;
|
| @Begin(nested=true)
| public String selectBusiness(Business selectedBusiness) {
| log.info("a == null : " + (a==null));
| business = em.merge(selectedBusiness);
| a = new Address();
| return "createaddress";
| }
|
|
| @End
| public String createAddress() {
| log.info("A looks like #{a}");
| business.addAddress(a);
| return "business";
| }
|
| @Destroy @Remove
| public void destroy() {}
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023851#4023851
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023851
17Â years, 10Â months