Results 1 to 4 of 4

Thread: Spring Data on WebSphere 8

  1. #1

    Post Spring Data on WebSphere 8

    I am getting following error when running spring data application in WebSphere 8. This is working fine when I tested the code with LocalContainerEntityManagerFactory. When deploying the code to WebSphere 8, spring data repository bean fails with the following exception.

    org.apache.openjpa.kernel.exps.FilterListener class is in WebSphere sever libraries. When deploying code on WAS, am obtaining EMF from JNDI as recommended in Spring docs. Any help is highly appreciated.

    Thanks

    Code:
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'empRepository': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: org.apache.openjpa.kernel.exps.FilterListener
    	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
    	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1441)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:305)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
    	at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1651)
    	at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410)
    	... 19 more
    Caused by: java.lang.NoClassDefFoundError: org.apache.openjpa.kernel.exps.FilterListener
    	at $Proxy51.<clinit>(Unknown Source)
    	at java.lang.J9VMInternals.initializeImpl(Native Method)
    	at java.lang.J9VMInternals.initialize(J9VMInternals.java:228)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:56)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:527)
    	at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:600)
    	at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:245)
    	at $Proxy34.createQuery(Unknown Source)
    	at org.springframework.data.jpa.repository.query.SimpleJpaQuery.<init>(SimpleJpaQuery.java:68)
    	at org.springframework.data.jpa.repository.query.SimpleJpaQuery.fromQueryAnnotation(SimpleJpaQuery.java:126)
    	at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$DeclaredQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:117)
    	at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:162)
    	at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:71)
    	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:269)
    	at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:142)
    	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:114)
    	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:38)
    	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
    	... 31 more

  2. #2

    Default

    Had any progress on this one? Any leads?

    I have encountered the same error message. I used (in the persistence.xml)
    <persistence-unit-ref>
    <persistence-unit-ref-name>persistence/XXX</persistence-unit-ref-name>
    <persistence-unit-name>yyyy</persistence-unit-name>
    </persistence-unit-ref>
    and in the spring config:

    <jee:jndi-lookup id="entityManagerFactory" jndi-name="persistence/yyyy" />
    and I get the same error message.

    If I use the org.springframework.orm.jpa.LocalContainerEntityMa nagerFactoryBean I do not have any problems so lang as I specify the provider in the persistence.xml
    <provider>com.ibm.websphere.persistence.Persistenc eProviderImpl</provider>

  3. #3

    Default

    Spring data did not work for me on WebSphere8. It is working fine with Weblogic 10.3.6.

  4. #4
    Join Date
    Jan 2007
    Posts
    10

    Default

    I changed behavior of class loader and it helped...
    Enterprise Applications > (Application) > Class loader
    I set:
    * Classes loaded with local class loader first (parent last)
    * Single class loader for application

Posting Permissions

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