Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
SpringDM + eclipseLink + c3p0 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SpringDM + eclipseLink + c3p0

    Hi all,

    I'm trying to use springDM the first time. I set up my application first without springDM and I got the data from the db . After this I set up springDM. Here are my config:

    Code:
    <bean id="eclipseLinkJpaVendorAdapterBean" class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
    	<property name="showSql" value="true"/>
    </bean>
    
    <bean id="dataSourceBean" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
    	<property name="driverClass" value="com.ddtek.jdbc.openedge.OpenEdgeDriver" />
    	<property name="JdbcUrl" value="jdbc:datadirect:openedge://..." />
    	<property name="user" value="user" />
    	<property name="password" value="pw" />
    </bean>
    
    <bean id="entityManagerFactoryBean" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    	<property name="dataSource" ref="dataSourceBean"/>
    	<property name="jpaVendorAdapter" ref="eclipseLinkJpaVendorAdapterBean"/>
    	<property name="jpaPropertyMap">
    		<map><entry key="eclipselink.weaving" value="false"/></map>
    	</property>
    </bean>
    
    <bean id="documentRepositoryBean"....
    The startup is ok, but when I try to connect to the db I geht the following exception:
    Code:
    [EL Info]: EclipseLink, version: Eclipse Persistence Services - 2.1.0.v20100614-r7608
    2011-02-22 08:57:25,307 [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] WARN  com.mchange.v2.c3p0.DriverManagerDataSource  - Could not load driverClass com.ddtek.jdbc.openedge.OpenEdgeDriver
    java.lang.ClassNotFoundException: com.ddtek.jdbc.openedge.OpenEdgeDriver
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
    	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:169)
    	at com.mchange.v2.c3p0.DriverManagerDataSource.ensureDriverLoaded(DriverManagerDataSource.java:100)
    	at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:132)
    	at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
    	at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
    	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
    	at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
    	at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
    	at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
    	at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
    2011-02-22 08:57:25,312 [574472509@qtp-1187052686-0] INFO  com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource  - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hgeksf8el6uxbpetr6s8|65454f68, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.ddtek.jdbc.openedge.OpenEdgeDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hgeksf8el6uxbpetr6s8|65454f68, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:datadirect:openedge://..., maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
    Don't know where the error is. Could it be a classloding problem? How can I solve this?

    Any hints are appreciate
    Thanks in advance!
    stephan

  • #2
    Fixed it. It was a classloader problem.
    Now I use the commons.dbcp instead of c3p0. There is an attribute for initialize the DataSource by creating the bean as far as I understand (https://issuetracker.springsource.com/browse/EBR-7).
    Now my code look like
    Code:
    <bean id="dataSourceBean" class="org.apache.commons.dbcp.BasicDataSource" init-method="createDataSource">
    instaed of
    Code:
    <bean id="dataSourceBean" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
    Thanks
    stephan

    Comment

    Working...
    X