[JBoss Seam] - s:selectItems once again
by w17chm4n
The problem :
| Validation Error: Value is not valid
|
I`ve searched the forum and I found that one way is to implement equals() and hashCode() method. So I did (well copy-pasted ;))
| @Entity
| @Scope(ScopeType.EVENT)
| @Name("questionCategory")
| @Table(name="QuestionCategories")
| public class QuestionCategory implements Serializable {
|
| @Id @GeneratedValue
| private Long id;
|
| @NotNull @Length(min=3, max=100)
| private String categoryName;
|
| @OneToMany
| private List<Question> questionList;
|
| @Temporal(value = TemporalType.TIMESTAMP)
| private Date created;
|
| @Override
| public boolean equals(Object obj) {
| if (!(obj instanceof QuestionCategory)) {
| return false;
| }
|
| QuestionCategory c = (QuestionCategory) obj;
| return this.id == c.getId();
| }
|
| @Override
| public int hashCode() {
| int result = 17;
|
| result = 37 * result + this.id.intValue();
|
| return result;
| }
|
| /** Creates a new instance of QuestionCategory */
| public QuestionCategory() {
| this.questionList = new ArrayList<Question>();
| }
|
| public QuestionCategory(String categoryName) {
| this.categoryName = categoryName;
| this.questionList = new ArrayList<Question>();
| }
|
| public Long getId() {
| return id;
| }
|
| public void setId(Long id) {
| this.id = id;
| }
|
| public String getCategoryName() {
| return categoryName;
| }
|
| public void setCategoryName(String categoryName) {
| this.categoryName = categoryName;
| }
|
| public List<Question> getQuestionList() {
| return questionList;
| }
|
| public void setQuestionList(List<Question> questionList) {
| this.questionList = questionList;
| }
|
| public Date getCreated() {
| return created;
| }
|
| public void setCreated(Date created) {
| this.created = created;
| }
| }
|
I have a following code in my question.xhtml
| <body>
| <h:form>
| <h:outputText value="Choose existing category: "/>
| <h:selectOneMenu value="#{questionCategory}" required="true">
| <s:selectItems value="#{questionCategoryList}" var="category" label="#{category.categoryName}" noSelectionLabel="Please Select..."/>
| <s:convertEntity/>
| </h:selectOneMenu>
| <h:commandButton type="submit" value="Add Question" action="#{QuestionCategoryController.addQuestion}"/>
| </h:form>
| </body>
|
And quess what, this still doesn`t work !
I need help !!!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4096066#4096066
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4096066
18Â years, 9Â months
[Microcontainer] - Re: Multiple deployment configurations
by ataylor
Is this new as when i try this in the latest JBossAS 5 it gives me an error:
| 13:51:49,817 ERROR [BeanDeployer] Error during deployment: vfsfile:/home/andy/devtools/jboss-5.0.0.Beta2/server/jbm2/deploy/jboss-messaging.beans
| org.jboss.deployers.spi.DeploymentException: Only one file is allowed, found=[JarEntryHandler(a)32681901[path=jboss-messaging.beans/META-INF/jboss-beans.xml context=file:/home/andy/devtools/jboss-5.0.0.Beta2/server/jbm2/deploy/ real=jar:file:/home/andy/devtools/jboss-5.0.0.Beta2/server/jbm2/deploy/jboss-messaging.beans!/META-INF/jboss-beans.xml], JarEntryHandler(a)32222408[path=jboss-messaging.beans/META-INF/mysql-beans.xml context=file:/home/andy/devtools/jboss-5.0.0.Beta2/server/jbm2/deploy/ real=jar:file:/home/andy/devtools/jboss-5.0.0.Beta2/server/jbm2/deploy/jboss-messaging.beans!/META-INF/mysql-beans.xml]]
| at org.jboss.deployers.plugins.deployers.helpers.AbstractParsingDeployer.parse(AbstractParsingDeployer.java:172)
| at org.jboss.deployers.plugins.deployers.helpers.AbstractParsingDeployer.createMetaData(AbstractParsingDeployer.java:114)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4096059#4096059
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4096059
18Â years, 9Â months
[Installation, Configuration & DEPLOYMENT] - Re: jboss 4.2.1 GA install problem
by light1
thanks for helping me to solve this issue,
To install jboss I login as root and cd to /usr location
the below steps I have done to install jdk and jboss
1. download packages
jdk-1_5_0_13-linux-i586-rpm.bin
java-1.5.0-sun-compat-1.5.0.13-1jpp.i586.rpm
jboss-4.2.1.GA.zip
1. steps to install jdk 5
chmod a+x jdk-1_5_0_13-linux-i586-rpm.bin
./jdk-1_5_0_13-linux-i586-rpm.bin [jdk-1_5_0_13 installed at /usr/java/jdk-1_5_0_13]
3. install sun compat package using rpm
rpm -ivh java-1.5.0-sun-compat-1.5.0.13-1jpp.i586.rpm
4. extract jboss-4.2.1.GA.zip to /usr location
5. run the script run.sh from /usr/jboss-4.2.1.GA/bin
./run.sh
still I am getting the error as before
Now I removed jdk 1.4.2 that comes with fedora core and again installed a fresh copy of jdk 5 from sun's site and changed the JAVA_HOME to /usr/java/jdk1.5.0_13 but still no luck.
=================================================
JBoss Bootstrap Environment
JBOSS_HOME: /usr/jboss-4.2.1.GA
JAVA: /usr/java/jdk1.5.0_13/bin/java
JAVA_OPTS: -Dprogram.name=run.sh -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true
CLASSPATH: /usr/jboss-4.2.1.GA/bin/run.jar:/usr/java/jdk1.5.0_13/lib/tools.jar
=========================================================================
06:39:48,614 INFO [Server] Starting JBoss (MX MicroKernel)...
06:39:48,615 INFO [Server] Release ID: JBoss [Trinity] 4.2.1.GA (build: SVNTag=JBoss_4_2_1_GA date=200707131605)
06:39:48,617 INFO [Server] Home Dir: /usr/jboss-4.2.1.GA
06:39:48,618 INFO [Server] Home URL: file:/usr/jboss-4.2.1.GA/
06:39:48,619 INFO [Server] Patch URL: null
06:39:48,619 INFO [Server] Server Name: default
06:39:48,619 INFO [Server] Server Home Dir: /usr/jboss-4.2.1.GA/server/default
06:39:48,620 INFO [Server] Server Home URL: file:/usr/jboss-4.2.1.GA/server/default/
06:39:48,620 INFO [Server] Server Log Dir: /usr/jboss-4.2.1.GA/server/default/log
06:39:48,621 INFO [Server] Server Temp Dir: /usr/jboss-4.2.1.GA/server/default/tmp
06:39:48,621 INFO [Server] Root Deployment Filename: jboss-service.xml
06:39:49,326 INFO [ServerInfo] Java version: 1.5.0_13,Sun Microsystems Inc.
06:39:49,326 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_13-b05,Sun Microsystems Inc.
06:39:49,326 INFO [ServerInfo] OS-System: Linux 2.6.18-1.2798.fc6,i386
06:39:50,723 INFO [Server] Core system initialized
06:39:56,552 WARN [BasicMBeanRegistry] javax.management.MBeanRegistrationException: preRegister() failed: [ObjectName='jboss.remoting:service=NetworkRegistry', Class=org.jboss.remoting.network.NetworkRegistry (org.jboss.remoting.network.NetworkRegistry@9a8a68)]
06:39:56,603 ERROR [MainDeployer] Could not create deployment: file:/usr/jboss-4.2.1.GA/server/default/conf/jboss-service.xml
org.jboss.deployment.DeploymentException: - nested throwable: (java.lang.reflect.InvocationTargetException)
thanks,
light
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4096042#4096042
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4096042
18Â years, 9Â months