glassfish
  1. glassfish
  2. GLASSFISH-19316

Eclipselink 2.5 fails to parse JPQL query involving embedded maps

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 4.0_b63
    • Fix Version/s: 4.0_b72_EE7MS4
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Nightly build glassfish-4.0-b63-11_09_2012

      Description

      Deployment of entity with named query that accesses @ElementCollection Map fails with NullPointerException originating in EclipseLink query parser code. I will also report this to Eclipselink, but from Glassfish point of view this is breaking compatibility with JPA 2.0, as attached code works with 3.1.2.

      Code for reproducing bug is attached.

      [#|2012-11-10T15:15:15.928+0100|SEVERE|44.0|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=56;_ThreadName=admin-listener(1);_TimeMillis=1352556915928;_LevelValue=1000;|Exception while preparing the app : Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.5.0.v20121016-ab08992): org.eclipse.persistence.exceptions.EntityManagerSetupException
      Exception Description: Deployment of PersistenceUnit [testpu] failed. Close all factories for this PersistenceUnit.
      Internal Exception: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.5.0.v20121016-ab08992): org.eclipse.persistence.exceptions.JPQLException
      Exception Description: Internal problem encountered while compiling [select c from Charger c join c.locationAttributes cc where key(cc) = :attrKey and value(cc) = :attrValue].
      Internal Exception: java.lang.NullPointerException
      Local Exception Stack: 
      Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.5.0.v20121016-ab08992): org.eclipse.persistence.exceptions.EntityManagerSetupException
      Exception Description: Deployment of PersistenceUnit [testpu] failed. Close all factories for this PersistenceUnit.
      Internal Exception: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.5.0.v20121016-ab08992): org.eclipse.persistence.exceptions.JPQLException
      Exception Description: Internal problem encountered while compiling [select c from Charger c join c.locationAttributes cc where key(cc) = :attrKey and value(cc) = :attrValue].
      Internal Exception: java.lang.NullPointerException
      	at org.eclipse.persistence.exceptions.EntityManagerSetupException.deployFailed(EntityManagerSetupException.java:229)
      	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createDeployFailedPersistenceException(EntityManagerSetupImpl.java:713)
      	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:653)
      	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:197)
      	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:289)
      	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:305)
      	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:283)
      	at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:211)
      	at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:120)
      	at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:221)
      	at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:492)
      	at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)
      	at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:165)
      	at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:932)
      	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:441)
      	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:229)
      	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:489)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javax.security.auth.Subject.doAs(Subject.java:356)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:565)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1448)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:119)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1758)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1708)
      	at org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:487)
      	at org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.java:255)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at org.glassfish.jersey.server.model.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:80)
      	at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:107)
      	at org.glassfish.jersey.server.model.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:146)
      	at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:80)
      	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:354)
      	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:349)
      	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:97)
      	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:204)
      	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:316)
      	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:180)
      	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:796)
      	at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:306)
      	at org.glassfish.admin.rest.adapter.RestAdapter$1.service(RestAdapter.java:327)
      	at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:189)
      	at com.sun.enterprise.v3.server.HK2Dispatcher.dispatch(HK2Dispatcher.java:113)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:236)
      	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:175)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:781)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:578)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:558)
      	at java.lang.Thread.run(Thread.java:722)
      Caused by: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.5.0.v20121016-ab08992): org.eclipse.persistence.exceptions.JPQLException
      Exception Description: Internal problem encountered while compiling [select c from Charger c join c.locationAttributes cc where key(cc) = :attrKey and value(cc) = :attrValue].
      Internal Exception: java.lang.NullPointerException
      	at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildUnexpectedException(HermesParser.java:201)
      	at org.eclipse.persistence.internal.jpa.jpql.HermesParser.populateQueryImp(HermesParser.java:290)
      	at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildQuery(HermesParser.java:157)
      	at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:138)
      	at org.eclipse.persistence.internal.jpa.JPAQuery.processJPQLQuery(JPAQuery.java:200)
      	at org.eclipse.persistence.internal.jpa.JPAQuery.prepare(JPAQuery.java:163)
      	at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:616)
      	at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:577)
      	at org.eclipse.persistence.internal.sessions.AbstractSession.processJPAQueries(AbstractSession.java:2320)
      	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:470)
      	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:707)
      	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:652)
      	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:215)
      	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:599)
      	... 62 more
      Caused by: java.lang.NullPointerException
      	at org.eclipse.persistence.internal.jpa.jpql.TypeResolver.visit(TypeResolver.java:1435)
      	at org.eclipse.persistence.jpa.jpql.parser.ValueExpression.accept(ValueExpression.java:42)
      	at org.eclipse.persistence.internal.jpa.jpql.TypeResolver.resolve(TypeResolver.java:399)
      	at org.eclipse.persistence.internal.jpa.jpql.JPQLQueryContext.getType(JPQLQueryContext.java:799)
      	at org.eclipse.persistence.internal.jpa.jpql.ParameterTypeVisitor.getType(ParameterType.java:165)
      	at org.eclipse.persistence.internal.jpa.jpql.JPQLQueryContext.getParameterType(JPQLQueryContext.java:743)
      	at org.eclipse.persistence.internal.jpa.jpql.ExpressionBuilderVisitor.visit(ExpressionBuilderVisitor.java:1270)
      	at org.eclipse.persistence.jpa.jpql.parser.InputParameter.accept(InputParameter.java:44)
      	at org.eclipse.persistence.internal.jpa.jpql.ExpressionBuilderVisitor.visit(ExpressionBuilderVisitor.java:732)
      	at org.eclipse.persistence.jpa.jpql.parser.ComparisonExpression.accept(ComparisonExpression.java:71)
      	at org.eclipse.persistence.internal.jpa.jpql.ExpressionBuilderVisitor.visit(ExpressionBuilderVisitor.java:485)
      	at org.eclipse.persistence.jpa.jpql.parser.AndExpression.accept(AndExpression.java:61)
      	at org.eclipse.persistence.internal.jpa.jpql.ExpressionBuilderVisitor.visit(ExpressionBuilderVisitor.java:2106)
      	at org.eclipse.persistence.jpa.jpql.parser.WhereClause.accept(WhereClause.java:59)
      	at org.eclipse.persistence.internal.jpa.jpql.ExpressionBuilderVisitor.buildExpression(ExpressionBuilderVisitor.java:269)
      	at org.eclipse.persistence.internal.jpa.jpql.JPQLQueryContext.buildExpression(JPQLQueryContext.java:326)
      	at org.eclipse.persistence.internal.jpa.jpql.AbstractObjectLevelReadQueryVisitor.visit(AbstractObjectLevelReadQueryVisitor.java:278)
      	at org.eclipse.persistence.jpa.jpql.parser.WhereClause.accept(WhereClause.java:59)
      	at org.eclipse.persistence.internal.jpa.jpql.AbstractObjectLevelReadQueryVisitor.visitAbstractSelectStatement(AbstractObjectLevelReadQueryVisitor.java:344)
      	at org.eclipse.persistence.internal.jpa.jpql.AbstractObjectLevelReadQueryVisitor.visit(AbstractObjectLevelReadQueryVisitor.java:197)
      	at org.eclipse.persistence.jpa.jpql.parser.SelectStatement.accept(SelectStatement.java:115)
      	at org.eclipse.persistence.internal.jpa.jpql.HermesParser$DatabaseQueryVisitor.visit(HermesParser.java:433)
      	at org.eclipse.persistence.jpa.jpql.parser.SelectStatement.accept(SelectStatement.java:115)
      	at org.eclipse.persistence.internal.jpa.jpql.HermesParser$DatabaseQueryVisitor.visit(HermesParser.java:413)
      	at org.eclipse.persistence.jpa.jpql.parser.JPQLExpression.accept(JPQLExpression.java:136)
      	at org.eclipse.persistence.internal.jpa.jpql.HermesParser.populateQueryImp(HermesParser.java:276)
      	... 74 more
      
      

        Activity

        Hide
        pdudits added a comment -

        Eclipselink Bugzilla issue 394033

        Show
        pdudits added a comment - Eclipselink Bugzilla issue 394033
        Hide
        Hong Zhang added a comment -

        assign to mitesh for evaluation

        Show
        Hong Zhang added a comment - assign to mitesh for evaluation
        Hide
        pdudits added a comment - - edited

        Issue has been fixed upstream today, so upgrade of eclipselink will likely resolve it.

        Show
        pdudits added a comment - - edited Issue has been fixed upstream today, so upgrade of eclipselink will likely resolve it.
        Hide
        Mitesh Meswani added a comment -

        Marking as fixed with new EclipseLink integration

        Show
        Mitesh Meswani added a comment - Marking as fixed with new EclipseLink integration
        Hide
        pdudits added a comment -

        The bug is still present in b87. Will create another issue for that.

        Show
        pdudits added a comment - The bug is still present in b87. Will create another issue for that.

          People

          • Assignee:
            Mitesh Meswani
            Reporter:
            pdudits
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: