Not registered in the project

Hi,

So I wanted to integrate this project into mine. So I created the entities, screens etc. I hadn’t finished with that, but no error was, I left it half-finished.
My project still compiled and run.

But once I had to change my Java home to 1.7, cause of my other project. It was yesterday. Today my computer restarted and my Cuba Studio didn’t start, I got a Java Virtual Machine error: “Java exception has occured”. So I changed my Java home back to 1.8 and my Studio started.
But now when I open my project in Cuba Studio I get an Unexpected error:

[08:25:35.585] Unexpected error
java.lang.IllegalStateException: Data store _MAIN_ which is used by entity com.company.myproject.importer.entity.Importer is not registered in the project
[08:25:35.587] Exception has been thrown by com.haulmont.studio.backend.e.y@79927221:
[08:25:35.599] java.lang.IllegalStateException: Data store _MAIN_ which is used by entity com.company.myproject.importer.entity.Importer is not registered in the project

 at com.haulmont.studio.backend.e.y.a(SourceFile:476)
 at java.util.Optional.orElseThrow(Optional.java:290)
 at com.haulmont.studio.backend.e.y.j(SourceFile:475)
 at com.haulmont.studio.backend.e.y.d(SourceFile:157)
 at com.haulmont.studio.backend.e.y.a(SourceFile:138)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
 at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
 at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
 at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
 at com.google.common.eventbus.EventBus.post(EventBus.java:275)
 at com.haulmont.studio.backend.g.run(SourceFile:62)
 at com.haulmont.studio.ui.app.App.a(SourceFile:437)
 at com.vaadin.ui.UI.accessSynchronously(UI.java:1392)
 at com.haulmont.studio.ui.app.App.accessSynchronously(SourceFile:434)
 at com.haulmont.studio.ui.app.e.a(SourceFile:28)
 ...
[08:25:37.177] Ready

Any solution for that? I have no idea why I get this, and I did not find anything on the internet.

And my Importer class:

package com.company.myproject.importer.entity;

import javax.persistence.Entity;

import com.haulmont.chile.core.annotations.MetaProperty;
import com.haulmont.cuba.core.entity.AbstractNotPersistentEntity;
import com.haulmont.cuba.core.entity.BaseIntegerIdEntity;
import com.haulmont.chile.core.annotations.NamePattern;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Lob;

@Table(name = "MYPROJECT_IMPORTER")
@NamePattern("%s|beanName,description")
@Entity(name = "myproject$Importer")
public class Importer extends BaseIntegerIdEntity {
    private static final long serialVersionUID = -897086412421812185L;

    @Lob
    @Column(name = "BEAN_NAME", nullable = false)
    @MetaProperty(mandatory = true)
    protected String beanName;

    @Lob
    @Column(name = "DESCRIPTION")
    @MetaProperty
    protected String description;
    
    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    public String getBeanName() {
        return beanName;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

}

Thank you very much!

HI!

Thanks for reporting the issue. We will resolve it in the next release.

Workaround: in metadata.xml file for class tag with text ‘com.company.myproject.importer.entity.Importer’ remove the tag store.

1 Like