[jboss-user] [JBoss Seam] - Re: Facotry-session and bean-conversation
I found the solution. I forgot the "return orders". | @Factory(value="orders", scope = SESSION) | public List findOrder(){ | | Query query; | | query = em.createQuery("select o from Order o where o.customer=#{currentContact.customer}"); | | | orders = (List) query.getResultList(); | return orders; | | } | Thanks View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082135#4082135 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082135 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Exception with SelectManyCheckbox
I forgot, the problem is solved I used : | | | | | thanks View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082118#4082118 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082118 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Facotry-session and bean-conversation
If I remove the Datamodel annotation, my jsf page is empty because in the page I use the factory to display the list of order in a datatable.But their no exception. So I must Outject my factory, but the exception appears if I do that. What could I do ? Yohann View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082059#4082059 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082059 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Facotry-session and bean-conversation
Hello ! I was wondering if it could be possible to have a bean wich his scope is CONVERSATION and a fctory in this bean whis his scope is SESSION. I want to do that but when I want to go to the xhtml page, I have this exception : Exception during request processing: javax.servlet.ServletException: factory method with defined scope outjected a value: orders My bean : | | @Stateful | @Name("ListOrder") | @Scope(CONVERSATION) | public class OrderManager implements OrderManagerLocal, Serializable { | | @DataModel("orders") List orders; | | @Factory(value="orders", scope = SESSION) | public void findOrder(){ | | Query query; | | query = em.createQuery("select o from Order o where o.customer=#{currentContact.customer}"); | | | orders = (List) query.getResultList(); | | | } | } | Thanks Yohann View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082041#4082041 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082041 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - cascadeType does'nt work ?
hello I have 5 entity : Customer, Order, OrderLine, Contact and ReportBinder. After a long conversation for subscritpion, I persist data concerning the customer and with the cascade, the order and the contact are persist. In the Order there is a Cascade concernig the orderline (the same for contact and ReportBinder) but they are not persisit. Why ? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081985#4081985 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081985 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - persist and cascade
Hello !! I have 5 entity : Customer, Order, OrderLine, Contact and ReportBinder. After a long conversation for subscritpion, I persist data concerning the customer and with the cascade, the order and the contact are persist, however the OrderLine and ReportBinder are not. Why ? And the other question concern the Id of the customer. The id is generated automaticaly and it's a foreign key for the order and contact. But when persisting the customer, the id is not transmitted to the order and the contact. I don't understand why ? If somebody can help me ? Yohann View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081229#4081229 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081229 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: SelectOneRadio
I found a solution, in fact I must declare PackageLine as a String and no as o Package. Now the problem is: I want a Package not a string how could I do to have this ? Thanks PS: sorry for my english View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079193#4079193 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079193 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: SelectOneRadio
Since my first post, I removed @In from packageLine, and the misstacke is still there View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079020#4079020 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079020 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: SelectOneRadio
I'm so desperate. It works if I use selectManyCheckbox : | | | | | | | | | | | | | | | | | | | | | | | When I click on the button, packageLine contain the selected rows, but I want to use selecetOneRadio, because the client must select one package. Somebody can help me ? Thanks View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079009#4079009 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079009 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: SelectOneRadio
In fact, when I look on the Debug page, in the session context, packageLine is not create but it'sinject and outject. Where is the problem ? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078592#4078592 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078592 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: SelectOneRadio
I try, but packageLine is still empty. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078432#4078432 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078432 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - SelectOneRadio
hello ! I have a page with radio buttons. But when I click on the submit button, I don't know what button has been selected. My bean : | @Stateful | @Scope(SESSION) | @Name("PackageManager") | public class PackageManager implements com.pingwy.web.front.PackageManagerLocal, Serializable { | | /** | * Creates a new instance of PackageManager | */ | | @In | private EntityManager em; | | @In(required = false) @Out(required = false) private List packages = new ArrayList(); | | //@In(required = false) @Out(required = false) private List packageLine = new ArrayList(); | | @In(required = false) @Out(required = false) private Package packageLine; | | @Factory(value ="packages") | public void findPackage(){ | | System.out.println("bonjour"); | | Query query; | | query = em.createQuery("Select p From Package p"); | packages = (List) query.getResultList(); | | | } | | @Remove @Destroy | public void destroy(){ | } | | public Package getPackageLine() { | return packageLine; | } | | public void setPackageLine(Package packageLine) { | this.packageLine = packageLine; | } | | public List getPackages() { | return packages; | } | | public void setPackages(List packages) { | this.packages = packages; | } | | } | My jsf page : | http://www.w3.org/1999/xhtml"; | xmlns:ui="http://java.sun.com/jsf/facelets"; | 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:rich="http://richfaces.ajax4jsf.org/rich";> | | | | | | | | | | | | | | | | | | | | | | | | | thanks in advance. Yohann View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078373#4078373 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078373 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Exception with SelectManyCheckbox
Ok but I don't understand the difference between f:selectItems and s:selectitems. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077713#4077713 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077713 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Exception with SelectManyCheckbox
| | | | That's the code in my jsf page. The Bean and the entity page are the same. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077702#4077702 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077702 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Exception with SelectManyCheckbox
Yes I made this misstacke. But after correction there is no change. To resolv this problem I tried anything, but I'am still block. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077688#4077688 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077688 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Exception with SelectManyCheckbox
Hello !! I have a list of report(already persist in database), and I want to display them on a jsf page with selectManyCheckbox.But when I want to acces to the page I have this exception : Exception during request processing: javax.servlet.ServletException: Expected a child component type of UISelectItem/UISelectItems for component type javax.faces.SelectMany(j_id28). Found null. My jsf page : | http://www.w3.org/1999/xhtml"; | xmlns:ui="http://java.sun.com/jsf/facelets"; | xmlns:h="http://java.sun.com/jsf/html"; | xmlns:f="http://java.sun.com/jsf/core";> | | | | | | | | | | | | | | | | | | | | | | | | | My entity : | | @Entity | @Name("Report") | public class Report implements Serializable { | | @Id | @GeneratedValue(strategy = GenerationType.AUTO) | private Long reportId; | private String repName; | private String descReport; | | /** | *Creates the foreign key in relation to the category table | */ | @OneToMany (mappedBy = "reportId") | private List categories; | | /** | *Creates the foreign key in relation to the ContactReportBinder table | */ | @ManyToOne | @JoinColumn (name = "binderId_fk") | private ContactReportBinder binderId; | | /** Creates a new instance of Report */ | public Report() { | } | | Then Getters and setters | and My Bean : | @Stateless | @Name("ReportManager") | @Scope(CONVERSATION) | public class ReportManager implements com.pingwy.web.front.ReportManagerLocal, Serializable { | | /** | * Creates a new instance of ReportManager | */ | | @In | private EntityManager em; | | @DataModel @Out(required = false) private List reports; | | @DataModelSelection @Out(required = false) @In(required = false) SelectItem reporte; | | @Factory("reports") | public List getReports() { | | | return em.createQuery("select r from Report r").getResultList(); | | } | | public void setReports(List reports) { | | this.reports = reports; | } | | | | public SelectItem getReporte() { | return reporte; | } | | Thanks for your help in advance. Yohann View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077633#4077633 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077633 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Exception when i want to fill a form !!
It's ok there is no problem now. I use | @DataModelSelection("conts") @Out(required = false) Contact contactel = new Contact(); | | @Begin(join = true) | public String createContact(){ | Contact contact = new Contact(); | contact.setFirstName(contactel.getFirstName()) ; | contact.setLastName(contactel.getLastName()); | contact.setPhone(contactel.getPhone()); | contact.setMail(contactel.getMail()); | contact.setOtherPhone(contactel.getOtherPhone()); | if (conts==null) conts=new ArrayList(); | conts.add(contact); | | return "success"; | | } | | | Thanks for your help ! View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076789#4076789 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076789 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Exception when i want to fill a form !!
Yes, in fact it's for a subscription process, first the client choose a subscription, then he enter the name of his server and finally he must enter his contact. All works except the page for the contact. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076719#4076719 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076719 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Exception when i want to fill a form !!
However I try with your code but it change nothing . (I'm french so my english is not perfect) View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076714#4076714 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076714 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Exception when i want to fill a form !!
If this is a question yes I want that. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076707#4076707 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076707 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Exception when i want to fill a form !!
I try your solution but it's the same thing View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076642#4076642 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076642 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Exception when i want to fill a form !!
I'm not outjectiing as "conts", "conts" is here because DataModelSelection must be attach to a Datamode, and I have two Datamodel. Otherwise, I deleted the DataModelSelection annotation and I have the same problem. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076637#4076637 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076637 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Exception when i want to fill a form !!
I thought @DataModelSelection doesn't need to have @Out. However I added : anonymous wrote : | @DataModelSelection("conts") | @In (required = false) @Out(required = false) | Contact contactel = new Contact(); | And I have the same Exception. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076631#4076631 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076631 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Exception when i want to fill a form !!
Hello !!! I have a little problem. I'am developping a web application (with Netbeans, glassfish and hibernate). In a page, the client must fill a form and when I click on the button, there is this exception : Exception during request processing: javax.servlet.ServletException: /abonnement_contact.xhtml @45,70 value="#{contactel.firstName}": Target Unreachable, identifier 'contactel' resolved to null my jsf page : | | http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> | http://www.w3.org/1999/xhtml"; | xmlns:ui="http://java.sun.com/jsf/facelets"; |xmlns:h="http://java.sun.com/jsf/html"; |xmlns:s="http://jboss.com/products/seam/taglib"; |xmlns:f="http://java.sun.com/jsf/core";> | | | | | | | | | Please fill the Contact form | | | | Contacts | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and my bean : | */ | @Stateful | @Name("ContactManager") | @Scope(CONVERSATION) | public class ContactManager implements com.pingwy.web.front.ContactManagerLocal, Serializable{ | | | | @In | private EntityManager em; | | @DataModel("contacts") | List contacts; | | @In(required = false) @Out (required = false) | Contact currentContact; | | | @DataModelSelection("conts") | @In (required = false) | Contact contactel = new Contact(); | | @DataModel("conts") | private List conts; | | @Factory("contacts") | public String findContact(){ | | Query query; | | query = em.createQuery("select c from Contact c where c.customerId=#{currentContact.customerId}"); | | contacts = (List) query.getResultList(); | return null; | | | } | |public String updateContact(){ | | em.merge(currentContact); | return null; | | } | | public String removeContact (){ | | System.out.println("contact bientot supprimé"); | em.remove(currentContact); | return null; | } | | | @Begin(join = true) | public String createContact(){ | | conts.add(contactel); | | return "success"; | | } | | | | public List getConts() { | return conts; | } | | public void setConts(List conts) { | this.conts = conts; | |} | public Contact getContactel() { | return contactel; | } | | public void setContactel(Contact contact) { | this.contactel = contact; | } | | @Remove @Destroy | public void destroy(){ | } | } Thanks for your help . View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076616#4076616 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076616 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: failure while trying to deploy-
hi trouby, I apologize for not giving you some response to your post, but it seems that you managed to make Quartz Working on Glassfish. Did you use the QuartzResourceAdapter written by JBoss or did you get another one ? And how did you use it Thanks for reading me View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073009#4073009 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073009 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - problem when I want to persist data
Hi !! I want to persist data in my database. However I have an error : | Exception during request processing: javax.servlet.ServletException: /abonnement_contact.xhtml @17,68 value="#{contact.firstName}": Target Unreachable, identifier 'contact' resolved to null | Here is my ContactManager : | @Stateful | @Name("ContactManager") | @Scope(SESSION) | public class ContactManager implements com.pingwy.web.front.ContactManagerLocal, Serializable{ | | | @In | private EntityManager em; | | @In (create = true, required = true) @Out | private Contact contact; | | | @In @Out (required = false) | Contact currentContact; | | | public String updateContact(){ | | | em.merge(currentContact); | | return null; | | } | | | public String removeContact (){ | | | System.out.println("contact bientot supprimé"); | em.remove(currentContact); | return null; | } | | | | public String createContact(Contact c){ | contact = c; | em.persist(contact); | return null; | | | } | | | | @Remove @Destroy | public void destroy(){ | } | | public Contact getContact() { | return contact; | } | | public void setContact(Contact contact) { | this.contact = contact; | } | | } | and my page : | | http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> | http://www.w3.org/1999/xhtml"; | xmlns:ui="http://java.sun.com/jsf/facelets"; |xmlns:h="http://java.sun.com/jsf/html";> | | | | | | | | Contact | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | thanks in advance View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068624#4068624 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068624 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: @DataModelSelection and ClassCastException
I begin to see that i've done all that stuff in a pretty wrong way. The factory on "lines" returns what it is used by JSF to display the lines. The DataModel were not used to outject lines, or used in a wrong way. I changed a bit my code and get rid of the factory. Now, the Datamodel is well outjected, and the DataModelSelection is well injected. I've got a little problem, however. When I click on the line to select it (an with the actionMethod selectline()), it would normally send me to another page, displaying another list. But the page stays the same, and i have no exception sent. I show you my new code : pages.xml : | | | | | | | | LineManager.java : | @Stateful | @Name("LineManager") | @Scope(SESSION) | public class LineManager implements LineManagerLocal, Serializable { | | @In | private EntityManager em; | | @DataModel("lines") | List lines; | | | | @DataModelSelection("lines") | private OrderLine currentOrderLine; | | | @Out | private Order myOrder; | |public List findlines(){ |lines=myOrder.getOrderLines(); |return lines; | } | @Factory(value="servs",scope=SESSION) |public List searchServers(){ |return currentOrderLine.getServers(); | } | @Begin(join=true) | public void viewParameters(Order order){ | myOrder=em.merge(order); | System.out.println("on rentre dans le line manager"); | findlines(); | } | public List getLines(){ | return lines ; | } | @Begin(join=true) | public void selectLine(Long id){ | //currentOrderLine=em.find(OrderLine.class,id); | } | public OrderLine getCurrentOrderLine() { | return currentOrderLine; | | } | public void setCurrentOrderLine(OrderLine currentOrderLine) { | this.currentOrderLine = currentOrderLine; | } | @Remove @Destroy | public void destroy(){ | } | public Order getMyOrder() { | return myOrder; | } | public void setMyOrder(Order myOrder) { | this.myOrder = myOrder; | } | | } | the code is a bit messy, since i made several tests. i'll make it up later, when i find a solution to my problem. Thanks to those who read that View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068149#4068149 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068149 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: @DataModelSelection and ClassCastException
thanks for your reply... After some check of my .ear, there's no duplicate import of hibernate... To make some stuff working, I had to add these jars to the glassfish lib directory: hibernate-all.jar thirdparty-all.jar jboss-archive-browsing.jar In my ear and my war, all the jars i have are : EAR : commons-beanutils-1.7.0.jar commons-collections-3.1.jar commons-digester-1.6.jar el-api.jar el-ri.jar jboss-seam-debug.jar jboss-seam.jar jsf-facelets.jar WAR (under WEB-INF/lib): ajax4jsf-1.1.1.jar jboss-seam-ui.jar oscache-2.3.2.jar richfaces-3.0.1.jar That's a bit weird, because the page before the one which raise the exception contains a DataModel, and it works just fine... All i have to do is to display in a first page a list of orders you can click on, then display the orderlines relatives to this order and when a user clicks on a orderline, he may see the items that are relative to it. It crashes when the user clicks on the orderline... View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068117#4068117 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068117 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - @DataModelSelection and ClassCastException
Hello everybody... I'm stuck for a couple of days with an error that makes me becoming crazy !!! I have an .xhtml page (i work with facelets) which code is : | | | #{messages['Line']} | | | | | #{messages['Product']} | #{line.productId.prodName} | | | My LineManager is coded as below: | @Stateful | @Name("LineManager") | @Scope(SESSION) | public class LineManager implements LineManagerLocal, Serializable { | | @In | private EntityManager em; | | @DataModel("lines") | List lines; | @DataModelSelection("lines") | private OrderLine currentOrderLine; | | | @Out | private Order myOrder; | |@Factory(value="lines",scope=SESSION) |public List findlines(){ | |return myOrder.getOrderLines(); | | } | | @Factory(value="servs",scope=SESSION) |public List searchServers(){ | |return currentOrderLine.getServers(); | | } | | @Begin(join=true) | public void viewParameters(Order order){ | myOrder=em.merge(order); | System.out.println("on rentre dans le line manager"); |} | | public List getLines(){ | return lines ; | } | | @Begin(nested=true) | public void selectLine(Long id){ | currentOrderLine=em.find(OrderLine.class,id); | } | | | public OrderLine getCurrentOrderLine() { | return currentOrderLine; | | } | | | public void setCurrentOrderLine(OrderLine currentOrderLine) { | this.currentOrderLine = currentOrderLine; | } | | | @Remove @Destroy | public void destroy(){ | } | | public Order getMyOrder() { | return myOrder; | } | | public void setMyOrder(Order myOrder) { | this.myOrder = myOrder; | } | } | When I click on an OrderLine on the page, i get an exception I show you the StackTrace : | | An exception was thrown during an ejb invocation on [LineManager] | javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean; nested exception is: java.lang.ClassCastException: org.hibernate.collection.PersistentBag | java.lang.ClassCastException: org.hibernate.collection.PersistentBag | at org.jboss.seam.databinding.DataModelBinder.getSelection(DataModelBinder.java:19) | at org.jboss.seam.Component.injectDataModelSelection(Component.java:1274) | at org.jboss.seam.Component.injectDataModelSelections(Component.java:1254) | at org.jboss.seam.Component.inject(Component.java:1196) | at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46) | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69) | at org.jboss.seam.interceptors.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:54) | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69) | at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27) | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69) | at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103) | at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53) | 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 com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:560) | at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:470) | at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:192) | at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3922) | at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:184) | at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:70) | at $Proxy656.selectLine(Unknown Source) | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | at sun.reflect.NativeMethodAccessorImpl.invok
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - MultipleDataSelection and problem with merge
Hi everybody ! I currently develop an enterprise application able to manage a client's account(he could see his orders, line orders and product in assocation with those lines). I use netbeans, glassfish, seam and hibernate. I want to post many datalist with link. I use Conversation and Session for that. I want to know if it possible to use many DataModeleSelection. Otherwise theirs is a problem with my ServerManger : first page : login second : list of orders third : list of lines forth : list of server concerned by the lines | | Code of my forth page | Stateful | @Name("ServerManager") | | public class ServerManager implements ServerManagerLocal | { | | | @In | private EntityManager em; | | @DataModel | @In(required=false) @Out(required=false) | List servs; | | | @DataModelSelection | @Out(required=false) | private Server currentServer; | | | private OrderLine myOrderLine; | | | @Factory(value="servs",scope=CONVERSATION) | public void searchServers (){ | | | servs = myOrderLine.getServers(); | | | } | | | @Begin(join=true) | public void viewParameters(OrderLine orderLine){ | System.out.println("on rentre dans le server manager"); | myOrderLine=em.merge(orderLine); | | | } | | | | | | @Remove @Destroy | public void destroy(){ | } | | public List getServs() { | return servs; | } | | | | public Server getCurrentServer() { | return currentServer; | } | | public void setCurrentServer(Server currentServer) { | this.currentServer = currentServer; | } | | public OrderLine getMyOrderLine() { | return myOrderLine; | } | | public void setMyOrderLine(OrderLine myOrderLine) { | this.myOrderLine = myOrderLine; | } | | | } | | And in my debug page I have this exception javax.ejb.EJBTransactionRolledbackException com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91) org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58) org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75) org.jboss.seam.core.Expressions$2.invoke(Expressions.java:148) org.jboss.seam.core.Pages.callAction(Pages.java:499) org.jboss.seam.core.Pages.enterPage(Pages.java:282) org.jboss.seam.jsf.AbstractSeamPhaseListener.enterPage(AbstractSeamPhaseListener.java:276) org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:214) org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:56) com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144) javax.faces.webapp.FacesServlet.service(FacesServlet.java:245) org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:398) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185) org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:217) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185) org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:217) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185) org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127) org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:217) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:258) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:189) org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:611) org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:564) com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:81) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:193) org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:611) org.apache.catalina.core.StandardPi