-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: GenericJDBCException with wildfly 10 on JOIN FETCH query
PostPosted: Thu May 19, 2016 6:46 pm 
Newbie

Joined: Thu May 19, 2016 6:33 pm
Posts: 4
em.createQuery("SELECT comp FROM Companies comp"); runs just fine.

em.createQuery("SELECT comp FROM Companies comp JOIN FETCH comp.resortses"); will give me a nasty error when I try to get the result list. Here's the error:

Code:
javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692)
org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602)
org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:492)
org.jboss.as.jpa.container.QueryNonTxInvocationDetacher.getResultList(QueryNonTxInvocationDetacher.java:58)
Controllers.indexController.processRequest(indexController.java:55)
Controllers.indexController.doGet(indexController.java:75)
javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)
io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)
io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)
io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)


I have been unable to find the reason for why this happens and I want to load the Resorts sets because I will access them. The association is defined Lazy and i want to keep it that way, because I won't need them loaded every time.

Thank you for your help.


Top
 Profile  
 
 Post subject: Re: GenericJDBCException with wildfly 10 on JOIN FETCH query
PostPosted: Fri May 20, 2016 2:22 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
There is a query issue that caused this exception, and that's need to be logged to.
If you don't see it in the logs, you'll have to debug it and see the actual cause.


Top
 Profile  
 
 Post subject: Re: GenericJDBCException with wildfly 10 on JOIN FETCH query
PostPosted: Fri May 20, 2016 4:14 am 
Newbie

Joined: Thu May 19, 2016 6:33 pm
Posts: 4
What query issue?


Top
 Profile  
 
 Post subject: Re: GenericJDBCException with wildfly 10 on JOIN FETCH query
PostPosted: Fri May 20, 2016 4:27 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Quote:
org.hibernate.exception.GenericJDBCException: could not execute query


Top
 Profile  
 
 Post subject: Re: GenericJDBCException with wildfly 10 on JOIN FETCH query
PostPosted: Fri May 20, 2016 1:35 pm 
Newbie

Joined: Thu May 19, 2016 6:33 pm
Posts: 4
Yeah, i forgot to do the changes to the hibernate files when i did changes to the database. I thought changing the java entity files would be enough. I was wrong. EM was trying to load an unfortunate string into an int.

Debugging ws easier than expected.

Thanks for your help. I'm too poor to buy your book though :(.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.