-->
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.  [ 13 posts ] 
Author Message
 Post subject: HQL delete statement not working
PostPosted: Tue Jul 05, 2005 2:35 pm 
Newbie

Joined: Tue Apr 19, 2005 4:32 pm
Posts: 14
Hi,

I'm getting an exception while executing the HQL delete statement. I've looked at HQL batch processing at http://www.hibernate.org/hib_docs/v3/re ... batch.html and am attempting to do the same in my code, but get the following exception:

org.hibernate.QueryException: query must begin with SELECT or FROM: delete

Looking at ClauseParser.token, it seems that DELETE and UPDATE aren't even supported as claimed in the documentation! Is this a bug or am I doing something wrong?

Hibernate version: 3

Mapping documents: N/A

Code between sessionFactory.openSession() and session.close():
Code:
Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction();
session.createQuery("delete CouponStructure where couponStructureNo = :csNo")
    .setParameter("csNo", new Integer(1001))
    .executeUpdate();
tx.commit();
session.close();



Stack trace:
org.hibernate.QueryException: query must begin with SELECT or FROM: delete [delete CouponStructure where couponStructureNo = :csNo]
at org.hibernate.hql.classic.ClauseParser.token(ClauseParser.java:83)
at org.hibernate.hql.classic.PreprocessingParser.token(PreprocessingParser.java:108)
at org.hibernate.hql.classic.ParserHelper.parse(ParserHelper.java:29)
at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:175)
at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:151)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:414)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:821)
at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:807)
at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:89)
at com.xxx.TestCouponService.testAddCouponStructure(TestCouponService.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)

Name and version of the database you are using: Sybase 12.5

The generated SQL (show_sql=true): N/A

Debug level Hibernate log excerpt:
24015 [main] DEBUG org.hibernate.transaction.JDBCTransaction - begin
24025 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - opening JDBC connection
24025 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
24025 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - using pooled JDBC connection, pool size: 0
24035 [main] DEBUG org.hibernate.transaction.JDBCTransaction - current autocommit status: false
24165 [main] DEBUG org.hibernate.impl.SessionImpl - executeUpdate: delete CouponStructure where couponStructureNo = :csNo
24165 [main] DEBUG org.hibernate.engine.QueryParameters - named parameters: {csNo=1001}
24185 [main] DEBUG org.hibernate.hql.classic.QueryTranslatorImpl - compiling query


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 05, 2005 3:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Surely it should be incredibly obvious that the problem could be something to do with using the classic parser?


Top
 Profile  
 
 Post subject: FIXED
PostPosted: Tue Jul 05, 2005 3:34 pm 
Newbie

Joined: Tue Apr 19, 2005 4:32 pm
Posts: 14
Thanks Gavin, using the new ANTLR based parser (org.hibernate.hql.ast.ASTQueryTranslatorFactory) works.

Rishabh


Top
 Profile  
 
 Post subject: Please give me some air
PostPosted: Wed Aug 31, 2005 5:02 pm 
Newbie

Joined: Wed Aug 31, 2005 4:52 pm
Posts: 3
I got this damned exception.

Caused by: java.lang.NoClassDefFoundError: antlr/ANTLRException
at org.hibernate.hql.ast.ASTQueryTranslatorFactory.createQueryTranslator(ASTQueryTranslatorFactory.java:27)
at org.hibernate.impl.SessionFactoryImpl.createQueryTranslators(SessionFactoryImpl.java:357)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:423)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at ar.com.argencard.sistemasInternos.serviceFramework.soporteNegocio.control.SolicitudManager.getSolicitudes(SolicitudManager.java:124)
at ar.com.argencard.sistemasInternos.serviceFramework.soporteNegocio.service.SNOrquestadorNegocio.getSolicitudes(SNOrquestadorNegocio.java:77)
at ar.com.argencard.sistemasInternos.serviceFramework.soporteNegocio.frontend.form.CatalogacionForm.getItemSolicitudesAbiertas(CatalogacionForm.java:81)
... 95 more


------------------------------------------------------------
I am using hibernate 3.05, and I cant get "CREATEQUERY" or CREATESQL" to work from SESSION class. I tried till my fingers worn out.

I tried everything, but my code would be as simply as:

Session session = HibernateUtils.currentSession();
tx = session.beginTransaction();

List solicitud= session.createQuery(
"from Solicitud")
.list();

..........
and de hbm is:
------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<!-- mutable="false" polymorphism="implicit"-->
<class name="ar.com.argencard.sistemasInternos.serviceFramework.soporteNegocio.model.Solicitud"
schema="SERVICE" table="SFT010" lazy="true" abstract="false">
<id column="NRO_SOLICITUD" name="Numero" type="java.lang.Integer" length="10">
<generator class="native"/>
<!-- generator class="foreign">
<param name="property">adaptacion</param>
</generator-->
</id>

<discriminator column="TIP_SOLICITUD" type="java.lang.String" length="1" not-null="true"/>

<property column="DES_REF_SOLICITUD" name="DescripcionRef" type="java.lang.String"/>
<property column="DES_SOLICITUD" name="Descripcion" type="java.lang.String"/>
<property column="COD_AREA" name="CodArea" type="java.lang.String"/>
<property column="DES_PRIORIDAD" name="Prioridad" type="java.lang.String"/>
<property column="NRO_CEN_COSTO" name="NumCentroCosto" type="java.lang.Integer"/>
<property column="COD_ULT_ESTADO" name="CodUltEstado" type="java.lang.String" length="3"/>
<property column="OBS_SOLICITUD" name="Observacion" type="java.lang.String"/>
<property column="TIM_BORRADO" name="Borrado" type="java.sql.Timestamp"/>
<property column="NRO_SOL_PADRE" name="NroPadre" type="java.lang.Integer"/>
<property column="COD_RECURSO" name="Recurso" type="java.lang.String" length="32"/>

<set name="Documentacion" schema="SERVICE" table="SFT064" lazy="true">
<key column="NRO_SOLICITUD" />
<composite-element class="ar.com.argencard.sistemasInternos.serviceFramework.soporteNegocio.model.Documento">
<property column="NRO_SECUENCIA" name="NroSecuencia" type="java.lang.Integer" length="10"/>
<property column="NRO_TIPODOC" name="CodTipoDocumento" type="java.lang.Integer" length="10"/>
<property column="FECHA" name="Fecha" type="java.util.Date" />
<property column="OBSERVACION" name="Observacion" type="java.lang.String" length="255"/>
</composite-element></set>


<subclass name="ar.com.argencard.sistemasInternos.serviceFramework.soporteNegocio.model.Adaptacion"
discriminator-value="0" lazy="true" >

</subclass>

<subclass name="ar.com.argencard.sistemasInternos.serviceFramework.soporteNegocio.model.Proyecto"
discriminator-value="0" lazy="true" >
</subclass>

<subclass name="ar.com.argencard.sistemasInternos.serviceFramework.soporteNegocio.model.SN_Solicitud"
discriminator-value="1" lazy="true" >
</subclass>

<subclass name="ar.com.argencard.sistemasInternos.serviceFramework.soporteNegocio.model.Incidente"
discriminator-value="2" lazy="true" >
</subclass>

</class>


</hibernate-mapping>

--------------------------------------------------------


The main problem is that the ANTLR error seems to be that no parser for queries is found, but I included every jar related to it in the f* universe.




thanks people


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 8:04 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
include antlr*.jar from hibernate's lib directory


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 8:32 am 
Newbie

Joined: Wed Aug 31, 2005 4:52 pm
Posts: 3
HI.-

Thanks , but I included all jars I could, including that. Now I am opening them to look for the class, but it is included.

Maybe it is just that, ...the antlr is not been taken into account. Why? don´t know!

My antl is ant-antlr-1.6.3.jar

Anybody else with the same problem and with the jar included already?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 10:25 am 
Newbie

Joined: Wed Aug 31, 2005 4:52 pm
Posts: 3
Now I found antlr-2.7.5H3.jar, and now it seems to work. (hibernate 3.05)

hope this helps sb else.

cheers.


Top
 Profile  
 
 Post subject: How to use the new parser
PostPosted: Wed Mar 22, 2006 5:31 pm 
Newbie

Joined: Wed Mar 22, 2006 5:29 pm
Posts: 2
Hi,
I got the same error as skewed has got about an year ago. I am trying to solve the problem by using the new antlr parser. My question is how to use the new parser, just replacing the antlr.jar file with a new one will do it or should I need to do additional steps.
thanks,
raj.


Top
 Profile  
 
 Post subject: ANTLR - Problem
PostPosted: Sun Oct 08, 2006 7:03 am 
Newbie

Joined: Wed Oct 04, 2006 3:28 pm
Posts: 6
Hi ,
I am facing the same problem with weblogic 8.1. If anone have solved this problem do let me know.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 4:16 am 
Newbie

Joined: Wed Feb 28, 2007 6:06 am
Posts: 3
hi,

i've just got the same error,

i solved it like this:

part of applicationContext.xml
Code:
        <props>
            <prop key="hibernate.show_sql">false</prop>
            <prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>
            <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
            <prop key="hibernate.hbm2ddl.auto">update</prop>
            <prop key="hibernate.current_session_context_class">thread</prop>
            <prop key="hibernate.cache.provider_class">org.hibernate.cache.OSCacheProvider</prop>
            <prop key="hibernate.cache.use_query_cache">true</prop>
        </props>


tryed to do:
Code:
        String sql =
            "delete l from LoggingLine as l WHERE l.app=:app AND l.logDate < to_date(:edate,'DD/MM/YYYY HH24:MI:SS')";
        Session session = this.getSession();
        SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
        Query query = session.createQuery(sql);
        query.setCacheable(true);
        query.setParameter("app", a);
        query.setParameter("edate", df.format(eindDatum));
        rowAffected=query.executeUpdate();
       


this gave following exception:
Code:
org.hibernate.QueryException: query must begin with SELECT or FROM


Solved it by doing:
Code:
        String sql =
            "select l from LoggingLine as l WHERE l.app=:app AND l.logDate < to_date(:edate,'DD/MM/YYYY HH24:MI:SS')";
        Session session = this.getSession();
        SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
        Query query = session.createQuery(sql);
        query.setCacheable(true);
        query.setParameter("app", a);
        query.setParameter("edate", df.format(eindDatum));
        List lijst=query.list();
        rowAffected=lijst.size();
        Iterator it=lijst.iterator();
        Session session=this.getSession();
        session.beginTransaction();
        while(it.hasNext()){
            session.delete((LoggingLine)it.next());
        }
        session.getTransaction().commit();
        log.debug("deleted: "+rowAffected);


Hope to help somebody :)


Top
 Profile  
 
 Post subject: Re: HQL delete statement not working
PostPosted: Thu Jan 21, 2010 11:44 am 
Newbie

Joined: Mon Oct 06, 2008 10:46 am
Posts: 3
antlr/ANTLRException is only in antlr-2.x. It is not in antlr-3.x.


Top
 Profile  
 
 Post subject: Re: HQL delete statement not working
PostPosted: Tue Aug 31, 2010 10:34 pm 
Newbie

Joined: Thu Nov 26, 2009 10:08 am
Posts: 4
FYI: Configure this in hibernate.cfg.xml or in Configuration
.setProperty("hibernate.query.factory_class",
"org.hibernate.hql.ast.ASTQueryTranslatorFactory")

Works great!


Top
 Profile  
 
 Post subject: Re: HQL delete statement not working
PostPosted: Fri Mar 13, 2015 5:09 am 
Newbie

Joined: Thu Mar 12, 2015 11:11 am
Posts: 2
Hi,

I'm trying to do an Update with Hibernate an here is the query : UPDATE Rejet r SET r.etatRejet=:etat , dateMaj=sysdate where noRejet=:noRejet

Here is my configuration:

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<context:annotation-config />
<context:component-scan base-package="fr.cnp.btd,fr.cnp.ods,fr.cnp.erc,erc.query"" />

<!-- ******************** DataSource BTD ************************ -->
<bean id="dataSource_btd" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="BTD-IHM"/>
<!-- Pour Tomcat -->
<property name="resourceRef" value="true"/>
</bean>

<bean id="entityManagerFactory_btd" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="packagesToScan" value="fr.cnp.btd.domaine.*"/>
<property name="persistenceUnitName" value="db_btd"></property>
<property name="jpaPropertyMap">
<map>
<entry key="hibernate.dialect" value="${hibernate.dialect}"/>
<entry key="hibernate.query.factory_class" value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory"/>
<entry key="hibernate.hbm2ddl.auto" value="validate"/>
<!-- A utiliser pour faciliter le débogage -->
<entry key="hibernate.show_sql" value="${hibernate.show_sql}"/>
<entry key="hibernate.format_sql" value="${hibernate.format_sql}"/>
</map>
</property>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/>
</property>
<property name="dataSource" ref="dataSource_btd"/>
</bean>

<!-- bean post-processor for JPA annotations -->
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

<bean id="transactionManager_btd" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory_btd"/>
</bean>
<tx:annotation-driven transaction-manager="transactionManager_btd"/>
</beans>

Then I had the following error: org.hibernate.QueryException: query must begin with SELECT or FROM: update ....

I was advice to replace

<entry key="hibernate.query.factory_class" value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory"/>

By

<entry key="hibernate.query.factory_class" value="org.hibernate.hql.ast.ASTQueryTranslatorFactory"/>

I have antlrXX.jar in my classpath.

Here is the new Error I'm having:

4:52:17,211 DEBUG RejetsController:170 - 13960435
14:52:19,479 DEBUG SharedEntityManagerCreator$SharedEntityManagerInvocationHandler:231 - Creating new EntityManager for shared EntityManager invocation
14:52:19,479 DEBUG SessionImpl:265 - opened session at timestamp: 14261683394
14:52:19,484 DEBUG QueryTranslatorImpl:274 - parse() - HQL: UPDATE fr.cnp.btd.domaine.btd.Rejet r SET r.etatRejet=:etat , dateMaj=sysdate where noRejet=:noRejet
14:52:19,496 DEBUG AST:293 - --- HQL AST ---
\-[UPDATE] Node: 'UPDATE'
+-[FROM] Node: 'FROM'
| \-[RANGE] Node: 'RANGE'
| +-[DOT] Node: '.'
| | +-[DOT] Node: '.'
| | | +-[DOT] Node: '.'
| | | | +-[DOT] Node: '.'
| | | | | +-[DOT] Node: '.'
| | | | | | +-[IDENT] Node: 'fr'
| | | | | | \-[IDENT] Node: 'cnp'
| | | | | \-[IDENT] Node: 'btd'
| | | | \-[IDENT] Node: 'domaine'
| | | \-[IDENT] Node: 'btd'
| | \-[IDENT] Node: 'Rejet'
| \-[ALIAS] Node: 'r'
+-[SET] Node: 'SET'
| +-[EQ] Node: '='
| | +-[DOT] Node: '.'
| | | +-[IDENT] Node: 'r'
| | | \-[IDENT] Node: 'etatRejet'
| | \-[COLON] Node: ':'
| | \-[IDENT] Node: 'etat'
| \-[EQ] Node: '='
| +-[IDENT] Node: 'dateMaj'
| \-[IDENT] Node: 'sysdate'
\-[WHERE] Node: 'where'
\-[EQ] Node: '='
+-[IDENT] Node: 'noRejet'
\-[COLON] Node: ':'
\-[IDENT] Node: 'noRejet'

14:52:19,497 DEBUG ErrorCounter:91 - throwQueryException() : no errors
14:52:19,500 DEBUG HqlSqlBaseWalker:111 - update << begin [level=1, statement=update]
14:52:19,501 DEBUG FromElement:157 - FromClause{level=1} : fr.cnp.btd.domaine.btd.Rejet (r) -> rejet0_
14:52:19,501 DEBUG FromReferenceNode:74 - Resolved : r -> NO_REJET
14:52:19,502 DEBUG DotNode:613 - getDataType() : etatRejet -> org.hibernate.type.StringType@12d34a6
14:52:19,503 DEBUG FromReferenceNode:74 - Resolved : r.etatRejet -> ETAT_REJET
14:52:19,504 DEBUG FromReferenceNode:74 - Resolved : {synthetic-alias} -> {synthetic-alias}
14:52:19,504 DEBUG DotNode:613 - getDataType() : dateMaj -> org.hibernate.type.TimestampType@1dcc3ca
14:52:19,504 DEBUG FromReferenceNode:74 - Resolved : {synthetic-alias}.dateMaj -> DATE_MAJ
14:52:19,511 DEBUG FromReferenceNode:74 - Resolved : {synthetic-alias} -> {synthetic-alias}
14:52:19,512 DEBUG DotNode:613 - getDataType() : noRejet -> org.hibernate.type.LongType@71a97
14:52:19,512 DEBUG FromReferenceNode:74 - Resolved : {synthetic-alias}.noRejet -> NO_REJET
14:52:19,513 DEBUG HqlSqlBaseWalker:117 - update : finishing up [level=1, statement=update]
14:52:19,513 DEBUG HqlSqlBaseWalker:123 - update >> end [level=1, statement=update]
14:52:19,517 DEBUG AST:260 - --- SQL AST ---
\-[UPDATE] UpdateStatement: 'UPDATE' querySpaces (ABTDDEVX.TDO_BTD_REJET)
+-[FROM] FromClause: 'FROM' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[r], fromElementByTableAlias=[rejet0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
| \-[FROM_FRAGMENT] FromElement: 'ABTDDEVX.TDO_BTD_REJET' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=r,role=null,tableName=ABTDDEVX.TDO_BTD_REJET,tableAlias=rejet0_,origin=null,columns={,className=fr.cnp.btd.domaine.btd.Rejet}}
+-[SET] SqlNode: 'SET'
| +-[EQ] BinaryLogicOperatorNode: '='
| | +-[DOT] DotNode: 'ETAT_REJET' {propertyName=etatRejet,dereferenceType=ALL,propertyPath=etatRejet,path=r.etatRejet,tableAlias=rejet0_,className=fr.cnp.btd.domaine.btd.Rejet,classAlias=r}
| | | +-[ALIAS_REF] IdentNode: 'NO_REJET' {alias=r, className=fr.cnp.btd.domaine.btd.Rejet, tableAlias=rejet0_}
| | | \-[IDENT] IdentNode: 'etatRejet' {originalText=etatRejet}
| | \-[NAMED_PARAM] ParameterNode: '?' {name=etat, expectedType=org.hibernate.type.StringType@12d34a6}
| \-[EQ] BinaryLogicOperatorNode: '='
| +-[DOT] DotNode: 'DATE_MAJ' {propertyName=dateMaj,dereferenceType=ALL,propertyPath=dateMaj,path={synthetic-alias}.dateMaj,tableAlias=rejet0_,className=fr.cnp.btd.domaine.btd.Rejet,classAlias=r}
| | +-[IDENT] IdentNode: '{synthetic-alias}' {originalText={synthetic-alias}}
| | \-[IDENT] IdentNode: 'dateMaj' {originalText=dateMaj}
| \-[IDENT] IdentNode: 'sysdate' {originalText=sysdate}
\-[WHERE] SqlNode: 'where'
\-[EQ] BinaryLogicOperatorNode: '='
+-[DOT] DotNode: 'NO_REJET' {propertyName=noRejet,dereferenceType=ALL,propertyPath=noRejet,path={synthetic-alias}.noRejet,tableAlias=rejet0_,className=fr.cnp.btd.domaine.btd.Rejet,classAlias=r}
| +-[IDENT] IdentNode: '{synthetic-alias}' {originalText={synthetic-alias}}
| \-[IDENT] IdentNode: 'noRejet' {originalText=noRejet}
\-[NAMED_PARAM] ParameterNode: '?' {name=noRejet, expectedType=org.hibernate.type.LongType@71a97}

14:52:19,519 DEBUG ErrorCounter:91 - throwQueryException() : no errors
14:52:19,530 DEBUG ErrorCounter:91 - throwQueryException() : no errors
14:52:19,531 DEBUG EntityManagerFactoryUtils:343 - Closing JPA EntityManager
14:52:33,749 DEBUG ExceptionHandlerExceptionResolver:132 - Resolving exception from handler [public java.lang.String fr.cnp.btd.web.controller.RejetsController.modifierEtatRejets(java.lang.Long[],java.lang.String,java.lang.String,fr.cnp.btd.web.form.ListeRejetsForm)]: java.lang.NullPointerException
14:52:33,874 DEBUG ResponseStatusExceptionResolver:132 - Resolving exception from handler [public java.lang.String fr.cnp.btd.web.controller.RejetsController.modifierEtatRejets(java.lang.Long[],java.lang.String,java.lang.String,fr.cnp.btd.web.form.ListeRejetsForm)]: java.lang.NullPointerException
14:52:33,874 DEBUG DefaultHandlerExceptionResolver:132 - Resolving exception from handler [public java.lang.String fr.cnp.btd.web.controller.RejetsController.modifierEtatRejets(java.lang.Long[],java.lang.String,java.lang.String,fr.cnp.btd.web.form.ListeRejetsForm)]: java.lang.NullPointerException
14:52:33,874 DEBUG DispatcherServlet:910 - Could not complete request
java.lang.NullPointerException
at org.hibernate.hql.ast.QueryTranslatorImpl.getDynamicInstantiationResultType(QueryTranslatorImpl.java:580)
at org.hibernate.engine.query.HQLQueryPlan.getDynamicInstantiationResultType(HQLQueryPlan.java:341)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:304)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:365)
at $Proxy26.createQuery(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)
at $Proxy26.createQuery(Unknown Source)
at fr.cnp.btd.dao.btd.RejetDAO.majEtatRejet(RejetDAO.java:142)
at fr.cnp.btd.service.metier.RejetMetier.majEtatRejet(RejetMetier.java:114)
at fr.cnp.btd.web.controller.RejetsController.modifierEtatRejets(RejetsController.java:173)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
12 mars 2015 14:52:33 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() for servlet [dispatcher] in context with path [/web] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
java.lang.NullPointerException
at org.hibernate.hql.ast.QueryTranslatorImpl.getDynamicInstantiationResultType(QueryTranslatorImpl.java:580)
at org.hibernate.engine.query.HQLQueryPlan.getDynamicInstantiationResultType(HQLQueryPlan.java:341)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:304)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:365)
at $Proxy26.createQuery(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)
at $Proxy26.createQuery(Unknown Source)
at fr.cnp.btd.dao.btd.RejetDAO.majEtatRejet(RejetDAO.java:142)
at fr.cnp.btd.service.metier.RejetMetier.majEtatRejet(RejetMetier.java:114)
at fr.cnp.btd.web.controller.RejetsController.modifierEtatRejets(RejetsController.java:173)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)


Please, Help.

Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 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.