gpt4 book ai didi

wicket - 有问题的 Wicket RuntimeException

转载 作者:行者123 更新时间:2023-12-02 08:54:11 29 4
gpt4 key购买 nike

我无法确定 Wicket 应用程序中 RuntimeException 的原因。我设置了许多断点,但是当我提交表单时,只有在加载表单时,没有一个断点被触发。这是堆栈:

WicketMessage: No get method defined for class: class this.is.my.class.WicketDocumentModel expression: DocumentUpload

Root cause:

org.apache.wicket.WicketRuntimeException: No get method defined for class: class this.is.my.class.WicketDocumentModel expression: DocumentUploadat org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:445)at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:287)at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:90)at org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:117)at org.apache.wicket.Component.getDefaultModelObject(Component.java:1664)at org.apache.wicket.Component$3.compare(Component.java:548)at org.apache.wicket.Component.setDefaultModelObject(Component.java:3049)at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1168)at org.apache.wicket.markup.html.form.upload.FileUploadField.updateModel(FileUploadField.java:100)at org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:225)at org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:514)at org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:493)at org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrder(FormComponent.java:465)at org.apache.wicket.markup.html.form.Form.internalUpdateFormComponentModels(Form.java:2051)at org.apache.wicket.markup.html.form.Form.updateFormComponentModels(Form.java:2019)at org.apache.wicket.markup.html.form.Form.process(Form.java:984)at org.apache.wicket.markup.html.form.Form.process(Form.java:911)at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:876)at java.lang.reflect.Method.invoke(Method.java:597)at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182)at org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73)at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)at java.lang.Thread.run(Thread.java:619)

我确实找到了有关类似问题 here 的讨论,但我还没有完全能够将那里提出的建议转化为适合我的情况的解决方案。我的类不包含名为 DocumentUpload 的 Java 变量,但包含以下内容:

fuf = new FileUploadField("DocumentUpload");

最佳答案

我在这个问题上花了几个小时,在我向 SO 发布有关此问题的信息后 20 分钟,我再次解决了这个问题。解决方法是将上传字段声明转换为提供模型的声明,如下所示:

fuf = new FileUploadField("DocumentUpload", new Model<FileUpload>());

编辑:事实证明这与 1.3 -> 1.4 迁移有关。根据 migration guide ,

FileUploadField - now requires model

The FileUploadField now REQUIRES a model. This means that if you previously used the ID-only >constructor (i.e. new FileUploadField("myFileField")), you will need to change it to include >a model (i.e. new FileUploadField("myFileField", new Model())).

关于wicket - 有问题的 Wicket RuntimeException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1792310/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com