You have to provide the types for the fields, or else Wicket won't be
able to discover what type to use (apparently it resolves to boolean
for the name), or provide default values with the correct type in your
valuemap.

i.e. either:

add(new TextField("firstName", new PropertyModel(map, "firstName"),
String.class));

or

map.put("firstName", "");

Martijn

On 9/25/07, Phillip Rhodes <[EMAIL PROTECTED]> wrote:
> Hi guys, I'm seeing a weird problem with Wicket.  I *think* it's the
> same problem discussed here
> <http://www.nabble.com/Tracking-down-an-elusive-error-during-migration-to-1.3-t4381647.html>,
> but won't swear to it.  Basically Wicket
> is logging a NoSuchMethodException when rendering my page.
>
> This is using Wicket 1.2.4, running on JDK 1.6, JBoss 4.0.5, on Windows
> 2000 Server.
>
> The java code for the page in question looks like this:
>
>
>
> *********************** BEGIN JAVA CODE ***************************
> package org.openqabal.web.registration;
>
> import org.openqabal.auth.encoder.QPasswordEncoder;
> import org.openqabal.core.lib.domain.QGenericUserAccount;
> import org.openqabal.core.lib.domain.impl.UserAccountImpl;
> import org.openqabal.core.lib.service.QHybridUserService;
>
> import wicket.PageParameters;
> import wicket.examples.WicketExampleHeader;
> import wicket.markup.html.WebPage;
> import wicket.markup.html.form.Form;
> import wicket.markup.html.form.PasswordTextField;
> import wicket.markup.html.form.TextField;
> import wicket.markup.html.panel.FeedbackPanel;
> import wicket.model.PropertyModel;
> import wicket.spring.injection.annot.SpringBean;
> import wicket.util.string.Strings;
> import wicket.util.value.ValueMap;
>
> public final class UserRegistration1 extends WebPage
> {
>         @SpringBean(name="hybridUserService")
>         private QHybridUserService userService;
>
>         @SpringBean(name="passwordEncoderBean")
>         private QPasswordEncoder passwordEncoder;
>
>         // note: TODO UserAccountFactory here...
>
>         public UserRegistration1()
>         {
>                 this( null );
>         }
>
>         public UserRegistration1(       final PageParameters parameters )
>         {
>                 final String packageName = getClass().getPackage().getName();
>                 add(new WicketExampleHeader("mainNavigation",
> Strings.afterLast(packageName, '.'), this));
>
>                 // Create feedback panel and add to page
>                 final FeedbackPanel feedback = new FeedbackPanel("feedback");
>
>                 add(feedback);
>
>                 add(new UserRegistrationForm("userForm"));
>         }
>
>         public final class UserRegistrationForm extends Form
>         {
>                 // El-cheapo model for form
>                 private final ValueMap properties = new ValueMap();
>
>                 public UserRegistrationForm(final String componentName)
>                 {
>                         super(componentName);
>
>                         // Attach textfield components that edit properties 
> map model
>                         add(new TextField("firstName", new 
> PropertyModel(properties,
> "firstName")));
>                         add(new TextField("lastName", new 
> PropertyModel(properties,
> "lastName")));
>                         add( new TextField( "loginName", new 
> PropertyModel(properties,
> "loginName")));
>                         add(new TextField("emailAddress", new 
> PropertyModel(properties,
> "emailAddress")));
>                         add(new PasswordTextField("password", new 
> PropertyModel(properties,
> "password")));
>                         add(new PasswordTextField("confirmPassword", new
> PropertyModel(properties, "confirmPassword")));
>                 }
>
>                 public final void onSubmit()
>                 {
>                         System.out.println( "onSubmit()" );
>                         String firstName = properties.getString("firstName");
>                         String lastName = properties.getString("lastName");
>                         String loginName = properties.getString( "loginName" 
> );
>                         String emailAddress = 
> properties.getString("emailAddress");
>                         String password = properties.getString("password");
>                         String confirmPassword = 
> properties.getString("confirmPassword");
>
>                         // create and persist user object using the details we
>                         // received...
>
>                         QGenericUserAccount userAccount = new 
> UserAccountImpl();
>                         userAccount.setLoginName( loginName );
>                         userAccount.setPassword( 
> passwordEncoder.encode(password));
>
>                         userService.createAllAccounts(userAccount);
>
>
>                 }
>         }
> }
>
> *********************** END JAVA CODE ***************************
>
>
>
> and here is the relevant stuff from the log.  FWIW, I get this
> for every one of the above properties, but am only posting this
> log snippet since the others are all the same.
>
>
>
> *********** BEGIN LOG / STACKTRACE *******************************
>
> 2007-09-24 21:55:13,890 DEBUG [wicket.Page] Rendered [MarkupContainer
> [Component id = lastName, page =
> org.openqabal.web.registration.UserRegistration1, path =
> 0:userForm:lastName.TextField, isVisible = true, isVersioned = false]]
> 2007-09-24 21:55:13,890 DEBUG [wicket.Component] End render
> [MarkupContainer [Component id = lastName, page =
> org.openqabal.web.registration.UserRegistration1, path =
> 0:userForm:lastName.TextField, isVisible = true, isVersioned = false]]
> 2007-09-24 21:55:13,890 DEBUG [wicket.MarkupContainer] Rendering raw markup
> 2007-09-24 21:55:13,890 DEBUG [wicket.Component] Begin render
> [MarkupContainer [Component id = loginName, page =
> org.openqabal.web.registration.UserRegistration1, path =
> 0:userForm:loginName.TextField, isVisible = true, isVersioned = false]]
> 2007-09-24 21:55:13,890 DEBUG [wicket.model.AbstractDetachableModel]
> attaching
> Model:classname=[wicket.model.PropertyModel]:attached=false:nestedModel=[]:expression=[loginName]:propertyType=[null]
> for requestCycle [EMAIL PROTECTED] thread=http-0.0.0.0-8080-1]
> 2007-09-24 21:55:13,906 DEBUG [wicket.util.lang.PropertyResolver] Cannot
> find getter class wicket.util.value.ValueMap.loginName
> java.lang.NoSuchMethodException: wicket.util.value.ValueMap.isLoginName()
>         at java.lang.Class.getMethod(Class.java:1605)
>         at 
> wicket.util.lang.PropertyResolver.findGetter(PropertyResolver.java:387)
>         at
> wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:233)
>         at
> wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:200)
>         at 
> wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:88)
>         at
> wicket.model.AbstractPropertyModel.onGetObject(AbstractPropertyModel.java:132)
>         at
> wicket.model.AbstractDetachableModel.getObject(AbstractDetachableModel.java:104)
>         at wicket.Component.getModelObject(Component.java:990)
>         at wicket.Component.getModelObjectAsString(Component.java:1005)
>         at
> wicket.markup.html.form.FormComponent.getModelValue(FormComponent.java:975)
>         at 
> wicket.markup.html.form.FormComponent.getValue(FormComponent.java:583)
>         at 
> wicket.markup.html.form.TextField.onComponentTag(TextField.java:102)
>         at wicket.Component.renderComponent(Component.java:1688)
>         at wicket.MarkupContainer.onRender(MarkupContainer.java:927)
>         at wicket.Component.render(Component.java:1533)
>         at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334)
>         at 
> wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
>         at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:917)
>         at wicket.markup.html.form.Form.onComponentTagBody(Form.java:773)
>         at wicket.Component.renderComponent(Component.java:1719)
>         at wicket.MarkupContainer.onRender(MarkupContainer.java:927)
>         at wicket.markup.html.form.Form.onRender(Form.java:844)
>         at wicket.Component.render(Component.java:1533)
>         at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334)
>         at 
> wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
>         at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:917)
>         at wicket.Component.renderComponent(Component.java:1719)
>         at wicket.MarkupContainer.onRender(MarkupContainer.java:927)
>         at wicket.Component.render(Component.java:1533)
>         at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334)
>         at wicket.MarkupContainer.renderAll(MarkupContainer.java:944)
>         at wicket.Page.onRender(Page.java:864)
>         at wicket.Component.render(Component.java:1533)
>         at wicket.Page.renderPage(Page.java:413)
>         at
> wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:226)
>         at
> wicket.request.compound.DefaultResponseStrategy.respond(DefaultResponseStrategy.java:49)
>         at
> wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond(AbstractCompoundRequestCycleProcessor.java:66)
>         at 
> wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:902)
>         at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:929)
>         at wicket.RequestCycle.step(RequestCycle.java:1010)
>         at wicket.RequestCycle.steps(RequestCycle.java:1084)
>         at wicket.RequestCycle.request(RequestCycle.java:454)
>         at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at
> com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)
>         at
> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>         at
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
>         at
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>         at
> org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
>         at org.josso.tc55.agent.SSOAgentValve.invoke(SSOAgentValve.java:288)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>         at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>         at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>         at
> org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
>         at java.lang.Thread.run(Thread.java:619)
>
>
> *********** END LOG / STACKTRACE *******************************
>
>
>
> Thanks,
>
>
> Phil
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to