-->
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.  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Any special for Date fields?
PostPosted: Tue Oct 04, 2005 4:11 pm 
Beginner
Beginner

Joined: Mon Sep 19, 2005 3:59 pm
Posts: 31
Hi there,
Tried to insert records with date field into table, but I cannot. Any special things for date in Hibernate?

thx,

Lamborghini


db map

Code:
<?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" >

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration.                   -->
<!-- Created Tue Oct 04 14:52:17 EDT 2005                         -->
<hibernate-mapping package="www.articy.wdb">

    <class name="Customer" table="customer">
        <id name="id" column="id" type="java.lang.Integer">
            <generator class="sequence"/>
        </id>

        <property name="name" column="name" type="java.lang.String" />
        <property name="lastname" column="lastname" type="java.lang.String" />
        <property name="age" column="age" type="java.lang.Integer" />
        <property name="active" column="active" type="java.lang.Boolean" />
        <property name="bod" column="bod" type="java.util.Date" />

        <set name="bookSet" inverse="true">
            <key column="customer_fk"/>
            <one-to-many class="Book"/>
        </set>
    </class>
   
</hibernate-mapping>


Top
 Profile  
 
 Post subject: Stack trace
PostPosted: Tue Oct 04, 2005 4:17 pm 
Newbie

Joined: Tue Oct 04, 2005 3:15 pm
Posts: 10
Location: Tucson AZ (and various parts of the U.S.)
Include your stack trace.

_________________
Rick Hightower
CTO of ArcMind


Top
 Profile  
 
 Post subject: Re: Any special for Date fields?
PostPosted: Tue Oct 04, 2005 4:22 pm 
Beginner
Beginner

Joined: Tue Jun 29, 2004 12:35 pm
Posts: 21
lamborghini wrote:
<property name="bod" column="bod" type="java.util.Date" />


[/code]


Maybe use java.sql.Date instead java.util.Date?


Top
 Profile  
 
 Post subject: Read typing section in documents
PostPosted: Tue Oct 04, 2005 4:29 pm 
Newbie

Joined: Tue Oct 04, 2005 3:15 pm
Posts: 10
Location: Tucson AZ (and various parts of the U.S.)
Read the typing section in documents, cut and paste your stack trace and code snippet (between session.open and session.close).

Here is the section on Hibernate types.
[url]
http://www.hibernate.org/hib_docs/v3/re ... ping-types
[/url]

_________________
Rick Hightower
CTO of ArcMind


Top
 Profile  
 
 Post subject: No Stack Trace found
PostPosted: Tue Oct 04, 2005 4:53 pm 
Beginner
Beginner

Joined: Mon Sep 19, 2005 3:59 pm
Posts: 31
Right now, I cannot find any error in the logs, and stack trace not reported.


Top
 Profile  
 
 Post subject: Code
PostPosted: Tue Oct 04, 2005 5:12 pm 
Beginner
Beginner

Joined: Mon Sep 19, 2005 3:59 pm
Posts: 31
I have tested the following code without date field, it worked. Once I added the date field, it didn't work. My Tomcat didn't report any error. I am checking Postgresql log.


Code:
  public void saveCustomer(Customer customer) {
    /* a Hibernate session */
    Session session = null;
    /* we always need a transaction */
    Transaction tx = null;
    try {
      /* get session of the current thread */
      session = HibernateSessionFactory.currentSession();
      tx = session.beginTransaction();
      if (customer.getId() == null || customer.getId().intValue() == 0) 
        session.save(customer);
      else {
        Customer toBeUpdated = (Customer) session.get(Customer.class, customer
            .getId());
        toBeUpdated.setAge(customer.getAge());
        toBeUpdated.setLastname(customer.getLastname());
        toBeUpdated.setName(customer.getName());
        toBeUpdated.setActive(customer.getActive());
        toBeUpdated.setBod(customer.getBod());
        session.update(toBeUpdated);
      }
      tx.commit();
    } catch (HibernateException e) {
      e.printStackTrace();
      if (tx != null) try {
        tx.rollback();
      } catch (HibernateException e1) {
        e1.printStackTrace();
      }

    } finally {
      try {
        if (session != null) session.close();
      } catch (HibernateException e1) {
        e1.printStackTrace();
      }
    }
  }


Form

Code:
//Created by MyEclipse Struts
// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.0.0/xslt/JavaClass.xsl

package com.articy.struts.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

//Created by Arthur Niu on the date Mon Oct 3 12:54:09 EDT 2005 //XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.8.4/xslt/JavaClass.xsl

import www.articy.wdb.Customer;

/**
* Articy Computer System and Service
*
* XDoclet definition:
*
* @struts:form name="customerEditForm"
*/

public class CustomerEditForm extends ActionForm {

   /**
    *
    */
   private static final long serialVersionUID = 1L;

   // --------------------------------------------------------- Instance
   // Variables

   private Customer customer;

   // --------------------------------------------------------- Methods

   public Customer getCustomer() {
      return customer;
   }

   public void setCustomer(Customer customer) {

      this.customer = customer;

   }

   public boolean equals(Object rhs) {

      return customer.equals(rhs);

   }

   public Integer getId() {

      return customer.getId();

   }

   public void setId(Integer id) {

      customer.setId(id);

   }

   public String getName() {

      return customer.getName();

   }

   public void setName(String name) {

      customer.setName(name);

   }

   public String getLastname() {

      return customer.getLastname();

   }

   public void setLastname(String lastname) {

      customer.setLastname(lastname);

   }

   public Integer getAge() {

      return customer.getAge();

   }

   public void setAge(Integer age) {

      customer.setAge(age);

   }

   public Boolean getActive() {

      return customer.getActive();

   }

   public void setActive(Boolean active) {

      customer.setActive(active);

   }

   public Date getBod() {

      return customer.getBod();

   }

   public void setBod(String sbod) {

      SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
      Date bod = null;
      try {
         bod = sdf.parse(sbod);
      } catch (ParseException pe) {
         System.out.println("Error parsing date");
      }
      customer.setBod(bod);
   }

   public String toString() {
      return customer.toString();
   }

   /**
    * Method reset
    *
    * @param mapping
    * @param request
    */
   public void reset(ActionMapping mapping, HttpServletRequest request) {

      customer = new Customer();
   }

}


Top
 Profile  
 
 Post subject: Re: No Stack Trace found
PostPosted: Tue Oct 04, 2005 6:03 pm 
Newbie

Joined: Tue Oct 04, 2005 3:15 pm
Posts: 10
Location: Tucson AZ (and various parts of the U.S.)
lamborghini wrote:
Right now, I cannot find any error in the logs, and stack trace not reported.


You have to retrieve the stack trace.

Copy log4j.jar to TOMCAT LIB DIR (e.g., D:\tools\jakarta-tomcat-5.5.7\common\lib).

Then put commons-logging.properties in the CLASSES dir (e.g. D:\tools\jakarta-tomcat-5.5.7\common\classes)

It should have on entry
Code:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger


Then create a log4j.properties file in the same dir with contents like:
Code:
log4j.rootLogger=ERROR, R, tomcat

log4j.appender.tomcat=org.apache.log4j.ConsoleAppender
log4j.appender.tomcat.layout=org.apache.log4j.PatternLayout
#log4j.appender.tomcat.layout.ConversionPattern=%p %t %c - %m%n
log4j.appender.tomcat.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${catalina.home}/logs/tomcat.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

log4j.logger.org.hibernate=DEBUG


Run this again and send your log in a post.

_________________
Rick Hightower
CTO of ArcMind


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 04, 2005 11:32 pm 
Beginner
Beginner

Joined: Mon Sep 19, 2005 3:59 pm
Posts: 31
Thank you, RickHigh,

The following the snippet from the log. It seems the date type not converted properly. I tried to insert a record, other fields can be added but the bod (date field).

Thanks again.

Lamborghini

DEBUG http-80-Processor24 org.apache.struts.action.RequestProcessor - Storing ActionForm bean instance in scope 'request' under attribute key 'customerEditForm'
DEBUG http-80-Processor24 org.apache.struts.action.RequestProcessor - Populating bean properties from this request
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils - BeanUtils.populate(www.articy.wdb.Customer@275, {active=[Ljava.lang.String;@1d709a5, lastname=[Ljava.lang.String;@ba6c13, age=[Ljava.lang.String;@10d9151, do=[Ljava.lang.String;@1bf68a9, bod=[Ljava.lang.String;@1706eb7, name=[Ljava.lang.String;@74db2c, id=[Ljava.lang.String;@1e16483})
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils - setProperty(www.articy.wdb.Customer@275, active, [])
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils - Convert string '' to class 'java.lang.Boolean'
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils - Using converter org.apache.commons.beanutils.converters.BooleanConverter@8ddb93
DEBUG http-80-Processor24 org.apache.commons.beanutils.PropertyUtils - setSimpleProperty: Invoking method public void com.articy.struts.form.CustomerEditForm.setActive(java.lang.Boolean) with value false (class java.lang.Boolean)
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils - setProperty(www.articy.wdb.Customer@275, lastname, [George])
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils - Convert string 'George' to class 'java.lang.String'
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils - Using converter org.apache.commons.beanutils.converters.StringConverter@1148603
DEBUG http-80-Processor24 org.apache.commons.beanutils.PropertyUtils - setSimpleProperty: Invoking method public void com.articy.struts.form.CustomerEditForm.setLastname(java.lang.String) with value George (class java.lang.String)
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils - setProperty(www.articy.wdb.Customer@275, age, [56])
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils - Convert string '56' to class 'java.lang.Integer'
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils - Using converter org.apache.commons.beanutils.converters.IntegerConverter@14ab51b
DEBUG http-80-Processor24 org.apache.commons.beanutils.PropertyUtils - setSimpleProperty: Invoking method public void com.articy.struts.form.CustomerEditForm.setAge(java.lang.Integer) with value 56 (class java.lang.Integer)
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils - setProperty(www.articy.wdb.Customer@275, do, [saveCustomer,saveCustomer])
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils - setProperty(www.articy.wdb.Customer@275, bod, [1988-01-01])
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils - Skipping read-only property
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils - setProperty(www.articy.wdb.Customer@275, name, [Bush])
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils - Convert string 'Bush' to class 'java.lang.String'
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils - Using converter org.apache.commons.beanutils.converters.StringConverter@1148603
DEBUG http-80-Processor24 org.apache.commons.beanutils.PropertyUtils - setSimpleProperty: Invoking method public void com.articy.struts.form.CustomerEditForm.setName(java.lang.String) with value Bush (class java.lang.String)
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils - setProperty(www.articy.wdb.Customer@275, id, [])
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils - Convert string '' to class 'java.lang.Integer'
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils - Using converter org.apache.commons.beanutils.converters.IntegerConverter@14ab51b
DEBUG http-80-Processor24 org.apache.commons.beanutils.PropertyUtils - setSimpleProperty: Invoking method public void com.articy.struts.form.CustomerEditForm.setId(java.lang.Integer) with value 0 (class java.lang.Integer)
DEBUG http-80-Processor24 org.apache.struts.action.RequestProcessor - Validating input form properties
DEBUG http-80-Processor24 org.apache.struts.action.RequestProcessor - No errors detected, accepting input
DEBUG http-80-Processor24 org.apache.struts.action.RequestProcessor - Looking for Action instance for class com.articy.struts.action.CustomerEditAction
DEBUG http-80-Processor24 org.apache.struts.action.RequestProcessor - Returning existing Action instance
INFO http-80-Processor24 org.hibernate.cfg.Environment - Hibernate 3.0.5
INFO http-80-Processor24 org.hibernate.cfg.Environment - hibernate.properties not found
INFO http-80-Processor24 org.hibernate.cfg.Environment - using CGLIB reflection optimizer
INFO http-80-Processor24 org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
INFO http-80-Processor24 org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
INFO http-80-Processor24 org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
DEBUG http-80-Processor24 org.hibernate.util.DTDEntityResolver - trying to locate http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath under org/hibernate/
DEBUG http-80-Processor24 org.hibernate.util.DTDEntityResolver - found http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath
DEBUG http-80-Processor24 org.hibernate.cfg.Configuration - myeclipse.connection.profile=library-web
DEBUG http-80-Processor24 org.hibernate.cfg.Configuration - connection.url=jdbc:postgresql://192.168.0.88:5432/alibrary
DEBUG http-80-Processor24 org.hibernate.cfg.Configuration - show_sql=true
DEBUG http-80-Processor24 org.hibernate.cfg.Configuration - connection.username=lamborghini
DEBUG http-80-Processor24 org.hibernate.cfg.Configuration - connection.password=italy
DEBUG http-80-Processor24 org.hibernate.cfg.Configuration - connection.driver_class=org.postgresql.Driver
DEBUG http-80-Processor24 org.hibernate.cfg.Configuration - dialect=org.hibernate.dialect.PostgreSQLDialect
DEBUG http-80-Processor24 org.hibernate.cfg.Configuration - null<-org.dom4j.tree.DefaultAttribute@127461b [Attribute: name resource value "www/articy/wdb/Customer.hbm.xml"]
INFO http-80-Processor24 org.hibernate.cfg.Configuration - Mapping resource: www/articy/wdb/Customer.hbm.xml
DEBUG http-80-Processor24 org.hibernate.util.DTDEntityResolver - trying to locate http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath under org/hibernate/
DEBUG http-80-Processor24 org.hibernate.util.DTDEntityResolver - found http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath
INFO http-80-Processor24 org.hibernate.cfg.HbmBinder - Mapping class: www.articy.wdb.Customer -> customer
DEBUG http-80-Processor24 org.hibernate.cfg.HbmBinder - Mapped property: id -> id
DEBUG http-80-Processor24 org.hibernate.cfg.HbmBinder - Mapped property: name -> name
DEBUG http-80-Processor24 org.hibernate.cfg.HbmBinder - Mapped property: lastname -> lastname
DEBUG http-80-Processor24 org.hibernate.cfg.HbmBinder - Mapped property: age -> age
DEBUG http-80-Processor24 org.hibernate.cfg.HbmBinder - Mapped property: active -> active
DEBUG http-80-Processor24 org.hibernate.cfg.HbmBinder - Mapped property: bod -> bod
DEBUG http-80-Processor24 org.hibernate.cfg.HbmBinder - Mapped property: bookSet
DEBUG http-80-Processor24 org.hibernate.cfg.Configuration - null<-org.dom4j.tree.DefaultAttribute@18e80a6 [Attribute: name resource value "www/articy/wdb/Book.hbm.xml"]
INFO http-80-Processor24 org.hibernate.cfg.Configuration - Mapping resource: www/articy/wdb/Book.hbm.xml
DEBUG http-80-Processor24 org.hibernate.util.DTDEntityResolver - trying to locate http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath under org/hibernate/
DEBUG http-80-Processor24 org.hibernate.util.DTDEntityResolver - found http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath
INFO http-80-Processor24 org.hibernate.cfg.HbmBinder - Mapping class: www.articy.wdb.Book -> book
DEBUG http-80-Processor24 org.hibernate.cfg.HbmBinder - Mapped property: id -> id
DEBUG http-80-Processor24 org.hibernate.cfg.HbmBinder - Mapped property: title -> title
DEBUG http-80-Processor24 org.hibernate.cfg.HbmBinder - Mapped property: author -> author
DEBUG http-80-Processor24 org.hibernate.cfg.HbmBinder - Mapped property: available -> available
DEBUG http-80-Processor24 org.hibernate.cfg.HbmBinder - Mapped property: customer -> customer_fk
INFO http-80-Processor24 org.hibernate.cfg.Configuration - Configured SessionFactory: null
DEBUG http-80-Processor24 org.hibernate.cfg.Configuration - properties: {java.vendor=Sun Microsystems Inc., show_sql=true


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 04, 2005 11:45 pm 
Newbie

Joined: Mon Aug 29, 2005 12:53 am
Posts: 13
It may relates to the database. I use the postgreSQL. The type of Date is Timestamp not to be java.util.Date.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 04, 2005 11:50 pm 
Beginner
Beginner

Joined: Mon Sep 19, 2005 3:59 pm
Posts: 31
I did some changes to my code, and got the following snippet. please forget the above one.

thanks,

Lamborghini
-----------------------------------------------------------------
Code:
DEBUG http-80-Processor24 org.apache.struts.action.RequestProcessor -  Storing ActionForm bean instance in scope 'request' under attribute key 'customerEditForm'
DEBUG http-80-Processor24 org.apache.struts.action.RequestProcessor -  Populating bean properties from this request
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils - BeanUtils.populate(www.articy.wdb.Customer@275, {active=[Ljava.lang.String;@126aaca, lastname=[Ljava.lang.String;@196eed5, age=[Ljava.lang.String;@1a1b2f, do=[Ljava.lang.String;@1eeba19, bod=[Ljava.lang.String;@1fbe226, name=[Ljava.lang.String;@1bc6533, id=[Ljava.lang.String;@19811ce})
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils -   setProperty(www.articy.wdb.Customer@275, active, [])
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils - Convert string '' to class 'java.lang.Boolean'
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils -   Using converter org.apache.commons.beanutils.converters.BooleanConverter@b8f675
DEBUG http-80-Processor24 org.apache.commons.beanutils.PropertyUtils - setSimpleProperty: Invoking method public void com.articy.struts.form.CustomerEditForm.setActive(java.lang.Boolean) with value false (class java.lang.Boolean)
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils -   setProperty(www.articy.wdb.Customer@275, lastname, [clinton])
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils - Convert string 'clinton' to class 'java.lang.String'
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils -   Using converter org.apache.commons.beanutils.converters.StringConverter@1e55794
DEBUG http-80-Processor24 org.apache.commons.beanutils.PropertyUtils - setSimpleProperty: Invoking method public void com.articy.struts.form.CustomerEditForm.setLastname(java.lang.String) with value clinton (class java.lang.String)
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils -   setProperty(www.articy.wdb.Customer@275, age, [65])
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils - Convert string '65' to class 'java.lang.Integer'
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils -   Using converter org.apache.commons.beanutils.converters.IntegerConverter@13c9557
DEBUG http-80-Processor24 org.apache.commons.beanutils.PropertyUtils - setSimpleProperty: Invoking method public void com.articy.struts.form.CustomerEditForm.setAge(java.lang.Integer) with value 65 (class java.lang.Integer)
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils -   setProperty(www.articy.wdb.Customer@275, do, [saveCustomer,saveCustomer])
DEBUG http-80-Processor24 org.apache.commons.beanutils.BeanUtils -   setProperty(www.articy.wdb.Customer@275, bod, [1977-05-05])
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils - Convert string '1977-05-05' to class 'java.util.Date'
DEBUG http-80-Processor24 org.apache.commons.beanutils.ConvertUtils -   Using converter org.apache.commons.beanutils.converters.StringConverter@1e55794
DEBUG http-80-Processor24 org.apache.commons.beanutils.PropertyUtils - setSimpleProperty: Invoking method public void [color=red]com.articy.struts.form.CustomerEditForm.setBod(java.util.Date) with value 1977-05-05 (class java.lang.String)
ERROR http-80-Processor24 org.apache.commons.beanutils.PropertyUtils - Method invocation failed.[/color]
java.lang.IllegalArgumentException: argument type mismatch
   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.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773)
   at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1759)
   at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648)
   at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1677)
   at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1022)
   at org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811)
   at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298)
   at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:493)
   at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:805)
   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
   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.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:118)
   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)


Top
 Profile  
 
 Post subject: Stack Trace
PostPosted: Tue Oct 04, 2005 11:50 pm 
Newbie

Joined: Tue Oct 04, 2005 3:15 pm
Posts: 10
Location: Tucson AZ (and various parts of the U.S.)
I still don't see the stack trace.
Have you thought about writing a test case that recreates this?

_________________
Rick Hightower
CTO of ArcMind


Top
 Profile  
 
 Post subject: ignore last post
PostPosted: Tue Oct 04, 2005 11:51 pm 
Newbie

Joined: Tue Oct 04, 2005 3:15 pm
Posts: 10
Location: Tucson AZ (and various parts of the U.S.)
ignore my last post

_________________
Rick Hightower
CTO of ArcMind


Top
 Profile  
 
 Post subject: That stack trace has nothing to do with Hibernate
PostPosted: Tue Oct 04, 2005 11:54 pm 
Newbie

Joined: Tue Oct 04, 2005 3:15 pm
Posts: 10
Location: Tucson AZ (and various parts of the U.S.)
Code:
ERROR http-80-Processor24 org.apache.commons.beanutils.PropertyUtils - Method invocation failed.[/color]
java.lang.IllegalArgumentException: argument type mismatch
   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)


The stack trace is not related to Hibernate.

Write a test case that tests crud operations for your persistent objects.

Divide and conquer....

_________________
Rick Hightower
CTO of ArcMind


Top
 Profile  
 
 Post subject: I am confused with that
PostPosted: Tue Oct 04, 2005 11:58 pm 
Beginner
Beginner

Joined: Mon Sep 19, 2005 3:59 pm
Posts: 31
joechang316 wrote:
It may relates to the database. I use the postgreSQL. The type of Date is Timestamp not to be java.util.Date.


Thanks,

I am using postgresql too, and found that thing in the stack trace. do I need map the field in type of java.sql.TimeStamp, or just keep it as java.util.Date?

Lamborghini

Code:
<?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" >

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration.                   -->
<!-- Created Tue Oct 04 14:52:17 EDT 2005                         -->
<hibernate-mapping package="www.articy.wdb">

    <class name="Customer" table="customer">
        <id name="id" column="id" type="java.lang.Integer">
            <generator class="sequence"/>
        </id>

        <property name="name" column="name" type="java.lang.String" />
        <property name="lastname" column="lastname" type="java.lang.String" />
        <property name="age" column="age" type="java.lang.Integer" />
        <property name="active" column="active" type="java.lang.Boolean" />
[color=red]        <property name="bod" column="bod" type="java.util.Date" />[/color]

        <set name="bookSet" inverse="true">
            <key column="customer_fk"/>
            <one-to-many class="Book"/>
        </set>
    </class>
   
</hibernate-mapping>


Top
 Profile  
 
 Post subject: Re: That stack trace has nothing to do with Hibernate
PostPosted: Wed Oct 05, 2005 12:04 am 
Beginner
Beginner

Joined: Mon Sep 19, 2005 3:59 pm
Posts: 31
RickHigh wrote:
Code:
ERROR http-80-Processor24 org.apache.commons.beanutils.PropertyUtils - Method invocation failed.[/color]
java.lang.IllegalArgumentException: argument type mismatch
   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)


The stack trace is not related to Hibernate.

Write a test case that tests crud operations for your persistent objects.

Divide and conquer....


hmm, it seems I have to do that. I leave it for tomorrow.

Thank you guys, I have to sleep.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 20 posts ]  Go to page 1, 2  Next

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.