i able to run without any error on hosted mode, but when i run on
production (uploaded)
i get error below
[testetefsdf/2.339255113445835576].<stdout>: 14:14:01,205 ERROR
[org.springframework.web.context.ContextLoader] - Context
initialization failed
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'testingImplDao': Injection of persistence
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'data.emf' defined in ServletContext resource
[/WEB-INF/spring-conf.xml]: Invocation of init method failed; nested
exception is java.lang.IllegalStateException: Application code
attempted to create a EntityManagerFactory named transactions-
optional, but one with this name already exists! Instances of
EntityManagerFactory are extremely slow to create and it is usually
not necessary to create one with a given name more than once.
Instead, create a singleton and share it throughout your code. If you
really do need to create a duplicate EntityManagerFactory (such as for
a unittest suite), set the
appengine.orm.disable.duplicate.emf.exception system property to avoid
this error.
at
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues
(PersistenceAnnotationBeanPostProcessor.java:316)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean
(AbstractAutowireCapableBeanFactory.java:1055)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean
(AbstractAutowireCapableBeanFactory.java:511)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:289)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton
(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean
(AbstractBeanFactory.java:286)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:188)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons
(DefaultListableBeanFactory.java:558)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization
(AbstractApplicationContext.java:852)
at
org.springframework.context.support.AbstractApplicationContext.refresh
(AbstractApplicationContext.java:422)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext
(ContextLoader.java:261)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext
(ContextLoader.java:192)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized
(ContextLoaderListener.java:47)
at org.mortbay.jetty.handler.ContextHandler.startContext
(ContextHandler.java:530)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
at org.mortbay.jetty.webapp.WebAppContext.startContext
(WebAppContext.java:1218)
at org.mortbay.jetty.handler.ContextHandler.doStart
(ContextHandler.java:500)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:
448)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:40)
at
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler
(AppVersionHandlerMap.java:191)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler
(AppVersionHandlerMap.java:168)
at
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest
(JettyServletEngineAdapter.java:123)
at com.google.apphosting.runtime.JavaRuntime.handleRequest
(JavaRuntime.java:235)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:5235)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:5233)
at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest
(BlockingApplicationHandler.java:24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
363)
at com.google.net.rpc.impl.Server$2.run(Server.java:838)
at com.google.tracing.LocalTraceSpanRunnable.run
(LocalTraceSpanRunnable.java:56)
at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan
(LocalTraceSpanBuilder.java:536)
at com.google.net.rpc.impl.Server.startRpc(Server.java:793)
at com.google.net.rpc.impl.Server.processRequest(Server.java:368)
at com.google.net.rpc.impl.ServerConnection.messageReceived
(ServerConnection.java:448)
at com.google.net.rpc.impl.RpcConnection.parseMessages
(RpcConnection.java:319)
at com.google.net.rpc.impl.RpcConnection.dataReceived
(RpcConnection.java:290)
at com.google.net.async.Connection.handleReadEvent(Connection.java:
466)
at com.google.net.async.EventDispatcher.processNetworkEvents
(EventDispatcher.java:759)
at com.google.net.async.EventDispatcher.internalLoop
(EventDispatcher.java:205)
at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:
101)
at com.google.net.rpc.RpcService.runUntilServerShutdown
(RpcService.java:251)
at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run
(JavaRuntime.java:394)
at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'data.emf' defined in ServletContext
resource [/WEB-INF/spring-conf.xml]: Invocation of init method failed;
nested exception is java.lang.IllegalStateException: Application code
attempted to create a EntityManagerFactory named transactions-
optional, but one with this name already exists! Instances of
EntityManagerFactory are extremely slow to create and it is usually
not necessary to create one with a given name more than once.
Instead, create a singleton and share it throughout your code. If you
really do need to create a duplicate EntityManagerFactory (such as for
a unittest suite), set the
appengine.orm.disable.duplicate.emf.exception system property to avoid
this error.
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean
(AbstractAutowireCapableBeanFactory.java:1401)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean
(AbstractAutowireCapableBeanFactory.java:512)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:289)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton
(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean
(AbstractBeanFactory.java:286)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:188)
at
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory
(PersistenceAnnotationBeanPostProcessor.java:504)
at
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory
(PersistenceAnnotationBeanPostProcessor.java:470)
at
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
$PersistenceElement.resolveEntityManager
(PersistenceAnnotationBeanPostProcessor.java:595)
at
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
$PersistenceElement.getResourceToInject
(PersistenceAnnotationBeanPostProcessor.java:568)
at org.springframework.beans.factory.annotation.InjectionMetadata
$InjectedElement.inject(InjectionMetadata.java:147)
at
org.springframework.beans.factory.annotation.InjectionMetadata.inject
(InjectionMetadata.java:84)
at
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues
(PersistenceAnnotationBeanPostProcessor.java:313)
... 42 more
Caused by: java.lang.IllegalStateException: Application code attempted
to create a EntityManagerFactory named transactions-optional, but one
with this name already exists! Instances of EntityManagerFactory are
extremely slow to create and it is usually not necessary to create one
with a given name more than once. Instead, cr
my applicationContext.xml
<context:annotation-config />
<context:component-scan base-
package="x.y.gwt.hellospringdispatch.server" />
<context:component-scan base-package="com.user.testing" />
<bean id="data.emf"
class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
<property name="persistenceUnitName"
value="transactions-optional" /
>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.jpa.JpaTransactionManager">
<!--
can only use if one datasource -->
<property name="entityManagerFactory" ref="data.emf" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="annotationConfiguration"
class="org.compass.annotations.config.CompassAnnotationsConfiguration">
</bean>
<bean id="compass"
class="org.compass.spring.LocalCompassBean">
<property name="compassConfiguration"
ref="annotationConfiguration" />
<property name="compassSettings">
<props>
<prop
key="compass.engine.connection">gae://index</prop>
<prop
key="compass.transaction.factory">
org.compass.spring.transaction.SpringSyncTransactionFactory
</prop>
<prop
key="compass.executorManager.type">disabled</prop>
</props>
</property>
<property name="transactionManager"
ref="transactionManager" />
</bean>
<bean id="jpaGpsDevice"
class="org.compass.gps.device.jpa.JpaGpsDevice">
<property name="name" value="jpaGpsDevice" />
<property name="entityManagerFactory" ref="data.emf" /
>
<property name="mirrorDataChanges" value="true" />
</bean>
<bean id="compassGps"
class="org.compass.gps.impl.SingleCompassGps" init-method="start"
destroy-method="stop">
<property name="compass" ref="compass" />
<property name="gpsDevices">
<list>
<ref bean="jpaGpsDevice" />
</list>
</property>
</bean>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.