Announcement Announcement Module
Collapse
No announcement yet.
Spring & JPA on WASCE 2.1 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring & JPA on WASCE 2.1

    Hi everyone,

    I'm wondering if anyone made Spring with JPA work on Websphere app server community edition 2.1..

    Here's my problem: I created a JPA DAO for for the example app created in tutorial series here and here.

    Everything seems to be set up right, but when I deploy the application, I keep running into the following exception.
    Code:
    2009-06-02 07:35:52,975 ERROR [[/contact]] Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactDAO' defined in ServletContext resource [/WEB-INF/contact-data.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/contact-data.xml]: Cannot create inner bean 'org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver#471861' of type [org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver] while setting bean property 'loadTimeWeaver'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver#471861' defined in ServletContext resource [/WEB-INF/contact-data.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver]: Constructor threw exception; nested exception is java.lang.IllegalStateException: ClassLoader [org.apache.geronimo.kernel.classloader.JarFileClassLoader] does NOT provide an 'addTransformer(ClassFileTransformer)' method.
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	at java.security.AccessController.doPrivileged(Native Method)
    etc...
    Here is my data layer spring config
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    
    	<bean id="contactDAO" class="com.sample.dao.ContactDAOJPA">
    		<property name="entityManagerFactory" ref="entityManagerFactory" />
    	</bean>
    	
    	<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    		<property name="dataSource" ref="dataSourceWASCE" />
    		<property name="jpaVendorAdapter">
    			<bean class="org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter">
    				<property name="showSql" value="true" />
    				<property name="generateDdl" value="true" />
    				<property name="databasePlatform" value="oracle.toplink.essentials.platform.database.MySQL4Platform" />
    			</bean>
    		</property>
    
    		<property name="loadTimeWeaver">
    			<bean class="org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver" />
    		</property>
    
    	</bean>
    	
    	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
    		<property name="entityManagerFactory" ref="entityManagerFactory" />
    		<property name="dataSource" ref="dataSourceWASCE" />
    	</bean>
    
    	<bean id="dataSourceWASCE" class="org.springframework.jndi.JndiObjectFactoryBean">
    		<property name="jndiName" value="java:comp/env/jdbc/ContactDataSource" />
    		<property name="lookupOnStartup" value="false" />
    		<property name="cache" value="true" />
    		<property name="proxyInterface" value="javax.sql.DataSource" />
    	</bean>
    	
    </beans>
    Am I missing something here or is it WASCE related issue?
    Thanks for any info
Working...
X