I encounter this problem and I can not manage to fix it since all configuration seems right: I´m in process to migrate my WebApp to Jmix 1.3.1, Build the app runs with no errors but when I want to Run/Debug it gives me this error:
**<<Exception Description: [class com.package.program.entity.DocumentoProveedor]**
**uses a non-entity [class com.haulmont.cuba.core.entity.FileDescriptor]**
**as target entity in the relationship attribute [field documento].>>**
The Java class “FileDescriptor” IT IS a @JmixEntity as you can see
I import FileDescriptor from:
//— *com.haulmont.cuba.core.entity.FileDescriptor;*
//—
My Java class “DocumentoProveedor”… same:
Here is where I use FileDescriptor
Persistance.xml was created succesfully with all Entities annotated.
Just in case is usefull I leave here the log of the error:
Looks like the Jmix module dependency tree is incorrect.
Watch the following message in the application log: Using Jmix modules: [io.jmix.core, ...]
It must contain com.haulmont.cuba and have your application module exactly in the end of the list.
Error creating bean with name ‘inventariosEntityManagerFactory’ defined in class path resource [com/albertosancheznieto/athia/InventariosStoreConfiguration.class]:
Invocation of init method failed; nested exception is javax.persistence.PersistenceException:
Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.7.9.6-jmix):
org.eclipse.persistence.exceptions.EntityManagerSetupExceptionDocumentoProveedor] uses a non-entity [class com.haulmont.cuba.core.entity.FileDescriptor] as target entity in the relationship attribute [field documento].
Unfortunately I don’t see anything that could cause the error with FileDescriptor. It’s correctly listed in persistence.xml.
Please attach the whole application log including the error stacktrace.
You are using an additional data store named inventarios, and it contains the DocumentoProveedor entity which has a reference to FileDescriptor. The problem is that FileDescriptor is an entity of the main data store, and entities from additional stores cannot reference it directly.
Hello again.
See… I´m gonna try to explain what the app does, because I think this functionality in Jmix is not available with FileDescriptor, notice me if I´m wrong…
I have MANY browsers which works with attached files, like e-mails, reports, invoices, logs, etc. some of this files are saved in the server so I can request them later or consult.
to be more specific… this is one of the problem I have
FileDescriptor is a deprecated entity that comes from the CUBA compatibility module.
Use FileRef attributes for referencing files in the file storage. See more info at Using File Storage :: Jmix Documentation
First of all, Thank you for the help.
I changed all FileDescriptor attributes with FileRef attributes. Now my WebApp compile and I can deploy it, even so I don´t know if entityies will work properly, I will keep you on touch
But why the documentation says?: cuba:cubaUpload ? this means that Jmix can still use FileDescriptors?