Migration problem


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:
My Java class “DocumentoProveedor”… same:
Here is where I use FileDescriptor
uso File Descriptor
Persistance.xml was created succesfully with all Entities annotated.

Just in case is usefull I leave here the log of the error:

Kind regards

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.

I apologize in advance because I´m realising that I may not be focusing on the root problem which could be this:

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 -
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].

The class where I´m trying to create the Bean:

I´m thinking that something happens with "DataSourceProperties inventariosDataSourceProperties() Method :confused:

PD: Using Jmix modules: [...] contain all needed modules

You didn’t confirm that your application module is exactly in the end of the list. Please check it.

Sorry, I didn´t attach the images.


Please attach the contents of your build.gradle and build/resources/main/<your-base-package>/persistence.xml

build.gradle (2.8 KB)
persistence.xml (10.6 KB)

Thank you very much for your attention.

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.

Log + Error.groovy (75.7 KB)

Here you have it,

Thanks, now the problem is clear.

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.

How did you come to this situation?

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?

Yes, if jmix-cuba compatibility module is included in the project. But only in the main data store, as I mentioned above.

1 Like