-->
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.  [ 6 posts ] 
Author Message
 Post subject: Components and InvocationTargetException
PostPosted: Mon Aug 16, 2004 10:14 am 
Newbie

Joined: Sat Jul 31, 2004 5:12 am
Posts: 3
Location: Las Rozas de Madrid
Hello,

Here it is my problem: when initializing usuario.hbm.xml, which contents three components, I always get the same exception. I know for sure the problem is related to the components part, because without it , the initialization continues.

Any help is wellcome.
Thanks.

Hibernate version:2.6

Mapping documents:
<hibernate-mapping package="com.espivo.vivoen.modelo.usuario">
<class name="Usuario"
table="USUARIO" dynamic-insert="true" dynamic-update="true">
<id name="id" column="ID" type="long" unsaved-value="0" >
<generator class="identity"/>
</id>
<property name="idUsuario" column="ID_USUARIO" not-null="true"/>
<property name="idfiscal" column="IDFISCAL" not-null="false"/>
<property name="nombre1" column="NOMBRE1" not-null="false"/>
<property name="nombre2" column="NOMBRE2" not-null="false"/>
<property name="nombre3" column="NOMBRE3" not-null="false"/>
<property name="password" column="PASSWORD" not-null="true"/>
<property name="recuerdoPassword" column="RECORDATORIO_PASSWORD" not-null="true"/>

<!-- .... COMPONENTS ......-->
<component name="email" class="Email">
<parent name="usuario"/>
<property name="emailAddress" column="E_MAIL" type="string" not-null="false"/>
</component>
<component name="tfnoMovil" class="Telefono">
<parent name="usuario"/>
<property name="codPais" column="TFNOMOVIL_CODPAIS" type="short" not-null="false"/>
<property name="numero" column="TFNOMOVIL_NUMERO" type="string" not-null="false"/>
</component>
<component name="myCookie" class="MyCookie">
<parent name="usuario"/>
<property name="myCookieValue" column="COOKIE_VALUE" type="string" not-null="false"/>
</component>
<!-- ...... MAPPING FOR SUBSCRIPCIONES ..... -->
<set name="subscripciones" inverse="true" cascade="save-update">
<key column="ID_USUARIO"/>
<one-to-many class="com.espivo.vivoen.modelo.subscripcion.Subscripcion"/>
</set>
</class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
DEBUG2004-08-16 15:51:55,698 cfg.Binder -Mapped property: id -> ID, type: long
DEBUG2004-08-16 15:51:55,698 cfg.Binder -Mapped property: id -> ID, type: long
DEBUG2004-08-16 15:51:55,708 cfg.Binder -Mapped property: idUsuario -> ID_USUARIO, type: string
DEBUG2004-08-16 15:51:55,708 cfg.Binder -Mapped property: idUsuario -> ID_USUARIO, type: string
DEBUG2004-08-16 15:51:55,708 cfg.Binder -Mapped property: idfiscal -> IDFISCAL, type: string
DEBUG2004-08-16 15:51:55,708 cfg.Binder -Mapped property: idfiscal -> IDFISCAL, type: string
DEBUG2004-08-16 15:51:55,708 cfg.Binder -Mapped property: nombre1 -> NOMBRE1, type: string
DEBUG2004-08-16 15:51:55,708 cfg.Binder -Mapped property: nombre1 -> NOMBRE1, type: string
DEBUG2004-08-16 15:51:55,738 cfg.Binder -Mapped property: nombre2 -> NOMBRE2, type: string
DEBUG2004-08-16 15:51:55,738 cfg.Binder -Mapped property: nombre2 -> NOMBRE2, type: string
DEBUG2004-08-16 15:51:55,768 cfg.Binder -Mapped property: nombre3 -> NOMBRE3, type: string
DEBUG2004-08-16 15:51:55,768 cfg.Binder -Mapped property: nombre3 -> NOMBRE3, type: string
DEBUG2004-08-16 15:51:55,768 cfg.Binder -Mapped property: password -> PASSWORD, type: string
DEBUG2004-08-16 15:51:55,768 cfg.Binder -Mapped property: password -> PASSWORD, type: string
DEBUG2004-08-16 15:51:55,768 cfg.Binder -Mapped property: recuerdoPassword -> RECORDATORIO_PASSWORD, type: string
DEBUG2004-08-16 15:51:55,768 cfg.Binder -Mapped property: recuerdoPassword -> RECORDATORIO_PASSWORD, type: string
DEBUG2004-08-16 15:51:55,778 cfg.Binder -Mapped property: emailAddress -> E_MAIL, type: string
DEBUG2004-08-16 15:51:55,778 cfg.Binder -Mapped property: emailAddress -> E_MAIL, type: string
ERROR2004-08-16 15:51:56,068 actions.DispatchAction -Dispatch[/eMailIn] to method subscribeEmailIn returned an exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)


Name and version of the database you are using:
MySql 4.0.20

Debug level Hibernate log excerpt:

Hello,

Here it is my problem: when initializing usuario.hbm.xml, which contents three components, I always get the same exception. I know for sure the problem is related to the components part, because without it , the initialization continues.

Any help is wellcome.
Thanks.

_________________
Pedro Nevado
Las Rozas de Madrid


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 16, 2004 12:10 pm 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
Your log does not help to determine the cause of the problem, replace all %c{4,} by [%c] in your log4j configuration and repost the log. I think that actions.DispatchAction does not belong to net.sf.hibernate.* package.

ERROR2004-08-16 15:51:56,068 actions.DispatchAction -Dispatch[/eMailIn] to method subscribeEmailIn returned an exception
java.lang.reflect.InvocationTargetException

_________________
Leonid Shlyapnikov


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 16, 2004 12:11 pm 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
replace %c{2} by [%c]

_________________
Leonid Shlyapnikov


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 17, 2004 2:28 am 
Newbie

Joined: Sat Jul 31, 2004 5:12 am
Posts: 3
Location: Las Rozas de Madrid
Hello Leonid,

I have changed my log4j.xml. The Actions classes belongs to my Struts extensions: they are there because the chain of calls is initiated in one the actions of my front end.

Code:
INFO 2004-08-17 08:02:59,069 [net.sf.hibernate.cfg.Binder] -Mapping class: com.espivo.vivoen.modelo.usuario.Usuario -> USUARIO
INFO 2004-08-17 08:02:59,069 [net.sf.hibernate.cfg.Binder] -Mapping class: com.espivo.vivoen.modelo.usuario.Usuario -> USUARIO
DEBUG2004-08-17 08:02:59,069 [net.sf.hibernate.cfg.Binder] -Mapped property: id -> ID, type: long
DEBUG2004-08-17 08:02:59,069 [net.sf.hibernate.cfg.Binder] -Mapped property: id -> ID, type: long
DEBUG2004-08-17 08:02:59,069 [net.sf.hibernate.cfg.Binder] -Mapped property: idUsuario -> ID_USUARIO, type: string
DEBUG2004-08-17 08:02:59,069 [net.sf.hibernate.cfg.Binder] -Mapped property: idUsuario -> ID_USUARIO, type: string
DEBUG2004-08-17 08:02:59,079 [net.sf.hibernate.cfg.Binder] -Mapped property: idfiscal -> IDFISCAL, type: string
DEBUG2004-08-17 08:02:59,079 [net.sf.hibernate.cfg.Binder] -Mapped property: idfiscal -> IDFISCAL, type: string
DEBUG2004-08-17 08:02:59,079 [net.sf.hibernate.cfg.Binder] -Mapped property: nombre1 -> NOMBRE1, type: string
DEBUG2004-08-17 08:02:59,079 [net.sf.hibernate.cfg.Binder] -Mapped property: nombre1 -> NOMBRE1, type: string
DEBUG2004-08-17 08:02:59,079 [net.sf.hibernate.cfg.Binder] -Mapped property: nombre2 -> NOMBRE2, type: string
DEBUG2004-08-17 08:02:59,079 [net.sf.hibernate.cfg.Binder] -Mapped property: nombre2 -> NOMBRE2, type: string
DEBUG2004-08-17 08:02:59,089 [net.sf.hibernate.cfg.Binder] -Mapped property: nombre3 -> NOMBRE3, type: string
DEBUG2004-08-17 08:02:59,089 [net.sf.hibernate.cfg.Binder] -Mapped property: nombre3 -> NOMBRE3, type: string
DEBUG2004-08-17 08:02:59,089 [net.sf.hibernate.cfg.Binder] -Mapped property: password -> PASSWORD, type: string
DEBUG2004-08-17 08:02:59,089 [net.sf.hibernate.cfg.Binder] -Mapped property: password -> PASSWORD, type: string
DEBUG2004-08-17 08:02:59,129 [net.sf.hibernate.cfg.Binder] -Mapped property: recuerdoPassword -> RECORDATORIO_PASSWORD, type: string
DEBUG2004-08-17 08:02:59,129 [net.sf.hibernate.cfg.Binder] -Mapped property: recuerdoPassword -> RECORDATORIO_PASSWORD, type: string
DEBUG2004-08-17 08:02:59,170 [net.sf.hibernate.cfg.Binder] -Mapped property: emailAddress -> E_MAIL, type: string
DEBUG2004-08-17 08:02:59,170 [net.sf.hibernate.cfg.Binder] -Mapped property: emailAddress -> E_MAIL, type: string
ERROR2004-08-17 08:02:59,790 [org.apache.struts.actions.DispatchAction] -Dispatch[/eMailIn] to method subscribeEmailIn returned an exception
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

As you can see in the log, everything is fine until it begins the initialisation of the first component of my usuario.hbm.xml. Before that mapping document, Hibernate processes another four .hbm.xml without problems: they does not contain any component.

This is my usuario.hbm.xml:
Code:
<hibernate-mapping package="com.espivo.vivoen.modelo.usuario">
    <class name="Usuario"
           table="USUARIO" dynamic-insert="true" dynamic-update="true">
        <id name="id" column="ID" type="long" unsaved-value="0" >
            <generator class="identity"/>
        </id>
        <property name="idUsuario" column="ID_USUARIO" not-null="true"/>
        <property name="idfiscal" column="IDFISCAL" not-null="false"/>
        <property name="nombre1" column="NOMBRE1" not-null="false"/>
        <property name="nombre2" column="NOMBRE2" not-null="false"/>
        <property name="nombre3" column="NOMBRE3" not-null="false"/>
        <property name="password" column="PASSWORD" not-null="true"/>
        <property name="recuerdoPassword" column="RECORDATORIO_PASSWORD" not-null="true"/>
      
      <!-- .... COMPONENTS ......-->      
        <component name="email" class="Email">
            <parent name="usuario"/>
            <property name="emailAddress" column="E_MAIL" type="string" not-null="false"/>
        </component>   
        <component name="tfnoMovil" class="Telefono">
            <parent name="usuario"/>
            <property name="codPais" column="TFNOMOVIL_CODPAIS" type="short" not-null="false"/>
            <property name="numero" column="TFNOMOVIL_NUMERO" type="string" not-null="false"/>
        </component>           
        <component name="myCookie" class="MyCookie">
            <parent name="usuario"/>
            <property name="myCookieValue" column="COOKIE_VALUE" type="string" not-null="false"/>
        </component>
      <!-- ...... MAPPING FOR SUBSCRIPCIONES ..... -->
        <set name="subscripciones" inverse="true" cascade="save-update">
            <key column="ID_USUARIO"/>
            <one-to-many class="com.espivo.vivoen.modelo.subscripcion.Subscripcion"/>
        </set>
    </class>
</hibernate-mapping>

Thanks a lot for your interest.
Regards.

_________________
Pedro Nevado
Las Rozas de Madrid


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 17, 2004 2:35 am 
Newbie

Joined: Sat Jul 31, 2004 5:12 am
Posts: 3
Location: Las Rozas de Madrid
Leonid,

I forgot to include the complete information about the exception:
Code:
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:324)
   at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
   at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
   at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
   at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
   at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
   at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
   at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ExceptionInInitializerError
   at com.espivo.vivoen.modelo.subscripcion.SubscribirDlImp.subscribe(SubscribirDlImp.java:41)
   at com.espivo.vivoen.webclient.emailin.EmailInAction.subscribeEmailIn(EmailInAction.java:65)
   ... 38 more
Caused by: java.lang.NullPointerException
   at com.espivo.vivoen.modelo.HibernateUtil.<clinit>(HibernateUtil.java:30)
   ... 40 more


My only clue is that I got an ExceptionInInitializerError with a path configuration of Jasper, long time ago. So perhaps, in this case, there is some conflict in my runtime among hibernate libraries and some other ones.

Pedro Nevado

_________________
Pedro Nevado
Las Rozas de Madrid


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 17, 2004 3:57 am 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
Hi Pedro!

No can do :( (c) Tommy from NWN

But what has happened here
Code:
Caused by: java.lang.NullPointerException
   at  com.espivo.vivoen.modelo.HibernateUtil.<clinit>(HibernateUtil.java:30)


Quote:
So perhaps, in this case, there is some conflict in my runtime among hibernate libraries and some other ones

There was a caution from Gavin to don't replace common-collections.jar from Hibernate bundle by another version of it, but it does not matter in your case (you said that everything works fine without thouse components).

_________________
Leonid Shlyapnikov


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