Results 1 to 2 of 2

Thread: Problems with the insertion of data

  1. #1
    Join Date
    May 2005
    Posts
    2

    Default Problems with the insertion of data

    Hi to all!
    There is somebody can help me in this problem?

    I am using DB postgreSQL 7,3,4, for the mapeo use ibatis 2.0.My problem is that I cannot insert data.But the rare thing is that if I can read them and when inserted duplicated keys recognize that there is an error;but when inserted correct data, do not leave eror but the data do not get to be inserted in the Data Base, is enough stranger.

    I am using ibatis 2,0 of the following form:

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName"><value>org.postgresql.Drive r</value></property>
    <property name="url"><value>jdbcostgresql://localhost/sad</value></property>
    <property name="username"><value>postgres</value></property>
    <property name="password"><value>postgres</value></property>
    </bean>


    <bean id="sqlMap" class="org.springframework.orm.ibatis.SqlMapClient FactoryBean">
    <property name="dataSource"><ref bean="dataSource"/></property>
    <property name="configLocation"><value>WEB-INF/sql-map- config.xml</value></property>
    </bean>

    <bean id="facade" class="creasser.mapeo.StoreFacade">
    <property name="sqlMapClient"><ref bean="sqlMap"/></property>
    </bean>

    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">

    <property name="dataSource"><ref local="dataSource"/></property>
    </bean>
    ---------------------------------------------------
    And the form in I make my insertion with sqlMapClient is:
    ----------------------------------------------------.
    try {
    sqlMapClient.startTransaction();
    sqlMapClient.insert("insertPedido",ped);
    sqlMapClient.commitTransaction();
    }finally{
    sqlMapClient.endTransaction();
    }

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

    When executing error does not leave to me but it does not insert the data either and in the archives logs of tomcat 4,1 leaves the following message

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

    WebappClassLoader: validateJarFile(/opt/jakarta/tomcat/webapps/sad/WEB-INF/lib/servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    log4j:WARN No appenders could be found for logger (org.springframework.web.servlet.DispatcherServlet ).
    log4j:WARN Please initialize the log4j system properly.


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

    Help please, not that to do!.

    Atte NIRVANA :evil:

  2. #2
    Join Date
    May 2005
    Location
    Barcelona, Spain
    Posts
    6

    Default

    I would use a org.springframework.transaction.interceptor.Transa ctionProxyFactoryBean for transaction management so that code like try...cacth...finally is avoided. See the jpetstore sample as an example of this.

    There is no log because it seems that you don't have a log4j.properties within your web classpath. You should add that file in WEB-INF/classes

    Also, I don't think you should include the servlet.jar within your WEB-INF/lib directory

Similar Threads

  1. Unit Test - Problems using Data Source
    By batistella in forum Container
    Replies: 5
    Last Post: Sep 22nd, 2005, 06:08 PM
  2. Multiple Data Sources + Hibernate + Spring
    By joeserel in forum Data
    Replies: 2
    Last Post: May 18th, 2005, 09:22 AM
  3. Replies: 5
    Last Post: Apr 17th, 2005, 07:16 AM
  4. injecting complex configuration data
    By fox9 in forum Container
    Replies: 2
    Last Post: Feb 25th, 2005, 07:23 AM
  5. Data Secutiry - Filtering Data
    By porcelli in forum Security
    Replies: 3
    Last Post: Dec 30th, 2004, 12:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •