Back Forum Reply New

Problems with the insertion of data

mons.dbcp.BasicDataSourcequot; destroy-method=quot;closequot;gt;
lt;property name=quot;driverClassNamequot;gt;lt;valuegt;org.postgresql.Drive  rlt;/valuegt;lt;/propertygt;
lt;property name=quot;uclquot;gt;lt;valuegt;jdbcostgresql--localhost/sadlt;/valuegt;lt;/propertygt;
lt;property name=quot;usernamequot;gt;lt;valuegt;postgreslt;/valuegt;lt;/propertygt;
lt;property name=quot;passwordquot;gt;lt;valuegt;postgreslt;/valuegt;lt;/propertygt;
lt;/beangt;lt;bean id=quot;sqlMapquot; class=quot;org..orm.ibatis.SqlMapClient  FactoryBeanquot;gt;
lt;property name=quot;dataSourcequot;gt;lt;ref bean=quot;dataSourcequot;/gt;lt;/propertygt;
lt;property name=quot;configLocationquot;gt;lt;valuegt;WEB-INF/sql-map-                    config.xmllt;/valuegt;lt;/propertygt; lt;/beangt;
lt;bean id=quot;facadequot; class=quot;creasser.mapeo.StoreFacadequot;gt;
lt;property name=quot;sqlMapClientquot;gt;lt;ref bean=quot;sqlMapquot;/gt;lt;/propertygt;lt;/beangt;

lt;bean id=quot;transactionManagerquot;  class=quot;org..jdbc.datasource.DataSou  rceTransactionManagerquot;gt;  
lt;property name=quot;dataSourcequot;gt;lt;ref local=quot;dataSourcequot;/gt;lt;/propertygt;
lt;/beangt;
---------------------------------------------------
And the form in I make my insertion with sqlMapClient is:
----------------------------------------------------.
try {
sqlMapClient.startTransaction();
sqlMapClient.insert(quot;insertPedidoquot;,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..web.servlet.DispatcherServlet  ).
log4j:WARN Please initialize the log4j system properly.--------------------------------------------------------

Help please, not that to do!.

Atte NIRVANA  :evil:

I would use a org..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
¥
Back Forum Reply New