This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Spring and the fly likes Spring roo 1.2.1 can be used with JPA1.0? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Spring
Reply locked New topic
Author

Spring roo 1.2.1 can be used with JPA1.0?

sajjad ahmad
Ranch Hand

Joined: Jan 23, 2003
Posts: 78
Good day all I am currently working on spring roo 1.2.1 and have a created a project using STS. The project is running fine on VM server , but when I try to deploy it to the weblogic 10.3.3 server (which is the server being used on production environment in my company) I get JPA2.0 related exception. After doing some research I found out that JPA2.0 is not supported in Weblogic server 10.3.3.

And as suggested in the forum I tried to comment below line in persitence.xml file

<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

and use the below line instead

<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">

but now I am getting error like below


2012-11-12 23:35:05,494 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'transactionManager' defined in file [C:\Users\Sajjad\Documents\workspace-sts-2.9.2.RELEASE\DrillingBestPractices\target\classes \META-INF\spring\applicationContext.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'entityManagerFactory' defined in file [C:\Users\Sajjad\Documents\workspace-sts-2.9.2.RELEASE\DrillingBestPractices\target\classes \META-INF\spring\applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getShare dCacheMode()Ljavax/persistence/SharedCacheMode;
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:106)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1360)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:1118)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 94)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:225)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:291 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:913)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:464)
at org.springframework.web.context.ContextLoader.conf igureAndRefreshWebApplicationContext(ContextLoader .java:384)
at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:283)
at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 111)
at weblogic.servlet.internal.EventsManager$FireContex tListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:121)
at weblogic.servlet.internal.EventsManager.notifyCont extCreatedEvent(EventsManager.java:181)
at weblogic.servlet.internal.WebAppServletContext.pre loadResources(WebAppServletContext.java:1863)
at weblogic.servlet.internal.WebAppServletContext.sta rt(WebAppServletContext.java:3126)
at weblogic.servlet.internal.WebAppModule.startContex ts(WebAppModule.java:1512)
at weblogic.servlet.internal.WebAppModule.start(WebAp pModule.java:486)
at weblogic.application.internal.flow.ModuleStateDriv er$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.next State(StateMachineDriver.java:41)
at weblogic.application.internal.flow.ModuleStateDriv er.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.ScopedModuleDri ver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerI nvoker.start(ModuleListenerInvoker.java:247)
at weblogic.application.internal.flow.ModuleStateDriv er$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.next State(StateMachineDriver.java:41)
at weblogic.application.internal.flow.ModuleStateDriv er.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.StartModulesFlo w.activate(StartModulesFlow.java:27)
at weblogic.application.internal.BaseDeployment$2.nex t(BaseDeployment.java:1267)
at weblogic.application.utils.StateMachineDriver.next State(StateMachineDriver.java:41)
at weblogic.application.internal.BaseDeployment.activ ate(BaseDeployment.java:409)
at weblogic.application.internal.EarDeployment.activa te(EarDeployment.java:58)
at weblogic.application.internal.DeploymentStateCheck er.activate(DeploymentStateChecker.java:161)
at weblogic.deploy.internal.targetserver.AppContainer Invoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.operations.A bstractOperation.activate(AbstractOperation.java:5 69)
at weblogic.deploy.internal.targetserver.operations.A ctivateOperation.activateDeployment(ActivateOperat ion.java:150)
at weblogic.deploy.internal.targetserver.operations.A ctivateOperation.doCommit(ActivateOperation.java:1 16)
at weblogic.deploy.internal.targetserver.operations.S tartOperation.doCommit(StartOperation.java:143)
at weblogic.deploy.internal.targetserver.operations.A bstractOperation.commit(AbstractOperation.java:323 )
at weblogic.deploy.internal.targetserver.DeploymentMa nager.handleDeploymentCommit(DeploymentManager.jav a:844)
at weblogic.deploy.internal.targetserver.DeploymentMa nager.activateDeploymentList(DeploymentManager.jav a:1253)
at weblogic.deploy.internal.targetserver.DeploymentMa nager.handleCommit(DeploymentManager.java:440)
at weblogic.deploy.internal.targetserver.DeploymentSe rviceDispatcher.commit(DeploymentServiceDispatcher .java:163)
at weblogic.deploy.service.internal.targetserver.Depl oymentReceiverCallbackDeliverer.doCommitCallback(D eploymentReceiverCallbackDeliverer.java:195)
at weblogic.deploy.service.internal.targetserver.Depl oymentReceiverCallbackDeliverer.access$100(Deploym entReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.Depl oymentReceiverCallbackDeliverer$2.run(DeploymentRe ceiverCallbackDeliverer.java:68)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapte rImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread. java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java :173)


AS far as I understand since the JPA2.0 is not supported in weblogic10.3.3 , I will probably have to use an older version of roo which generates JPA1.0 entities or do we have a better option , I want to keep using the latest ROO but deployment on wbelogic10.3.3 is a must for me here
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17258
    
    6

Please don't duplicate post.

Closing this dup.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring roo 1.2.1 can be used with JPA1.0?