我尝试使用OpenXava文件构造型和嵌入式类并发现一个奇怪的错误。首先,如果我创建一个记录并将一堆文件附加到 之前 第一次保存它,一切正常。但是,如果我首先创建一个记录(Temple),将嵌入记录(库)中的所有内容留空,保存(成功保存,它说),然后返回编辑它,我得到以下消息:"无法执行添加文件操作:在模型Temple"
中找不到成员库。文档我无法通过谷歌找到任何有用的东西。
这是我在OpenXava库中出错或出错的原因。
我正在使用:OpenXava版本5.1.1 随附的Tomcat:Apache Tomcat版本7.0.50 Oracle 11g
这是我的圣殿和内部图书馆班级:
package org.openxava.zen.model;
import javax.persistence.*;
import org.openxava.annotations.*;
@Entity
public class Temple
{
@Id @Column(length=3) @GeneratedValue @ReadOnly
private int id;
@Version
private Integer version;
@Column(length=50)
private String name;
@Stereotype("IMAGES_GALLERY")
private String photos;
@Column
private String address;
@Embedded
private Library library;
@Embeddable
public static class Library
{
@Stereotype("FILES")
@Column(length=32)
private String documents;
public Admittance getAdmittance() {
return admittance;
}
public void setAdmittance(Admittance admittance) {
this.admittance = admittance;
}
@Column
private Admittance admittance;
public enum Admittance {MEMBERS_ONLY, COMMUNITY, EVERYONE};
public String getDocuments()
{
return documents;
}
public void setDocuments(String documents)
{
this.documents = documents;
}
}
public Library getLibrary() {
return library;
}
public void setLibrary(Library library) {
this.library = library;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhotos() {
return photos;
}
public void setPhotos(String photos) {
this.photos = photos;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}
完整的堆栈跟踪:
2014年12月1日下午4:09:46 org.directwebremoting.util.CommonsLoggingOutput info 信息:执行:Module.request() 2014年12月1日下午4:09:46 org.openxava.model.impl.MapFacadeBean验证 警告:警告!:Temple的成员库。文档未经过验证:输入unkown(属性,参考,集合) 2014年12月1日下午4:09:46 org.openxava.controller.ModuleManager manageRegularException 严重:模型Temple中找不到成员library.documents org.openxava.util.XavaException:在模型Temple中找不到成员库.documents at org.openxava.model.impl.MapFacadeBean.convertSubmapsInObject(MapFacadeBean.java:1675) 在org.openxava.model.impl.MapFacadeBean.setValues(MapFacadeBean.java:1337) 在org.openxava.model.impl.MapFacadeBean.setValues(MapFacadeBean.java:198) 在org.openxava.model.MapFacade.setValues(MapFacade.java:635) at org.openxava.actions.AddFileToFilesetAction.execute(AddFileToFilesetAction.java:27) 在org.openxava.controller.ModuleManager.executeAction(ModuleManager.java:493) 在org.openxava.controller.ModuleManager.executeAction(ModuleManager.java:401) 在org.openxava.controller.ModuleManager.execute(ModuleManager.java:358) 在org.apache.jsp.xava.execute_jsp._jspService(execute_jsp.java:196) 在org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:728) 在org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) 在org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) 在org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:728) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 在org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749) 在org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605) 在org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544) 在org.openxava.web.servlets.Servlets.getURIAsStream(Servlets.java:66) 在org.openxava.web.dwr.Module.getURIAsStream(Module.java:205) 在org.openxava.web.dwr.Module.request(Module.java:64) at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34) at org.directwebremoting.impl.DefaultRemoter $ 1.doFilter(DefaultRemoter.java:428) at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431) 在org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283) 在org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52) 在org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101) 在org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:647) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:728) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 在org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) 在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) 在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) 在org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) 在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409) 在org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044) at org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run(JIoEndpoint.java:315) 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615) 在java.lang.Thread.run(Thread.java:744)
答案 0 :(得分:0)
OpenXava论坛解决了这个问题: https://sourceforge.net/p/openxava/discussion/419690/thread/fde016f3/