FileDescriptor savedImageDescriptor = dataManager.commit(imageDescriptor);

FileDescriptor savedImageDescriptor = dataManager.commit(imageDescriptor);
报Caused by: com.haulmont.cuba.core.global.RemoteException: Unknown column ‘DTYPE’ in ‘field list’
前提imageDescriptor 不为空
image

方便的话贴出异常堆栈的关键部分

或者先尝试一下重新创建数据库或更新一下数据库

Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:153) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
… 38 common frames omitted
Caused by: com.vaadin.event.ListenerMethod$MethodException: Invocation of method uploadSucceeded in com.haulmont.cuba.web.gui.components.WebFileUploadField$$Lambda$477/1551710987 failed.
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:516) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:273) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:237) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1041) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
at com.haulmont.cuba.web.widgets.CubaFileUpload.fireUploadSuccess(CubaFileUpload.java:484) ~[cuba-web-widgets-7.0.5.jar:na]
at com.haulmont.cuba.web.widgets.CubaFileUpload$1.fileUploaded(CubaFileUpload.java:72) ~[cuba-web-widgets-7.0.5.jar:na]
… 43 common frames omitted
Caused by: com.haulmont.cuba.core.global.RemoteException: Unknown column ‘DTYPE’ in ‘field list’
at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:129) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644) ~[spring-aop-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633) ~[spring-aop-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) ~[spring-aop-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) ~[spring-aop-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93) ~[spring-aop-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at com.sun.proxy.$Proxy196.commit(Unknown Source) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
at com.haulmont.cuba.core.sys.remoting.LocalServiceInvokerImpl.invoke(LocalServiceInvokerImpl.java:94) ~[na:na]
at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.invoke(LocalServiceProxy.java:154) ~[cuba-web-7.0.5.jar:7.0.5]
at com.sun.proxy.$Proxy35.commit(Unknown Source) ~[na:na]
at com.haulmont.cuba.client.sys.DataManagerClientImpl.commit(DataManagerClientImpl.java:100) ~[cuba-client-7.0.5.jar:7.0.5]
at com.haulmont.cuba.client.sys.DataManagerClientImpl.commit(DataManagerClientImpl.java:105) ~[cuba-client-7.0.5.jar:7.0.5]
at com.haulmont.cuba.client.sys.DataManagerClientImpl.commit(DataManagerClientImpl.java:128) ~[cuba-client-7.0.5.jar:7.0.5]
at com.company.edyj.web.screens.opticalaccount.OpticalAccountEdit.onUploadFileUploadSucceed(OpticalAccountEdit.java:139) ~[app-web-0.1-SNAPSHOT.jar:na]
at com.haulmont.bali.events.EventHub.publish(EventHub.java:170) ~[cuba-global-7.0.5.jar:7.0.5]
at com.haulmont.cuba.web.gui.components.WebAbstractComponent.publish(WebAbstractComponent.java:88) ~[cuba-web-7.0.5.jar:7.0.5]
at com.haulmont.cuba.web.gui.components.WebFileUploadField.fireFileUploadSucceed(WebFileUploadField.java:415) ~[cuba-web-7.0.5.jar:7.0.5]
at com.haulmont.cuba.web.gui.components.WebFileUploadField.lambda$initUploadButton$510c8040$1(WebFileUploadField.java:244) ~[cuba-web-7.0.5.jar:7.0.5]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:496) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
… 48 common frames omitted
08:40:01.230 WARN c.h.c.web.sys.CubaApplicationServlet - Too long request processing [9320 ms]: ip=0:0:0:0:0:0:0:1, url=/app/UIDL/

dataManager.commit(FileDescriptor imageDescriptor)执行的时候提示DTYPE异常,FileDescriptor类没有TYPE属性,表里也没有这个属性,这是啥原因

DTYPE这个属性只有在扩展了cuba的实体会出现,看下你的代码是不是扩展了FileDescriptor,如果是,检查数据库、实体扩展步骤对不对,扩展了以后persistence.xml改了没。

扩展以后,cuba会生成类似下面的数据库脚本,你需要更新到数据库上。

alter table sys_file add column DTYPE varchar(100);

update sys_file set DTYPE = 'yourproject$FileDescriptor' where DTYPE is null;

那你再用数据库工具看看数据库里的表定义

没有扩展FileDescriptor
image