[JBoss Seam] - problem with s:convertEntity and h:selectManyListbox
by Vitalik
I have trouble with <s:convertEntity/>. On my display appear error message: "Conversion Error setting value '1 2' for '#{resourceCatalog.resources}'."
My env:
JBoss 4.0.5
JBoss Seam 1.2.1.GA
Sun RI 1.2_04
I have two entity bean: Resource and ResourceCatalog:
| @javax.persistence.Entity
| @javax.persistence.Table(name = "RESOURCE_CATALOG")
| @javax.persistence.NamedQuery(name = "ResourceCatalog.findAll", query = "select resourceCatalog from ResourceCatalog AS resourceCatalog")
| public class ResourceCatalog
| implements java.io.Serializable, Comparable<ResourceCatalog>
| {
|
| private static final long serialVersionUID = 4982628439420436925L;
|
| // ----------- Attribute Definitions ------------
|
| private java.lang.String name;
| private java.lang.String description;
| private java.lang.Long id;
|
|
| // --------- Relationship Definitions -----------
|
| private java.util.Set<my.model.resource.Resource> resources = new java.util.TreeSet<my.model.Resource>();
|
|
| @javax.persistence.Column(name = "NAME", nullable = false, insertable = true, updatable = true)
| public java.lang.String getName()
| {
| return name;
| }
|
|
| public void setName(java.lang.String value)
| {
| this.name = value;
| }
|
| @javax.persistence.Column(name = "DESCRIPTION", nullable = false, insertable = true, updatable = true)
| public java.lang.String getDescription()
| {
| return description;
| }
|
|
| public void setDescription(java.lang.String value)
| {
| this.description = value;
| }
|
|
| @javax.persistence.Id
| @javax.persistence.GeneratedValue(strategy = javax.persistence.GenerationType.AUTO)
| @javax.persistence.Column(name = "ID", nullable = false, insertable = true, updatable = true)
| public java.lang.Long getId()
| {
| return id;
| }
|
|
| public void setId(java.lang.Long value)
| {
| this.id = value;
| }
|
| @javax.persistence.ManyToMany()
| @javax.persistence.JoinTable
| (
| name = "RESOURCE_CATALOGS2RESOURCES",
| joinColumns = {(a)javax.persistence.JoinColumn(name = "RESOURCE_CATALOG_IDC", referencedColumnName = "ID")},
| inverseJoinColumns = {(a)javax.persistence.JoinColumn(name = "RESOURCE_IDC", referencedColumnName = "ID")}
| )
| public java.util.Set<my.model.resource.Resource> getResources()
| {
| return this.resources;
| }
|
| /**
| * Set the resources
| *
| * @param resources
| */
| public void setResources (my.model.resource.Resource> resources)
| {
| this.resources = resources;
| }
|
| ......................
|
| }
|
| @javax.persistence.Entity
| @javax.persistence.Table(name = "RESOURCE")
| @javax.persistence.Inheritance(strategy = javax.persistence.InheritanceType.JOINED)
| @javax.persistence.NamedQuery(name = "Resource.findAll", query = "select resource from Resource AS resource")
| public class Resource
| implements java.io.Serializable, Comparable<Resource>
| {
|
| private static final long serialVersionUID = 265906204510520252L;
|
| private java.lang.String name;
| private java.lang.String description;
| private java.lang.Long id;
|
|
| private java.util.Set<my.model.ResourceCatalog> resourceCatalogs = new java.util.TreeSet<my.model.ResourceCatalog>();
|
| @javax.persistence.Column(name = "NAME", nullable = false, insertable = true, updatable = true)
| public java.lang.String getName()
| {
| return name;
| }
|
| public void setName(java.lang.String value)
| {
| this.name = value;
| }
|
| @javax.persistence.Column(name = "DESCRIPTION", nullable = false, insertable = true, updatable = true)
| public java.lang.String getDescription()
| {
| return description;
| }
|
| public void setDescription(java.lang.String value)
| {
| this.description = value;
| }
|
|
| @javax.persistence.Id
| @javax.persistence.GeneratedValue(strategy = javax.persistence.GenerationType.AUTO)
| @javax.persistence.Column(name = "ID", nullable = false, insertable = true, updatable = true)
| public java.lang.Long getId()
| {
| return id;
| }
|
| public void setId(java.lang.Long value)
| {
| this.id = value;
| }
|
|
| @javax.persistence.ManyToMany(mappedBy = "resources")
| public java.util.Set<my.model.resource.ResourceCatalog> getResourceCatalogs()
| {
| return this.resourceCatalogs;
| }
|
| public void setResourceCatalogs (java.util.Set<my.model.resource.ResourceCatalog> resourceCatalogs)
| {
| this.resourceCatalogs = resourceCatalogs;
| }
|
|
| .................................
|
| }
|
Snippet from components.xml:
| <factory name="resource" value="#{resourceHome.instance}" />
| <fwk:entity-home name="resourceHome"
| entity-class="my.model.resource.Resource"
| entity-manager="#{entityManager}">
| </fwk:entity-home>
| <fwk:entity-query name="resourceCollection" ejbql="from Resource" />
| <factory name="resourceCatalog" value="#{resourceCatalogHome.instance}" />
| <fwk:entity-home name="resourceCatalogHome"
| entity-class="my.model.resource.ResourceCatalog"
| entity-manager="#{entityManager}">
| </fwk:entity-home>
| <fwk:entity-query name="resourceCatalogCollection" ejbql="from ResourceCatalog" />
|
Snippet from edit page:
| <h:selectManyListbox value="#{resourceCatalog.resources}">
| <s:selectItems var="field" label="#{field.name}" value="#{resourceCollection.resultList}" />
| <s:convertEntity/>
| </h:selectManyListbox>
|
I get validation error message when i try submit entity ResourceCatalog.
I start seam-ui from examples folders on my system configuration and it start successful. I do not see different between these applications.
Also, I have success result when I use h:selectOneMenu and ManyToOne association.
Please, help me :(
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034749#4034749
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034749
19 years
[JBoss Eclipse IDE (users)] - Re: Cant find JBoss 3.2.x in the debug configurations
by dmaddi
There is nothing wrong with the IDE, the tutorial is not udpated for the latest IDE release.
If you are facing problems to create a server and deploy the app you can check out the below steps.
Creating a server configuration for first time
--------------------------------
1. Click on JBoss AS icon OR switch to JBoss AS perspective.
2. Click on New server
3. Select JBoss Inc/JBoss AS 4.0(if you are creation version 4.x server),
and enter the server name(default is localhost) and click Next
4. Enter the name for the runtime to be used for the server, the home directory for the server.
Select the default configuration after entering the details and click Next
(A successful runtime is created which can be used by mulitple server's)
5. Enter the server name and click Next
6. Click Finish and test the server by starting it.
Deploying the Application on server
-----------------------------------
1. Select the ear(FiboApp.ear) file instead of project(Tutorial) and right click, select Run As/Run on Server
2. You can select the server created in previous step and click Next.
3. You can see the ear file on RHS and cick Finish to deploy it on server.
4. Access the deployed app i.e http://localhost:8080/fibo/
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034746#4034746
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034746
19 years
[JBoss Eclipse IDE (users)] - Re: Deploy EAR from IDE rel 2.0?
by dmaddi
I also faced the same problem but figured out the way to deploy it.
You can select the EAR file and Right Click and Run on it server to deploy it.
Check the below steps to create the server and deploy an ear on it.
Creating a server configuration for first time
---------------------------------------------------
1. Click on JBoss AS icon OR switch to JBoss AS perspective.
2. Click on New server
3. Select JBoss Inc/JBoss AS 4.0(if you are creation version 4.x server), and enter the server name(default is localhost) and click Next
4. Enter the name for the runtime to be used for the server, the home directory for the server. Select the default configuration after entering the details and click Next
5. Enter the server name and click Next
6. Click Finish and test the server by starting it.
Deploying the Application on server
---------------------------------------------------
1. Select the ear(FiboApp.ear) file instead of project(Tutorial) and right click, select Run As/Run on Server
2. You can select the server created in previous step and click Next.
3. You can see the ear file on RHS and cick Finish to deploy it on server.
4. Access the deployed app i.e http://localhost:8080/fibo/
Thanks,
Dilip
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034742#4034742
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034742
19 years