Migrating to CUBA 7 Error

Hello,

I’m trying to migrate my project to CUBA 7;
When i’m trying to run the solution, I get an error in catalina.out:

19:21:46.704 INFO  c.h.cuba.core.sys.AppComponents         - Using app components: [com.haulmont.cuba, com.haulmont.fts, com.haulmont.bpm, net.kprism.scope.foundation]
19:21:46.744 INFO  c.h.c.c.s.AbstractWebAppContextLoader   - Loading app properties from classpath:net/kprism/scope/fb/app.properties
19:21:46.866 INFO  c.h.cuba.core.sys.AppContextLoader      - DbmsType of the main database is set to postgres
19:21:46.913 ERROR c.h.c.c.s.AbstractWebAppContextLoader   - Error initializing application
java.lang.SecurityException: class "javax.persistence.Index"'s signer information does not match signer information of other classes in the same package
	at java.lang.ClassLoader.checkCerts(ClassLoader.java:898) ~[na:1.8.0_121]
	at java.lang.ClassLoader.preDefineClass(ClassLoader.java:668) ~[na:1.8.0_121]
	at java.lang.ClassLoader.defineClass(ClassLoader.java:761) ~[na:1.8.0_121]
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_121]
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_121]
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_121]
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_121]
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_121]
	at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_121]
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_121]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_121]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_121]
	at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_121]
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_121]
	at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_121]
	at sun.reflect.annotation.AnnotationType$1.run(AnnotationType.java:112) ~[na:1.8.0_121]
	at sun.reflect.annotation.AnnotationType$1.run(AnnotationType.java:109) ~[na:1.8.0_121]
	at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_121]
	at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:109) ~[na:1.8.0_121]
	at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:85) ~[na:1.8.0_121]
	at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:266) ~[na:1.8.0_121]
	at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120) ~[na:1.8.0_121]
	at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72) ~[na:1.8.0_121]
	at java.lang.Class.createAnnotationData(Class.java:3521) ~[na:1.8.0_121]
	at java.lang.Class.annotationData(Class.java:3510) ~[na:1.8.0_121]
	at java.lang.Class.getAnnotation(Class.java:3415) ~[na:1.8.0_121]
	at com.haulmont.cuba.core.sys.persistence.PersistenceConfigProcessor.addClasses(PersistenceConfigProcessor.java:190) ~[cuba-core-7.0.1.jar:7.0.1]
	at com.haulmont.cuba.core.sys.persistence.PersistenceConfigProcessor.create(PersistenceConfigProcessor.java:87) ~[cuba-core-7.0.1.jar:7.0.1]
	at com.haulmont.cuba.core.sys.AppContextLoader.createPersistenceXml(AppContextLoader.java:69) ~[cuba-core-7.0.1.jar:7.0.1]
	at java.util.ArrayList.forEach(ArrayList.java:1249) ~[na:1.8.0_121]
	at com.haulmont.cuba.core.sys.AppContextLoader.beforeInitAppContext(AppContextLoader.java:84) ~[cuba-core-7.0.1.jar:7.0.1]
	at com.haulmont.cuba.core.sys.AbstractWebAppContextLoader.contextInitialized(AbstractWebAppContextLoader.java:76) ~[cuba-global-7.0.1.jar:7.0.1]
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792) [catalina.jar:8.5.33]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256) [catalina.jar:8.5.33]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.5.33]
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754) [catalina.jar:8.5.33]
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730) [catalina.jar:8.5.33]
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) [catalina.jar:8.5.33]
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1140) [catalina.jar:8.5.33]
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875) [catalina.jar:8.5.33]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_121]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]

Any idea?

Thanks,
-c

Hi,

Will the error occur on a sample project? testindex.zip (77.0 KB)
I’ve created a project with Index annotation on entity. It works for me. Could you try to run this sample project.

Hello,

The sample project you attached works just fine.
On my project, I use @Index annotation on a single entity:

    @PrimaryKeyJoinColumn(name = "ID", referencedColumnName = "ID")
    @DiscriminatorValue("FB_RET_PROD")
    @Table(name = "FB_RETAIL_PRODUCT", indexes = {
            @Index(name = "IDX_FB_RETAIL_PRODUCT_UPC", columnList = "UPC")
    })
    @Entity(name = "fb$RetailProduct")
    public class RetailProduct extends Product { ... }

I removed it, updated the db also (drop index …) but I still get the same error.

Thanks for your time anyway :slight_smile:
-c

Could you provide list of files from tomcat/shared/lib directory?
Perhaps, directory contains any obsolete library.

https://wetransfer.com/downloads/21a18a6c79b0b8ec43574dfe33fb506220190221115913/ebbd53046e09ff36c50c8b9d34646f6220190221115913/a8f624

Project contains two different versions of EclipseLink library: old eclipselink-2.6.2.cuba24 and new org.eclipse.persistence.jpa-2.7.3-1-cuba

Please execute gradlew :app-core:dependencies and attach to the topic output of the command.

Also, try to remove tomcat directory and start application using CUBA Studio.
If that doesn’t work, check that application component net.kprism.scope.foundation uses platform version 7.0.*. I’ve found app component in the error log. Perhaps, application uses old platform and old version of EclipseLink.