Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The class does not have a descriptor, or a descriptor that does not use inheritance or uses a ClassExtractor for inheritance #966

Closed
Quix0r opened this issue Jul 29, 2016 · 21 comments
Assignees
Labels
PR: TESTS REQUIRED PR Requires Tests to be merged

Comments

@Quix0r
Copy link

Quix0r commented Jul 29, 2016

Severity: Blocker (see reason below)
Reproduceable: Always

This message comes with following JPQL:
SELECT c FROM AbstractFoo AS c WHERE TYPE(c) IN :types
The class is annotated with:

@Entity
@Inheritance (strategy = InheritanceType.TABLE_PER_CLASS)
@NamedQueries (
{
// Some named queries
}
)
public abstract AbstractFoo implements Fooable {
// Some properties + equals()/hashCode() methods
}

Sadly I cannot simply switch to any other inheritance type as the table design is given (I write a JavaEE application for an existing database).
Then many other concrete classes expands it:

@Entity (name = "Some_000123_Foo")
@Table (name = "Some_000123_Foo")
@SuppressWarnings ("PersistenceUnitPresent")
public class SomeFooier extends AbstractFoo {

    /**
     * Serial number
     */
    @Transient
    private static final long serialVersionUID = 15_868_174_390L;

}

And tons more of these. As you can see, I try to minimize my code base, else I would have been required to duplicate all the entity properties to all concrete classes.

I already use Payara 162.

An excerpt from the backtrace:

Exception Description: Invalid Type Expression on [com.example.project.model.foo.AbstractFoo].  The class does not have a descriptor, or a descriptor that does not use inheritance or uses a ClassExtractor for inheritance
    at org.eclipse.persistence.exceptions.QueryException.invalidTypeExpression(QueryException.java:763)
    at org.eclipse.persistence.internal.expressions.ClassTypeExpression.validateNode(ClassTypeExpression.java:100)
    at org.eclipse.persistence.expressions.Expression.normalize(Expression.java:3291)
    at org.eclipse.persistence.internal.expressions.DataExpression.normalize(DataExpression.java:369)
    at org.eclipse.persistence.internal.expressions.CompoundExpression.normalize(CompoundExpression.java:224)
    at org.eclipse.persistence.internal.expressions.RelationExpression.normalize(RelationExpression.java:574)
    at org.eclipse.persistence.internal.expressions.SQLSelectStatement.normalize(SQLSelectStatement.java:1474)
    at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.buildNormalSelectStatement(ExpressionQueryMechanism.java:550)
    at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.prepareSelectAllRows(ExpressionQueryMechanism.java:1722)
    at org.eclipse.persistence.queries.ReadAllQuery.prepareSelectAllRows(ReadAllQuery.java:885)
    at org.eclipse.persistence.queries.ReadAllQuery.prepare(ReadAllQuery.java:816)
    at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:666)
    at org.eclipse.persistence.queries.ObjectLevelReadQuery.checkPrepare(ObjectLevelReadQuery.java:911)
    at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:615)
    at org.eclipse.persistence.internal.jpa.QueryImpl.getDatabaseQueryInternal(QueryImpl.java:342)
    at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createNamedQuery(EntityManagerImpl.java:1135)
    at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createNamedQuery(EntityManagerImpl.java:1155)
    at com.sun.enterprise.container.common.impl.EntityManagerWrapper.createNamedQuery(EntityManagerWrapper.java:537)
    at com.example.project.model.foo.ReportsCustomerSessionBean.fetchSelectedCustomerStatistics(ReportsCustomerSessionBean.java:179)
    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 org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
    at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
    at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4789)
    at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:656)
    at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
    at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)
    at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
    at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
    at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
    at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
    at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
    at sun.reflect.GeneratedMethodAccessor277.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
    at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
    at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4761)
    at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4749)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:205)
    at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:79)
    at com.sun.proxy.$Proxy354.fetchSelectedCustomerStatistics(Unknown Source)
    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.sun.corba.ee.impl.presentation.rmi.ReflectiveTie.dispatchToMethod(ReflectiveTie.java:143)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:173)
    at com.sun.corba.ee.impl.protocol.ServerRequestDispatcherImpl.dispatchToServant(ServerRequestDispatcherImpl.java:528)
    at com.sun.corba.ee.impl.protocol.ServerRequestDispatcherImpl.dispatch(ServerRequestDispatcherImpl.java:199)
    at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequestRequest(MessageMediatorImpl.java:1549)
    at com.sun.corba.ee.impl.protocol.SharedCDRClientRequestDispatcherImpl.marshalingComplete(SharedCDRClientRequestDispatcherImpl.java:119)
    at com.sun.corba.ee.impl.protocol.ClientDelegateImpl.invoke(ClientDelegateImpl.java:258)
    at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:198)
    at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:150)
    at com.sun.corba.ee.impl.presentation.rmi.codegen.CodegenStubBase.invoke(CodegenStubBase.java:226)
@Quix0r Quix0r changed the title menu The class does not have a descriptor, or a descriptor that does not use inheritance or uses a ClassExtractor for inheritance The class does not have a descriptor, or a descriptor that does not use inheritance or uses a ClassExtractor for inheritance Jul 29, 2016
@Quix0r
Copy link
Author

Quix0r commented Aug 10, 2016

Bump, because it is always reproduceable and is a blocker (I cannot change database layout).

@mikecroft
Copy link
Contributor

Hi, sorry for the delay! We haven't forgotten about this issue, we're just in a particularly busy time of the year at the moment. Do you have a simple reproducer we could use to help speed things up?

@Quix0r
Copy link
Author

Quix0r commented Aug 15, 2016

Okay, maybe I can write some, my posting may contain a basic one. Just add a few properties (class fields) to the abstract POJO and let it persist. Then implement an EJB with a named query with TYPE(someAliasOrBean) = :somePlaceholder and you should get the same message.

Oh, I have one more (other) bug in the pipeline.

@mikecroft
Copy link
Contributor

Thanks, that would be a huge help!

@Quix0r
Copy link
Author

Quix0r commented Aug 16, 2016

Sorry, running out of hands here.

@Quix0r
Copy link
Author

Quix0r commented Aug 23, 2016

As I said above, it is some easy to reproduce:

  1. Take my example above and make to a real entity/class (compileable and with at least 1-2 properties/class fields with public getter/setter)
  2. Try to let the JPA create them in a database.
  3. Run the named query on it with that said TYPE statement

Sorry, I have so much to do here, I cannot write a test case for you here.

@mikecroft
Copy link
Contributor

OK, no problem, we'll do our best to move it forward as quick as we can

@Quix0r
Copy link
Author

Quix0r commented Aug 26, 2016

Thank you, very much.

@Quix0r
Copy link
Author

Quix0r commented Sep 3, 2016

Sorry to say but this is getting urgent. :-(

@lprimak
Copy link
Contributor

lprimak commented Sep 3, 2016

@Quix0r Did you by any chance raise this issue with EclipseLink team?
At first glance, this seems to be an issue with EclipseLink

@mikecroft
Copy link
Contributor

Sorry it's taken a while @Quix0r. We are, unfortunately, unable to give any guarantees or SLAs on issues raised via GitHub, since we always have to prioritise work for paying customers (we couldn't fund any work if we didn't!). If you get in touch with us, we can give you some details on pricing for a support contract where you would get SLAs on tickets and access to our customer-only patch releases so, once an issue has been fixed and merged into the codebase, you wouldn't have to wait more than a month to get a supported build (as opposed to only getting releases once a quarter normally).

@mikecroft mikecroft added the PR: TESTS REQUIRED PR Requires Tests to be merged label Sep 5, 2016
@Quix0r
Copy link
Author

Quix0r commented Sep 5, 2016

@lprimak Okay, I can report it there and link to here. :-)
@mikecroft I understand this.

Maybe worth updating EclipseLink to latest (2.6.3 on download page versus 2.6 in Payara) version? And what we talking about? Do I have to wait a month or year to have this fixed? And maybe I'm not the only one with this bug around. Sadly you cannot easily switch to e.g. Hibernate with Payara/GF because it simply doesn't work. Also switching to WildFly is not painless. :-(

@mikecroft
Copy link
Contributor

mikecroft commented Sep 5, 2016

The next public release will be the 2016 Q4 (164) release, which is currently targeted to early November. The version of Eclipselink in Payara is a patched 2.6.2.

If the bug is in Eclipselink like @lprimak says, then let us know on this ticket and we will get it into the next public release as soon as it's made available by Eclipselink.

@smillidge
Copy link
Contributor

Have you thought about dropping down into Native SQL to execute the query you wanted?

@Quix0r
Copy link
Author

Quix0r commented Sep 7, 2016

No, the query runs over more than one table and cannot be joined.

@smillidge
Copy link
Contributor

You would need to use a Union.

@OndroMih
Copy link
Contributor

@Quix0r, can you try if Payara 164 fixes the behavior?
We haven't had the time to create the testing app to reproduce.

If it is not fixed, I recommend to try with Hibernate - you can bundle it in your application as suggested here: How To configure Hibernate as a JPA provider

@mikecroft
Copy link
Contributor

@Quix0r Payara 171 is now available, can you try to reproduce with the latest version?

@Quix0r
Copy link
Author

Quix0r commented Mar 24, 2017

Okay, had not been developing JavaEE recently. Will try to reproduce with it.

@mikecroft
Copy link
Contributor

Is this still an issue @Quix0r?

@Quix0r
Copy link
Author

Quix0r commented Mar 29, 2018

Sorry, no longer employed with them. Still a strange database layout (even the main administrator said that!). So never mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: TESTS REQUIRED PR Requires Tests to be merged
Projects
None yet
Development

No branches or pull requests

6 participants