-->
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.  [ 4 posts ] 
Author Message
 Post subject: Struts-Hibernate-Spring
PostPosted: Thu Jan 29, 2009 5:34 pm 
Newbie

Joined: Thu Jan 29, 2009 5:29 pm
Posts: 2
I am having an error from one of the testcases with Struts action classes.

The error is:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [com/comerxia/core/config/applicationContext-dao.xml]: Initialization of bean failed; nested exception is
java.lang.NoSuchMethodError: org.apache.commons.pool.impl.GenericObjectPool: method <init>()V not found
java.lang.NoSuchMethodError: org.apache.commons.pool.impl.GenericObjectPool: method <init>()V not found
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:765)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)


Can you please suggest how to overcome this error?

_________________
Regards,
MickeyHan


Top
 Profile  
 
 Post subject: Re: Struts-Hibernate-Spring
PostPosted: Thu Jan 29, 2009 7:18 pm 
Senior
Senior

Joined: Wed Sep 19, 2007 9:31 pm
Posts: 191
Location: Khuntien (Indonesia)
mickey_han wrote:
I am having an error from one of the testcases with Struts action classes.

The error is:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [com/comerxia/core/config/applicationContext-dao.xml]: Initialization of bean failed; nested exception is
java.lang.NoSuchMethodError: org.apache.commons.pool.impl.GenericObjectPool: method <init>()V not found
java.lang.NoSuchMethodError: org.apache.commons.pool.impl.GenericObjectPool: method <init>()V not found
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:765)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)


Can you please suggest how to overcome this error?


Post your config please.


Top
 Profile  
 
 Post subject: Re: Struts-Hibernate-Spring
PostPosted: Fri Jan 30, 2009 9:39 am 
Newbie

Joined: Thu Jan 29, 2009 5:29 pm
Posts: 2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>

<!-- database config is stored in an external props file on the classpath -->
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:/*.properties</value>
</list>
</property>
</bean>

<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName">
<value>jdbc.driverClassName</value>
</property>
<property name="url">
<value>jdbc.url</value>
</property>
<property name="username">
<value>username</value>
</property>
<property name="password">
<value>password</value>
</property>
</bean>

<!--
<bean id="duwiDataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName">
<value>${jdbc.driverClassName}</value>
</property>
<property name="url">
<value>${jdbc.url}</value>
</property>
<property name="username">
<value>${jdbc.username}</value>
</property>
<property name="password">
<value>${jdbc.password}</value>
</property>
<property name="maxActive">
<value>${jdbc.maxActive}</value>
</property>
</bean>
-->


<!-- Hibernate Session Factory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="mappingLocations">
<value>classpath*:/**/*.hbm.xml</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.query.substitutions">true 1, false 0</prop>
<prop key="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</prop>
<prop key="hibernate.connection.password">tiger</prop>
<prop key="hibernate.connection.url">jdbc:sqlserver://comnet;database=net;integratedSecurity=false;</prop>
<prop key="hibernate.connection.username">sa</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.current_session_context_class">thread</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.use_sql_comments">true</prop>
</props>
</property>
<property name="dataSource" ref="dataSource" />
<property name="entityInterceptor">
<bean class="com.net.core.dao.interceptor.LobCleanupInterceptor"/>
</property>
</bean>


<!-- Hibernate transaction manager - applied to Manager classes in -logic.xml file -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>

<!-- Hibernate Lazy Initializer -->
<bean id="lazyInitializer" class="com.net.core.dao.hibernate.HibernateLazyInitializer"/>

<!-- DAO beans -->
<bean id="accountDao"
class="com.net.core.dao.hibernate.HibernateAccountDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="addressDao"
class="com.net.core.dao.hibernate.HibernateAddressDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="analyticsProfileDao"
class="com.net.core.dao.hibernate.HibernateAnalyticsProfileDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="canadaCalculatorDao"
class="com.net.core.dao.jdbc.JdbcCanadaCalculatorDao">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="emailTemplateDao"
class="com.net.core.dao.hibernate.HibernateEmailTemplateDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="emailRuleDao"
class="com.net.core.dao.hibernate.HibernateEmailRuleDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="emailEventDao"
class="com.net.core.dao.hibernate.HibernateEmailEventDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="flowInterruptDao"
class="com.net.core.dao.hibernate.HibernateFlowInterruptDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="itemLogisticsDao"
class="com.net.core.dao.jdbc.JdbcItemLogisticsDao">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="merchantDao"
class="com.net.core.dao.hibernate.HibernateMerchantDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="merchantGroupDao"
class="com.net.core.dao.hibernate.HibernateMerchantGroupDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="merchantWarehouseDao"
class="com.net.core.dao.hibernate.HibernateMerchantWarehouseDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="orderDao"
class="com.net.core.dao.hibernate.HibernateOrderDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="orderCommentDao"
class="com.net.core.dao.hibernate.HibernateOrderCommentDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="orderStatusInfoDao"
class="com.net.core.dao.hibernate.HibernateOrderStatusInfoDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="paymentMethodDao"
class="com.net.core.dao.hibernate.HibernatePaymentMethodDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="quoteDao"
class="com.net.core.dao.hibernate.HibernateQuoteDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="shipmentDao"
class="com.net.core.dao.hibernate.HibernateShipmentDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="supportTopicDao" class="com.net.core.dao.hibernate.HibernateSupportTopicDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="supportRequestDao" class="com.net.core.dao.hibernate.HibernateSupportRequestDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="userDao"
class="com.net.core.dao.hibernate.HibernateUserDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="roleDao"
class="com.net.core.dao.hibernate.HibernateRoleDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="permissionDao"
class="com.net.core.dao.hibernate.HibernatePermissionDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="siteProfileDao"
class="com.net.core.dao.hibernate.HibernateSiteProfileDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
</beans>


This is the config file. Is it because of the versions of the corresponding libraries in the respective projects.



SIau_Tie wrote:
mickey_han wrote:
I am having an error from one of the testcases with Struts action classes.

The error is:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [com/comerxia/core/config/applicationContext-dao.xml]: Initialization of bean failed; nested exception is
java.lang.NoSuchMethodError: org.apache.commons.pool.impl.GenericObjectPool: method <init>()V not found
java.lang.NoSuchMethodError: org.apache.commons.pool.impl.GenericObjectPool: method <init>()V not found
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:765)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)


Can you please suggest how to overcome this error?


Post your config please.

_________________
Regards,
MickeyHan


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2009 10:08 am 
Pro
Pro

Joined: Wed Oct 03, 2007 2:31 pm
Posts: 205
Have you resolved this problem? or do you still need help?


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