[JBoss Seam] - Re: JBoss Seam and Web Services using OC4J stack
by apushadow
Manuel--
I too need to make a Seam app run on oc4j. Currently, I have an app running on Tomcat (using JBoss's embedded EJB jar) and I try to deploy it to oc4j and it gives me the following error:
| 16:09:24,140 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
| 16:09:24,140 INFO [SettingsFactory] Query language substitutions: {}
| 16:09:24,140 INFO [SettingsFactory] Second-level cache: enabled
| 16:09:24,140 INFO [SettingsFactory] Query cache: disabled
| 16:09:24,140 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
| 16:09:24,140 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
| 16:09:24,140 INFO [SettingsFactory] Structured second-level cache entries: disabled
| 16:09:24,140 INFO [SettingsFactory] Echoing all SQL to stdout
| 16:09:24,140 INFO [SettingsFactory] Statistics: disabled
| 16:09:24,140 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
| 16:09:24,140 INFO [SettingsFactory] Default entity-mode: pojo
| 16:09:24,187 INFO [SessionFactoryImpl] building session factory
| 16:09:24,656 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configure
| d
| 16:09:24,671 INFO [SchemaExport] Running hbm2ddl schema export
| 16:09:24,671 INFO [SchemaExport] exporting generated schema to database
| 16:09:27,875 INFO [SchemaExport] Executing import script: /import.sql
| 16:09:27,968 INFO [SchemaExport] schema export complete
| 16:09:27,968 INFO [NamingHelper] JNDI InitialContext properties:{}
| 07/03/09 16:09:28 oracle.oc4j.admin.internal.DeployerException: [lunchvote:jboss-seam-lunchvote] - E
| xception creating EntityManagerFactory using PersistenceProvider class org.hibernate.ejb.HibernatePe
| rsistence for persistence unit lunchvoteDatabase.
| 07/03/09 16:09:28 at com.evermind.server.ejb.exception.DeploymentException.exceptionCreatingEn
| tityManagerFactory(DeploymentException.java:130)
| 07/03/09 16:09:28 at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.createCont
| ainerEntityManagerFactory(PersistenceUnitManagerImpl.java:197)
| 07/03/09 16:09:28 at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.initialize
| PersistenceUnit(PersistenceUnitManagerImpl.java:159)
| 07/03/09 16:09:28 at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.initialize
| (PersistenceUnitManagerImpl.java:86)
| 07/03/09 16:09:28 at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:733)
|
| 07/03/09 16:09:28 at com.evermind.server.ApplicationStateRunning.getHttpApplication(Applicatio
| nStateRunning.java:414)
| 07/03/09 16:09:28 at com.evermind.server.Application.getHttpApplication(Application.java:571)
| 07/03/09 16:09:28 at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createH
| ttpApplicationFromReference(HttpSite.java:1990)
| 07/03/09 16:09:28 at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(
| HttpSite.java:1909)
| 07/03/09 16:09:28 at com.evermind.server.http.HttpSite.addHttpApplication(HttpSite.java:1606)
| 07/03/09 16:09:28 at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplication
| Binder.java:238)
| 07/03/09 16:09:28 at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplication
| Binder.java:99)
| 07/03/09 16:09:28 at oracle.oc4j.admin.internal.ApplicationDeployer.bindWebApp(ApplicationDepl
| oyer.java:547)
| 07/03/09 16:09:28 at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeploy
| er.java:202)
| 07/03/09 16:09:28 at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
| 07/03/09 16:09:28 at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4
| JDeployerRunnable.java:52)
| 07/03/09 16:09:28 at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerR
| unnable.java:81)
| 07/03/09 16:09:28 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Releasabl
| eResourcePooledExecutor.java:298)
| 07/03/09 16:09:28 at java.lang.Thread.run(Thread.java:595)
| 2007-03-09 16:09:28.031 NOTIFICATION Application Deployer for lunchvote FAILED.
| 2007-03-09 16:09:28.031 NOTIFICATION Application UnDeployer for lunchvote STARTS.
| 2007-03-09 16:09:28.046 NOTIFICATION Removing all web binding(s) for application lunchvote from all
| web site(s)
| 2007-03-09 16:09:28.453 NOTIFICATION Application UnDeployer for lunchvote COMPLETES.
| 07/03/09 16:09:28 WARNING: DeployerRunnable.run [lunchvote:jboss-seam-lunchvote] - Exception creatin
| g EntityManagerFactory using PersistenceProvider class org.hibernate.ejb.HibernatePersistence for pe
| rsistence unit lunchvoteDatabase.oracle.oc4j.admin.internal.DeployerException: [lunchvote:jboss-seam
| -lunchvote] - Exception creating EntityManagerFactory using PersistenceProvider class org.hibernate.
| ejb.HibernatePersistence for persistence unit lunchvoteDatabase.
| at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:126)
| at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnabl
| e.java:52)
| at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
|
| at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledE
| xecutor.java:298)
| at java.lang.Thread.run(Thread.java:595)
|
| 07/03/09 16:09:28 SEVERE: ProgressObjectImpl.reportError [lunchvote:jboss-seam-lunchvote] - Exceptio
| n creating EntityManagerFactory using PersistenceProvider class org.hibernate.ejb.HibernatePersisten
| ce for persistence unit lunchvoteDatabase.oracle.oc4j.admin.jmx.shared.exceptions.InternalException:
| [lunchvote:jboss-seam-lunchvote] - Exception creating EntityManagerFactory using PersistenceProvide
| r class org.hibernate.ejb.HibernatePersistence for persistence unit lunchvoteDatabase.
| at oracle.oc4j.admin.jmx.shared.deploy.NotificationUserData.<init>(NotificationUserData.java
| :107)
| at oracle.oc4j.admin.internal.Notifier.reportError(Notifier.java:429)
| at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:123)
| at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnabl
| e.java:52)
| at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
|
| at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledE
| xecutor.java:298)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: oracle.oc4j.admin.internal.DeployerException: [lunchvote:jboss-seam-lunchvote] - Exceptio
| n creating EntityManagerFactory using PersistenceProvider class org.hibernate.ejb.HibernatePersisten
| ce for persistence unit lunchvoteDatabase.
| at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:126)
| ... 4 more
|
I didn't change anything...will JBoss's embedded EJB jar even work in OC4J? In any case, I have no clue how to swap it out for Oracle's equivalent, and OC4J probably has some other configuration tasks to do. Any direction would be awesome.
Thanks,
--Rich
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026779#4026779
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026779
19Â years, 1Â month
[JBoss Seam] - persist passing null object
by ector7280
I'm getting the following error when using the CRUD EntityHome object:
15:34:34,569 WARN [JDBCExceptionReporter] SQL Error: 1400, SQLState: 23000
| 15:34:34,569 ERROR [JDBCExceptionReporter] ORA-01400: cannot insert NULL into ("CPPMS"."CPPMS_USER"."NAME")
|
| 15:34:34,569 WARN [JDBCExceptionReporter] SQL Error: 1400, SQLState: 23000
| 15:34:34,569 ERROR [JDBCExceptionReporter] ORA-01400: cannot insert NULL into ("CPPMS"."CPPMS_USER"."NAME")
|
| 15:34:34,569 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
| org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
| at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
| at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
| at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
| at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:29
| 8)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
| at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:296)
| at org.jboss.seam.persistence.EntityManagerProxy.flush(EntityManagerProxy.java:81)
| at org.jboss.seam.framework.EntityHome.persist(EntityHome.java:49)
| at gov.dot.marad.persistence.ejb.model.CppmsUserHome.persist(CppmsUserHome.java:104)
| at gov.dot.marad.persistence.ejb.model.CppmsUserHome$$FastClassByCGLIB$$be17843c.invoke(<generated>)
Here's the bean:
| package gov.dot.marad.persistence.ejb.model;
|
| // Generated Mar 2, 2007 10:00:38 AM by Hibernate Tools 3.2.0.b9
|
| import java.util.HashSet;
| import java.util.Set;
|
| import javax.persistence.CascadeType;
| import javax.persistence.Column;
| import javax.persistence.Entity;
| import javax.persistence.FetchType;
| import javax.persistence.GeneratedValue;
| import javax.persistence.GenerationType;
| import javax.persistence.Id;
| import javax.persistence.ManyToMany;
| import javax.persistence.OneToMany;
| import javax.persistence.SequenceGenerator;
| 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;
|
| /**
| * CppmsUser generated by hbm2java
| */
| @SuppressWarnings("serial")
| @Entity
| @Name("cppmsUser")
| @Scope(ScopeType.SESSION)
| @Table(name = "CPPMS_USER")
| public class CppmsUser implements java.io.Serializable
| {
|
| private int userId;
|
| private String name;
|
| private String emailAddress;
|
| private String userName;
|
| private String password;
|
| private Set<TitleXiTaskReminder> titleXiTaskReminders = new HashSet<TitleXiTaskReminder>(
| 0);
|
| private Set<Report> reports = new HashSet<Report>(0);
|
| private Set<TitleXiTask> titleXiTasksForCreatorId = new HashSet<TitleXiTask>(
| 0);
|
| private Set<Profile> profiles = new HashSet<Profile>(0);
|
| private Set<TitleXiTask> titleXiTasksForUserId = new HashSet<TitleXiTask>(0);
|
| private Set<UserProgRoleRef> userProgRoleRefs = new HashSet<UserProgRoleRef>(
| 0);
|
| private Set<CommunicationLog> communicationLogs = new HashSet<CommunicationLog>(
| 0);
|
| public CppmsUser()
| {
| }
|
| public CppmsUser(int userId)
| {
| this.userId = userId;
| }
|
| public CppmsUser(int userId, String name, String emailAddress,
| String userName, String password,
| Set<TitleXiTaskReminder> titleXiTaskReminders, Set<Report> reports,
| Set<TitleXiTask> titleXiTasksForCreatorId, Set<Profile> profiles,
| Set<TitleXiTask> titleXiTasksForUserId,
| Set<UserProgRoleRef> userProgRoleRefs,
| Set<CommunicationLog> communicationLogs)
| {
| this.userId = userId;
| this.name = name;
| this.emailAddress = emailAddress;
| this.userName = userName;
| this.password = password;
| this.titleXiTaskReminders = titleXiTaskReminders;
| this.reports = reports;
| this.titleXiTasksForCreatorId = titleXiTasksForCreatorId;
| this.profiles = profiles;
| this.titleXiTasksForUserId = titleXiTasksForUserId;
| this.userProgRoleRefs = userProgRoleRefs;
| this.communicationLogs = communicationLogs;
| }
|
| @Id
| @SequenceGenerator(name = "USER_SEQ", sequenceName = "CPPMS_USER_SEQUENCE")
| @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "USER_SEQ")
| @Column(name = "USER_ID", unique = true, nullable = false, precision = 22, scale = 0)
| @NotNull
| public int getUserId()
| {
| return this.userId;
| }
|
| public void setUserId(int userId)
| {
| this.userId = userId;
| }
|
| @Column(name = "NAME", length = 50)
| @Length(max = 50)
| public String getName()
| {
| return this.name;
| }
|
| public void setName(String name)
| {
| this.name = name;
| }
|
| @Column(name = "EMAIL_ADDRESS", length = 60)
| @Length(max = 60)
| public String getEmailAddress()
| {
| return this.emailAddress;
| }
|
| public void setEmailAddress(String emailAddress)
| {
| this.emailAddress = emailAddress;
| }
|
| @Column(name = "USER_NAME", length = 40)
| @Length(max = 40)
| public String getUserName()
| {
| return this.userName;
| }
|
| public void setUserName(String userName)
| {
| this.userName = userName;
| }
|
| @Column(name = "PASSWORD", length = 20)
| @Length(max = 20)
| public String getPassword()
| {
| return this.password;
| }
|
| public void setPassword(String password)
| {
| this.password = password;
| }
|
| @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cppmsUser")
| public Set<TitleXiTaskReminder> getTitleXiTaskReminders()
| {
| return this.titleXiTaskReminders;
| }
|
| public void setTitleXiTaskReminders(
| Set<TitleXiTaskReminder> titleXiTaskReminders)
| {
| this.titleXiTaskReminders = titleXiTaskReminders;
| }
|
| @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cppmsUser")
| public Set<Report> getReports()
| {
| return this.reports;
| }
|
| public void setReports(Set<Report> reports)
| {
| this.reports = reports;
| }
|
| @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cppmsUserByCreatorId")
| public Set<TitleXiTask> getTitleXiTasksForCreatorId()
| {
| return this.titleXiTasksForCreatorId;
| }
|
| public void setTitleXiTasksForCreatorId(
| Set<TitleXiTask> titleXiTasksForCreatorId)
| {
| this.titleXiTasksForCreatorId = titleXiTasksForCreatorId;
| }
|
| @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
| public Set<Profile> getProfiles()
| {
| return this.profiles;
| }
|
| public void setProfiles(Set<Profile> profiles)
| {
| this.profiles = profiles;
| }
|
| @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cppmsUserByUserId")
| public Set<TitleXiTask> getTitleXiTasksForUserId()
| {
| return this.titleXiTasksForUserId;
| }
|
| public void setTitleXiTasksForUserId(Set<TitleXiTask> titleXiTasksForUserId)
| {
| this.titleXiTasksForUserId = titleXiTasksForUserId;
| }
|
| @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cppmsUser")
| public Set<UserProgRoleRef> getUserProgRoleRefs()
| {
| return this.userProgRoleRefs;
| }
|
| public void setUserProgRoleRefs(Set<UserProgRoleRef> userProgRoleRefs)
| {
| this.userProgRoleRefs = userProgRoleRefs;
| }
|
| @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cppmsUser")
| public Set<CommunicationLog> getCommunicationLogs()
| {
| return this.communicationLogs;
| }
|
| public void setCommunicationLogs(Set<CommunicationLog> communicationLogs)
| {
| this.communicationLogs = communicationLogs;
| }
|
|
| }
|
The home:
| package gov.dot.marad.persistence.ejb.model;
|
| import java.util.ArrayList;
| import java.util.List;
|
| import javax.persistence.EntityManager;
|
| import org.jboss.seam.annotations.Factory;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.framework.EntityHome;
|
| @SuppressWarnings("serial")
| @Name("cppmsUserHome")
| public class CppmsUserHome extends EntityHome<CppmsUser>
| {
|
| @In(create = true)
| EntityManager em;
|
| public EntityManager getEntityManager()
| {
| return em;
| }
|
| @Factory("cppmsUser")
| public CppmsUser initCppmsUser()
| {
| return getInstance();
| }
|
| public void setCppmsUserUserId(Integer id)
| {
| setId(id);
| }
|
| public Integer getCppmsUserUserId()
| {
| return (Integer) getId();
| }
|
| @Override
| protected CppmsUser createInstance()
| {
| CppmsUser cppmsUser = new CppmsUser();
| return cppmsUser;
| }
|
| public void wire()
| {
| }
|
| public boolean isWired()
| {
| return true;
| }
|
| public CppmsUser getDefinedInstance()
| {
| return isIdDefined() ? getInstance() : null;
| }
|
| public List<TitleXiTaskReminder> getTitleXiTaskReminders()
| {
| return getInstance() == null ? null
| : new ArrayList<TitleXiTaskReminder>(getInstance()
| .getTitleXiTaskReminders());
| }
|
| public List<Report> getReports()
| {
| return getInstance() == null ? null : new ArrayList<Report>(
| getInstance().getReports());
| }
|
| public List<TitleXiTask> getTitleXiTasksForCreatorId()
| {
| return getInstance() == null ? null : new ArrayList<TitleXiTask>(
| getInstance().getTitleXiTasksForCreatorId());
| }
|
| public List<TitleXiTask> getTitleXiTasksForUserId()
| {
| return getInstance() == null ? null : new ArrayList<TitleXiTask>(
| getInstance().getTitleXiTasksForUserId());
| }
|
| public List<UserProgRoleRef> getUserProgRoleRefs()
| {
| return getInstance() == null ? null : new ArrayList<UserProgRoleRef>(
| getInstance().getUserProgRoleRefs());
| }
|
| public List<CommunicationLog> getCommunicationLogs()
| {
| return getInstance() == null ? null : new ArrayList<CommunicationLog>(
| getInstance().getCommunicationLogs());
| }
|
| }
|
The page:
| <f:view xmlns:h="http://java.sun.com/jsf/html"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:ice="http://www.icesoft.com/icefaces/component">
|
| <ice:outputDeclaration doctypeRoot="HTML"
| doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
| doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />
|
| <html>
| <head>
|
| <title>CPPMS</title>
| <link href="./xmlhttp/css/xp/xp.css" rel="stylesheet" type="text/css" />
| </head>
| <body>
| <h2>Create User</h2>
| <ice:form>
| <f:loadBundle basename="gov.dot.marad.web.MessageBundle" var="bundle" />
| <ice:outputLabel for="name">
| <ice:outputText value="#{bundle.name_label}">
| </ice:outputText>
| </ice:outputLabel>
| <ice:inputText id="name" value="#{cppmsUser.name}" />
| <br />
| <ice:outputLabel for="emailAddress">
| <ice:outputText value="#{bundle.user_email_label}">
| </ice:outputText>
| </ice:outputLabel>
| <ice:inputText id="emailAddress" value="#{cppmsUser.emailAddress}" />
| <br />
| <ice:outputLabel for="userName">
| <ice:outputText value="#{bundle.user_name_label}">
| </ice:outputText>
| </ice:outputLabel>
| <ice:inputText id="userName" value="#{cppmsUser.userName}" />
| <br />
|
| <ice:outputLabel for="password">
| <ice:outputText value="#{bundle.user_password_label}"></ice:outputText>
| </ice:outputLabel>
| <ice:inputSecret id="password" redisplay="false"
| value="#{cppmsUser.password}"></ice:inputSecret>
| <br />
| <ice:messages showDetail="true" />
| <ice:commandButton action="#{cppmsUserHome.persist}"
| value="Create User"></ice:commandButton>
| </ice:form>
| </body>
| </html>
| </f:view>
|
Is it necessary to supply all of parameters in the constructor?
Is this caused by the use of a sequence generator?
Thanks,
JR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026771#4026771
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026771
19Â years, 1Â month
[Tomcat, HTTPD, Servlets & JSP] - Re: [TomcatDeployer] Failed to map vhost: xxx.domain.com
by sshrestha
This is the second Service element added.
| <Service name="my.web" className="org.jboss.web.tomcat.tc5.StandardService">
|
| <Connector port="8181" address="10.0.2.23"
| maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
| emptySessionPath="true"
| enableLookups="false" redirectPort="8443" acceptCount="100"
| connectionTimeout="20000" disableUploadTimeout="true"/>
|
| <Connector port="8019" address="10.0.2.23"
| emptySessionPath="true" enableLookups="false" redirectPort="8443"
| protocol="AJP/1.3"/>
|
| <Engine name="my.web" defaultHost="vhost2">
|
| <Host name="vhost2" autoDeploy="false" deployOnStartup="false" deployXML="false">
| <Alias>xxx.domain.com</Alias>
|
| <Valve className="org.apache.catalina.valves.AccessLogValve"
| prefix="vhost2_busdev" suffix=".log" pattern="common"
| directory="${jboss.server.home.dir}/log"/>
|
| <DefaultContext cookies="true" crossContext="true" override="true"/>
| </Host>
|
| </Engine>
| </Service>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026767#4026767
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026767
19Â years, 1Â month
[JBoss Seam] - Problem with s:selectItems
by jqueryï¼ interia.pl
Hi,
I can't force s:selectItems to work. Even the easiest example doesn't work.
| Name("personHome")
| public class PersonHome extends EntityHome<Person> {
|
|
|
| public List<SelectItem> countries = new ArrayList();
| public String country = "";
|
| public void setCountries(List<Country> countries) {}
|
| public List<SelectItem> getCountries(){
|
| for(int i=0;i<3;i++){
| countries.add( new SelectItem());
| }
| countries.get(0).setLabel("Great Britain");
| countries.get(0).setValue("GB");
| countries.get(1).setLabel("Germany");
| countries.get(1).setValue("D");
| countries.get(2).setLabel("Italy");
| countries.get(2).setValue("I");
|
| return countries;
| }
| }
|
|
And in xhtml:
| <h:selectOneMenu value="#{personHome.country}" >
| <s:selectItems value="#{personHome.countries}" var="country" label="#{country.label}" />
| </h:selectOneMenu>
|
|
And then I get error:
Value is no String (class=javax.faces.model.SelectItem, value=javax.faces.model.SelectItem@1e76a88) and component person:_id38with path: {Component-Path : [Class: org.ajax4jsf.framework.ajax.AjaxViewRoot,ViewId: /specialist/spec_registration.xhtml][Class: javax.faces.component.html.HtmlForm,Id: person][Class: org.jboss.seam.ui.UIValidateAll,Id: _id7][Class: org.jboss.seam.ui.UIDecorate,Id: _id37][Class: javax.faces.component.html.HtmlSelectOneMenu,Id: _id38]} does not have a Converter
Everythig is String so what does the error mean?
What am I doing wrong?
Thanks in advance,
jquery
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026764#4026764
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026764
19Â years, 1Â month