[JBoss Seam] - model validation failed
by davidclf
I try to migrate Dan Allen's <<Seamless JSF>> example to seam 2.0,
the program startups success,but when I edit the course and click save button,the page return "model validation failed" message!
follows is error page:
| "Course Name
| Type Public Private Semi-Private Resort Military
| Website
| Phone
| Country model validation failed:/courseEditor.jspx @70,116 value="#{course.address.country}": Target Unreachable, 'address' returned null on 'com.ibm.dw.open18.Course'
| State model validation failed:/courseEditor.jspx @78,86 value="#{course.address.state}": Target Unreachable, 'address' returned null on 'com.ibm.dw.open18.Course'
| County model validation failed:/courseEditor.jspx @88,114 value="#{course.address.county}": Target Unreachable, 'address' returned null on 'com.ibm.dw.open18.Course'
| City model validation failed:/courseEditor.jspx @96,110 value="#{course.address.city}": Target Unreachable, 'address' returned null on 'com.ibm.dw.open18.Course'
| ZIP Code model validation failed:/courseEditor.jspx @104,122 value="#{course.address.postalCode}": Target Unreachable, 'address' returned null on 'com.ibm.dw.open18.Course''
|
my web.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
| version="2.4">
|
| <display-name>Open 18 (Phase 1)</display-name>
| <description>JBoss Seam Sample Application</description>
|
| <context-param>
| <description>
| Comma separated list of URIs that serve as spring configuration files
| </description>
| <param-name>contextConfigLocation</param-name>
| <param-value>
| /WEB-INF/spring-beans.xml
| </param-value>
| </context-param>
|
| <filter>
| <filter-name>Seam Redirect Filter</filter-name>
| <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>Seam Redirect Filter</filter-name>
| <url-pattern>*.action</url-pattern>
| </filter-mapping>
|
| <listener>
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
| </listener>
|
| <listener>
| <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
| </listener>
|
| <listener>
| <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
| </listener>
|
| <context-param>
| <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
| <param-value>client</param-value>
| </context-param>
|
| <context-param>
| <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
| <param-value>.jspx</param-value>
| </context-param>
|
| <servlet>
| <servlet-name>Faces Servlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>*.action</url-pattern>
| </servlet-mapping>
|
| <welcome-file-list>
| <welcome-file>index.jsp</welcome-file>
| </welcome-file-list>
|
| </web-app>
|
my componets.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <components xmlns="http://jboss.com/products/seam/components"
| xmlns:core="http://jboss.com/products/seam/core"
| xmlns:persistence="http://jboss.com/products/seam/persistence"
| xmlns:transaction="http://jboss.com/products/seam/transaction"
| xmlns:spring="http://jboss.com/products/seam/spring"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
| http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
| http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
| http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
|
| <!-- NOTE: this file can be used to provide IoC injection of spring-defined beans, instead of using the @In annotation -->
|
| <!-- enable the /debug.action page -->
| <core:init debug="true" />
|
| <!--
| <core:pages no-conversation-view-id="/main.jspx" />
| -->
|
| <core:manager conversation-timeout="60000"
| concurrent-request-timeout="500"
| conversation-id-parameter="cid" />
|
|
| <!--
| <core:ejb installed="false" />
| <core:microcontainer installed="false" />
| -->
|
| <!--<persistence:hibernate-session-factory name=""/>-->
|
| <persistence:managed-hibernate-session name="courseDatabase"
| session-factory="#{sessionFactory}"
| auto-create="true"/>
|
| <transaction:hibernate-transaction session="#{courseDatabase}"/>
|
| <!-- Enabling the debug property will generate an AJAX console (but you could just use FireBug) -->
| <component name="org.jboss.seam.remoting.remotingConfig">
| <property name="debug">false</property>
| </component>
|
| </components>
|
my faces-config.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE faces-config
| PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
| "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
| <faces-config>
|
| <application>
| <view-handler>
| com.sun.facelets.FaceletViewHandler
| </view-handler>
| <variable-resolver>
| org.springframework.web.jsf.DelegatingVariableResolver
| </variable-resolver>
| <locale-config>
| <default-locale>en_US</default-locale>
| </locale-config>
| <message-bundle>MessageBundle</message-bundle>
| </application>
|
| </faces-config>
|
the courseEditor.jspx:
| <?xml version="1.0" encoding="UTF-8"?>
| <jsp:root xmlns="http://www.w3.org/1999/xhtml"
| xmlns:jsp="http://java.sun.com/JSP/Page"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:c="http://java.sun.com/jstl/core" version="2.0">
| <ui:composition template="/templates/master.jspx">
| <ui:define name="title">
| <h:outputText value="#{course.id gt 0 ? 'Edit' : 'Create'} Course" />
| </ui:define>
| <ui:define name="body">
| <h:form id="course">
| <s:validateAll>
| <f:facet name="aroundInvalidField">
| <s:span styleClass="invalid"/>
| </f:facet>
| <f:facet name="afterInvalidField">
| <s:span styleClass="message">#{spacer}<s:message showDetail="true" showSummary="false" /></s:span>
| </f:facet>
| <table class="detail">
| <colgroup>
| <col width="20%" />
| <col width="80%" />
| </colgroup>
| <tr>
| <th><h:outputLabel for="name" value="Course Name" /></th>
| <td>
| <s:decorate>
| <h:inputText id="name" value="#{course.name}" size="40" styleClass="text"/>
| </s:decorate>
| </td>
| </tr>
| <tr>
| <th><h:outputLabel for="type" value="Type" /></th>
| <td>
| <s:decorate>
| <h:selectOneMenu id="type" value="#{course.type}">
| <s:convertEnum />
| <s:enumItem enumValue="PUBLIC" label="Public" />
| <s:enumItem enumValue="PRIVATE" label="Private" />
| <s:enumItem enumValue="SEMI_PRIVATE" label="Semi-Private" />
| <s:enumItem enumValue="RESORT" label="Resort" />
| <s:enumItem enumValue="MILITARY" label="Military" />
| </h:selectOneMenu>
| </s:decorate>
| </td>
| </tr>
| <tr>
| <th><h:outputLabel for="uri" value="Website" /></th>
| <td>
| <s:decorate>
| <h:inputText id="uri" value="#{course.uri}" size="40" styleClass="text" />
| </s:decorate>
| </td>
| </tr>
| <tr>
| <th><h:outputLabel for="phone" value="Phone" /></th>
| <td>
| <s:decorate>
| <h:inputText id="phone" value="#{course.phoneNumber}" size="10" styleClass="text" />
| </s:decorate>
| </td>
| </tr>
| <tr>
| <th><h:outputLabel for="country" value="Country" /></th>
| <td>
| <s:decorate>
| <h:inputText id="country" value="#{course.address.country}" required="true" size="40" styleClass="text" />
| </s:decorate>
| </td>
| </tr>
| <tr>
| <th><h:outputLabel for="state" value="State" /></th>
| <td>
| <s:decorate>
| <h:selectOneMenu id="state" value="#{course.address.state}" required="true">
| <s:selectItems var="state" value="#{states}" label="#{state}" noSelectionLabel="" />
| </h:selectOneMenu>
| </s:decorate>
| </td>
| </tr>
| <tr>
| <th><h:outputLabel for="county" value="County" /></th>
| <td>
| <s:decorate>
| <h:inputText id="county" required="true" value="#{course.address.county}" size="40" styleClass="text" />
| </s:decorate>
| </td>
| </tr>
| <tr>
| <th><h:outputLabel for="city" value="City" /></th>
| <td>
| <s:decorate>
| <h:inputText id="city" required="true" value="#{course.address.city}" size="40" styleClass="text" />
| </s:decorate>
| </td>
| </tr>
| <tr>
| <th><h:outputLabel for="postalCode" value="ZIP Code" /></th>
| <td>
| <s:decorate>
| <h:inputText id="postalCode" required="true" value="#{course.address.postalCode}" size="40" styleClass="text" />
| </s:decorate>
| </td>
| </tr>
| <tr>
| <th><h:outputLabel for="description" value="Description" /></th>
| <td>
| <s:decorate>
| <h:inputTextarea id="description" value="#{course.description}" cols="38" rows="4"/>
| </s:decorate>
| </td>
| </tr>
| </table>
| </s:validateAll>
| <p class="commands">
| <h:commandButton id="save" action="#{courseAction.saveCourse}" value="Save" styleClass="button" />
| #{spacer}
| <s:button id="cancel" action="#{courseAction.clearSelection}" value="Cancel" styleClass="button" />
| </p>
| </h:form>
| </ui:define>
| </ui:composition>
| </jsp:root>
|
Any idea to solve it ? Is it a bug ?
Many thanks in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085347#4085347
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085347
18 years, 10 months
[JBossWS] - Re: please help; could not find deserializer
by itrahulsoni
Hi
I have the same problem
I have done that using the wstools ant task and
not able to foung how to add this mapping and package up it in the war file
so my deserialize error is removed.
so what to do please help me out.
Tools I am using : JBoss 4.0.5 GA and wstools for the same version
JDK1.5.06
Ant 1.6.5
My Ant file is following :
<ws2tools dest="${base}/WEB-INF" config="${base}/wstools-config.xml" includes="${base}/service/classes" classpathref="lib.path" >
</ws2tools>
when i supplied the needed wstools-config.xml and web.xml the Ant task will generate the needed jax-rpc_mapping.xml and webservices.xml and wsdl file for the service
When I run the client it will work fine for the operaion that not returns the value means void and If i use the operation that will return value means String than it will give no deserializer found error so likely the same problem you have.
So please help me to come out of that spend several days to for the solution.
Regards,
Rahul
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085345#4085345
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085345
18 years, 10 months