net.sf.hibernate.QueryException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I'm switching to 2.0.1 from 1.2.3. I received the following error trying to do a query on a collection that's within a component. Obviously, this used to work in 1.2.3. I've included part of my mapping below. Using elements(mov.cast.cast.list) did not help. net.sf.hibernate.QueryException: could not resolve property type: cast.cast.null [SELECT mov.id FROM mov in class Movie WHERE :findTarget in mov.component.list.elements] at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:223) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:270) at net.sf.hibernate.hql.WhereParser.preprocess(WhereParser.java:347) at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:355) at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:389) at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:275) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:73) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:120) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:145) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:132) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:373) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:351) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1381) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1345) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76) at com.fetchaflick.videotest.ojb.FetchaQuery.list(FetchaQuery.java:45) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageBy(BaseMovieFinder.java:62) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageByActor(BaseMovieFinder.java:45) at com.fetchaflick.videotest.movie.MovieFinderTest.testFindByActor(MovieFinderTest.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) <class name="Movie" table="PRODUCT"> <component name="component" class="com.fetchaflick.videotest.movie.Cast"> <list name="list" table="MOVIE_CAST" cascade="all"> <jcs-cache usage="read-write"/> <key column="MOVIE_ID"/> <index column="POS"/> <element type="string" column="NAME"/> </list> </component> </class> Original thread on the forum http://sourceforge.net/forum/forum.php?thread_id=889001&forum_id=128638 I put this in JIRA a while ago, but I guess it lost it (and my account)?
    via by Rex Madden,
  • I'm switching to 2.0.1 from 1.2.3. I received the following error trying to do a query on a collection that's within a component. Obviously, this used to work in 1.2.3. I've included part of my mapping below. Using elements(mov.cast.cast.list) did not help. net.sf.hibernate.QueryException: could not resolve property type: cast.cast.null [SELECT mov.id FROM mov in class Movie WHERE :findTarget in mov.component.list.elements] at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:223) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:270) at net.sf.hibernate.hql.WhereParser.preprocess(WhereParser.java:347) at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:355) at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:389) at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:275) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:73) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:120) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:145) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:132) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:373) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:351) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1381) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1345) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76) at com.fetchaflick.videotest.ojb.FetchaQuery.list(FetchaQuery.java:45) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageBy(BaseMovieFinder.java:62) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageByActor(BaseMovieFinder.java:45) at com.fetchaflick.videotest.movie.MovieFinderTest.testFindByActor(MovieFinderTest.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) <class name="Movie" table="PRODUCT"> <component name="component" class="com.fetchaflick.videotest.movie.Cast"> <list name="list" table="MOVIE_CAST" cascade="all"> <jcs-cache usage="read-write"/> <key column="MOVIE_ID"/> <index column="POS"/> <element type="string" column="NAME"/> </list> </component> </class> Original thread on the forum http://sourceforge.net/forum/forum.php?thread_id=889001&forum_id=128638 I put this in JIRA a while ago, but I guess it lost it (and my account)?
    via by Rex Madden,
  • http://sourceforge.net/forum/message.php?msg_id=2073580 I'm switching to 2.0.1 from 1.2.3. I received the following error trying to do a query on a collection that's within a component. Obviously, this used to work in 1.2.3. I've included part of my mapping below. Any advice on how to get this to work would be appreciated. net.sf.hibernate.QueryException: could not resolve property type: cast.cast.null [SELECT mov.id FROM mov in class com.fetchaflick.videotest.movie.Movie WHERE :findTarget in mov.cast.cast.list.elements AND mov.status >= :status ORDER BY mov.nakedTitle desc] at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:223) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:270) at net.sf.hibernate.hql.WhereParser.preprocess(WhereParser.java:347) at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:355) at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:389) at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:275) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:73) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:120) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:145) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:132) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:373) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:351) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1381) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1345) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76) at com.fetchaflick.videotest.ojb.FetchaQuery.list(FetchaQuery.java:45) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageBy(BaseMovieFinder.java:62) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageByActor(BaseMovieFinder.java:45) at com.fetchaflick.videotest.movie.MovieFinderTest.testFindByActor(MovieFinderTest.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) <class name="com.fetchaflick.videotest.movie.Product" table="PRODUCT"> <jcs-cache usage="read-write"/> <id name="id" column="id" type="long" unsaved-value="0"> <generator class="assigned"/> </id> <discriminator column="TYPE"/> <version column="version" name="version" type="integer"/> <property name="status" column="STATUS" type="com.fetchaflick.videotest.ojb.ProductStatusFieldConversion"/> <many-to-one name="priceLevel" column="PRICE_LEVEL_ID" class="com.fetchaflick.videotest.movie.PriceLevel" cascade="none" outer-join="auto"/> <subclass name="com.fetchaflick.videotest.movie.BaseMovie" discriminator-value="basemovie"> <property name="releaseDate" column="RELEASE_DATE"/> <property name="nakedTitle" column="NAKED_TITLE"/> <many-to-one name="releaseType" column="RELEASE_TYPE_ID" class="com.fetchaflick.videotest.movie.ReleaseType" cascade="none" /> <component name="cast" class="com.fetchaflick.videotest.movie.Cast"> <component name="cast" class="com.fetchaflick.videotest.movie.SafeList"> <list name="list" table="MOVIE_CAST" cascade="all"> <jcs-cache usage="read-write"/> <key column="MOVIE_ID"/> <index column="POS"/> <element type="string" column="NAME"/> </list> </component> </component> <subclass name="com.fetchaflick.videotest.movie.AdultMovie" discriminator-value="adult"> <property name="studio" column="STUDIO"/> </subclass> <subclass name="com.fetchaflick.videotest.movie.Movie" discriminator-value="movie"> <component name="criticReviews" class="com.fetchaflick.videotest.movie.CriticReviewList"> <component name="reviews" class="com.fetchaflick.videotest.movie.SafeList"> <list name="list" table="MOVIE_CRITIC_REVIEWS" cascade="all"> <jcs-cache usage="read-write"/> <key column="MOVIE_ID"/> <index column="POS"/> <composite-element class="com.fetchaflick.videotest.movie.CriticReview"> <property name="author" column="AUTHOR"/> <property name="link" column="LINK"/> <property name="publication" column="PUBLICATION"/> <property name="rating" type="com.fetchaflick.videotest.ojb.CriticReviewRatingFieldConversion"> <column name="RATING"/> <column name="RATING_MAX"/> </property> <property name="synopsis" column="SYNOPSIS"/> </composite-element> </list> </component> </component> </subclass> </subclass> </class>
    via by Gavin King,
  • http://sourceforge.net/forum/message.php?msg_id=2073580 I'm switching to 2.0.1 from 1.2.3. I received the following error trying to do a query on a collection that's within a component. Obviously, this used to work in 1.2.3. I've included part of my mapping below. Any advice on how to get this to work would be appreciated. net.sf.hibernate.QueryException: could not resolve property type: cast.cast.null [SELECT mov.id FROM mov in class com.fetchaflick.videotest.movie.Movie WHERE :findTarget in mov.cast.cast.list.elements AND mov.status >= :status ORDER BY mov.nakedTitle desc] at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:223) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:270) at net.sf.hibernate.hql.WhereParser.preprocess(WhereParser.java:347) at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:355) at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:389) at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:275) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:73) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:120) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:145) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:132) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:373) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:351) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1381) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1345) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76) at com.fetchaflick.videotest.ojb.FetchaQuery.list(FetchaQuery.java:45) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageBy(BaseMovieFinder.java:62) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageByActor(BaseMovieFinder.java:45) at com.fetchaflick.videotest.movie.MovieFinderTest.testFindByActor(MovieFinderTest.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) <class name="com.fetchaflick.videotest.movie.Product" table="PRODUCT"> <jcs-cache usage="read-write"/> <id name="id" column="id" type="long" unsaved-value="0"> <generator class="assigned"/> </id> <discriminator column="TYPE"/> <version column="version" name="version" type="integer"/> <property name="status" column="STATUS" type="com.fetchaflick.videotest.ojb.ProductStatusFieldConversion"/> <many-to-one name="priceLevel" column="PRICE_LEVEL_ID" class="com.fetchaflick.videotest.movie.PriceLevel" cascade="none" outer-join="auto"/> <subclass name="com.fetchaflick.videotest.movie.BaseMovie" discriminator-value="basemovie"> <property name="releaseDate" column="RELEASE_DATE"/> <property name="nakedTitle" column="NAKED_TITLE"/> <many-to-one name="releaseType" column="RELEASE_TYPE_ID" class="com.fetchaflick.videotest.movie.ReleaseType" cascade="none" /> <component name="cast" class="com.fetchaflick.videotest.movie.Cast"> <component name="cast" class="com.fetchaflick.videotest.movie.SafeList"> <list name="list" table="MOVIE_CAST" cascade="all"> <jcs-cache usage="read-write"/> <key column="MOVIE_ID"/> <index column="POS"/> <element type="string" column="NAME"/> </list> </component> </component> <subclass name="com.fetchaflick.videotest.movie.AdultMovie" discriminator-value="adult"> <property name="studio" column="STUDIO"/> </subclass> <subclass name="com.fetchaflick.videotest.movie.Movie" discriminator-value="movie"> <component name="criticReviews" class="com.fetchaflick.videotest.movie.CriticReviewList"> <component name="reviews" class="com.fetchaflick.videotest.movie.SafeList"> <list name="list" table="MOVIE_CRITIC_REVIEWS" cascade="all"> <jcs-cache usage="read-write"/> <key column="MOVIE_ID"/> <index column="POS"/> <composite-element class="com.fetchaflick.videotest.movie.CriticReview"> <property name="author" column="AUTHOR"/> <property name="link" column="LINK"/> <property name="publication" column="PUBLICATION"/> <property name="rating" type="com.fetchaflick.videotest.ojb.CriticReviewRatingFieldConversion"> <column name="RATING"/> <column name="RATING_MAX"/> </property> <property name="synopsis" column="SYNOPSIS"/> </composite-element> </list> </component> </component> </subclass> </subclass> </class>
    via by Gavin King,
  • Hibernate HQL Query throwing Exception
    via Stack Overflow by user1514616
    ,
  • hi! i got one exception like that ******************************************** net.sf.hibernate.QueryException: could not resolve property type: userId [SELECT groupHBM FROM com.liferay.portal.ejb.UserHBM userHBM JOIN userHBM.groups AS groupHBM WHERE userHBM.userId = ? AND userHBM.portalId = ? ORDER BY name ASC] at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:235) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:281) at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:366) at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:393) at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:279) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:120) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:146) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:133) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:352) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:330) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1368) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1332) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76) at com.liferay.portal.ejb.UserUtil.getGroups(UserUtil.java:452) at com.liferay.portal.ejb.UserManagerEJB.getGroups(UserManagerEJB.java:448) at com.liferay.portal.ejb.UserManagerEJB.getAllLayouts(UserManagerEJB.java:402) at com.liferay.portal.ejb.UserManagerEJB_i298xj_EOImpl.getAllLayouts(UserManagerEJB_i298xj_EOIm pl.java:2389) at com.liferay.portal.ejb.UserManagerUtil.getAllLayouts(UserManagerUtil.java:102) at com.liferay.portal.model.User.getAllLayouts(User.java:315) at com.liferay.portal.c.a.InitAction.run(InitAction.java:89) at com.liferay.portal.c.ServiceAction.run(ServiceAction.java:89) at com.liferay.portal.c.MainServlet.service(MainServlet.java:511) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1 053) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at com.liferay.filters.compression.CompressionFilter.doFilter(CompressionFilter.java:94) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletCont ext.java:6316) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) ******************************************************** in the above exception, previous query is like that "SELECT groupHBM FROM com.liferay.portal.ejb.UserHBM userHBM JOIN userHBM.groups AS groupHBM WHERE userHBM.userId = ? ORDER BY name ASC." that is, we don't appended "userhbm.portalId = ?" in the query. Now we appended the portalId constrain in the query. Then we get the exception. Actually it is joining the table user_ and group_. The mapping table is users_groups table. That we defined in the xml mapping file. foreign key (userId, portalId )in users_groups table refer user_ foreign key (groupId )in users_groups table refer group_. These r the fields in the userHbm and groupHbm persistor class. My prediction is Type mapping is mismatched between UserHBM persistor class's "userId" string type with jdbc type conversion. whether there is any solution for solving this problem
    via by suresh,
    • net.sf.hibernate.QueryException: could not resolve property type: cast.cast.null [SELECT mov.id FROM mov in class Movie WHERE :findTarget in mov.component.list.elements] at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:223) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:270) at net.sf.hibernate.hql.WhereParser.preprocess(WhereParser.java:347) at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:355) at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:389) at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:275) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:73) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:120) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:145) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:132) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:373) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:351) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1381) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1345) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76) at com.fetchaflick.videotest.ojb.FetchaQuery.list(FetchaQuery.java:45) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageBy(BaseMovieFinder.java:62) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageByActor(BaseMovieFinder.java:45) at com.fetchaflick.videotest.movie.MovieFinderTest.testFindByActor(MovieFinderTest.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    No Bugmate found.