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

IllegalAccessError when JPQL has embeddable or relational attributes without the optional entity identification variable #30351

Open
njr-11 opened this issue Dec 5, 2024 · 1 comment
Labels
bug This bug is not present in a released version of Open Liberty in:JPA team:Blizzard

Comments

@njr-11
Copy link
Contributor

njr-11 commented Dec 5, 2024

After applying the fix for #28931 , JPQL queries with embeddable (or relation) attributes that omit the optional entity identification variable (for consistency with JDQL) get java.lang.IllegalAccessError from EclipseLink.

Example query:

FROM Business WHERE location.address.city=?1 ORDER BY name

Here is the exception stack with java.lang.IllegalAccessError:

[12/5/24, 10:39:18:070 CST] 00000053 id=5758a7a4 io.openliberty.data.internal.persistence.QueryInfo           < withJPQL Exit  
                                                                                                               QueryInfo@7d25aa13 jakarta.data.page.Page<test.jakarta.data.jpa.web.Business> locatedIn(String, PageRequest, Order)  FROM Business WHERE location.address.city=?1 ORDER BY name [1 positional params]
[12/5/24, 10:39:18:092 CST] 00000053 id=00000000 io.openliberty.data.internal.persistence.PageImpl            > <init> Entry  
                                                                                                               QueryInfo@7d25aa13 jakarta.data.page.Page<test.jakarta.data.jpa.web.Business> locatedIn(String, PageRequest, Order)  FROM Business WHERE location.address.city=?1 ORDER BY name [1 positional params]
                                                                                                               PageRequest{page=1, size=6, mode=OFFSET}
                                                                                                               Rochester
                                                                                                               PageRequest{page=1, size=6, mode=OFFSET}
                                                                                                               [Sort[property=name, isAscending=true, ignoreCase=false]]
[12/5/24, 10:39:18:092 CST] 00000053 id=0eae572c enliberty.data.internal.persistence.service.DBStoreEMBuilder > createEntityManager Entry 
[12/5/24, 10:39:18:092 CST] 00000053 id=385c8ca3 om.ibm.wsspi.persistence.internal.PersistenceServiceUnitImpl > createEntityManager Entry 
[12/5/24, 10:39:18:092 CST] 00000053 id=385c8ca3 om.ibm.wsspi.persistence.internal.PersistenceServiceUnitImpl < createEntityManager Exit  
                                                                                                               org.eclipse.persistence.internal.jpa.EntityManagerImpl@1a9ffd85
[12/5/24, 10:39:18:092 CST] 00000053 id=0eae572c enliberty.data.internal.persistence.service.DBStoreEMBuilder < createEntityManager Exit  
                                                                                                               org.eclipse.persistence.internal.jpa.EntityManagerImpl@1a9ffd85
[12/5/24, 10:39:18:094 CST] 00000053 id=4c08ef1b io.openliberty.data.internal.persistence.RepositoryImpl      < invoke MixedRepository.locatedIn Exit  
                                                                                                               java.lang.IllegalAccessError: class org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator tried to access protected method 'void org.eclipse.persistence.jpa.jpql.parser.AbstractPathExpression.setVirtualIdentificationVariable(java.lang.String)' (org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator and org.eclipse.persistence.jpa.jpql.parser.AbstractPathExpression are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @395e6823)
	at org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator.validateStateFieldPathExpression(AbstractSemanticValidator.java:2430)
	at org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator$ComparisonExpressionVisitor.visit(AbstractSemanticValidator.java:3404)
	at org.eclipse.persistence.jpa.jpql.parser.StateFieldPathExpression.accept(StateFieldPathExpression.java:77)
	at org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator.validateComparisonExpression(AbstractSemanticValidator.java:1055)
	at org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator.visit(AbstractSemanticValidator.java:2903)
	at org.eclipse.persistence.jpa.jpql.parser.ComparisonExpression.accept(ComparisonExpression.java:71)
	at org.eclipse.persistence.jpa.jpql.parser.AbstractConditionalClause.acceptChildren(AbstractConditionalClause.java:72)
	at org.eclipse.persistence.jpa.jpql.AbstractValidator.visit(AbstractValidator.java:752)
	at org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor.visit(AnonymousExpressionVisitor.java:551)
	at org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator.validateWhereClause(AbstractSemanticValidator.java:2776)
	at org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator.visit(AbstractSemanticValidator.java:3276)
	at org.eclipse.persistence.jpa.jpql.parser.WhereClause.accept(WhereClause.java:56)
	at org.eclipse.persistence.jpa.jpql.parser.AbstractSelectStatement.acceptChildren(AbstractSelectStatement.java:94)
	at org.eclipse.persistence.jpa.jpql.parser.SelectStatement.acceptChildren(SelectStatement.java:105)
	at org.eclipse.persistence.jpa.jpql.AbstractValidator.visit(AbstractValidator.java:752)
	at org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor.visit(AnonymousExpressionVisitor.java:436)
	at org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator.validateSelectStatement(AbstractSemanticValidator.java:2253)
	at org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator.visit(AbstractSemanticValidator.java:3154)
	at org.eclipse.persistence.jpa.jpql.parser.SelectStatement.accept(SelectStatement.java:100)
	at org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator.visit(AbstractSemanticValidator.java:3025)
	at org.eclipse.persistence.jpa.jpql.parser.JPQLExpression.accept(JPQLExpression.java:203)
	at org.eclipse.persistence.internal.jpa.jpql.HermesParser.validate(HermesParser.java:361)
	at org.eclipse.persistence.internal.jpa.jpql.HermesParser.populateQueryImp(HermesParser.java:298)
	at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildQuery(HermesParser.java:180)
	at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:144)
	at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:120)
	at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:107)
	at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:91)
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1846)
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1869)
	at io.openliberty.data.internal.persistence.PageImpl.<init>(PageImpl.java:63)
	at io.openliberty.data.internal.persistence.RepositoryImpl.invoke(RepositoryImpl.java:692)
	at jdk.proxy9/jdk.proxy9.$Proxy81.locatedIn(Unknown Source)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:38)
	at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:109)
	at test.jakarta.data.jpa.web.MixedRepository$1687930109$Proxy$_$$_WeldClientProxy.locatedIn(Unknown Source)
	at test.jakarta.data.jpa.web.DataJPATestServlet.testCountQueryWithFromAndWhereClausesOnly(DataJPATestServlet.java:680)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at componenttest.app.FATServlet.doGet(FATServlet.java:74)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:633)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:723)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1266)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:754)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:451)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1362)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:5096)
	at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:328)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1047)
	at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:293)
	at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:1260)
	at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:476)
	at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:435)
	at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:569)
	at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:503)
	at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:363)
	at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:330)
	at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:169)
	at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:77)
	at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:516)
	at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:586)
	at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:970)
	at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1059)
	at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:298)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)
@njr-11 njr-11 added bug This bug is not present in a released version of Open Liberty in:JPA team:Blizzard labels Dec 5, 2024
@ajaypaul-ibm
Copy link
Contributor

Raised Eclipse-link issue eclipse-ee4j/eclipselink#2321

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This bug is not present in a released version of Open Liberty in:JPA team:Blizzard
Projects
None yet
Development

No branches or pull requests

2 participants