Hi,
I have a simple Spring application that works fine with GlassFish 3.1. When I
initially deploy this application to GlassFish 3.1.1, then it is still
working fine. But when I redeploy the application, an error occors:
When I try to write something to the database, the following exception
appears:
[#|2011-08-11T17:58:50.364+0200|SEVERE|glassfish3.1.1|org.springframework.scheduling.support.MethodInvokingRunnable|_ThreadID=28;_ThreadName=Thread-2;|Invocation
of method 'markNewRequestsAsInProcess' on target class [class $Proxy205]
failed javax.persistence.TransactionRequiredException: Exception Description:
No transaction is currently active at
org.eclipse.persistence.internal.jpa.transaction.EntityTransactionWrapper.throwCheckTransactionFailedException(EntityTransactionWrapper.java:113)
at
org.eclipse.persistence.internal.jpa.transaction.EntityTransactionWrapper.checkForTransaction(EntityTransactionWrapper.java:50)
at
org.eclipse.persistence.internal.jpa.EntityManagerImpl.checkForTransaction(EntityManagerImpl.java:1776)
at
org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeUpdate(EJBQueryImpl.java:533)
at
de.burdaciscom.mb.ap.dispatcher.dao.ApolloRequestDaoImpl.markNewRequestsAsInProcess(ApolloRequestDaoImpl.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy205.markNewRequestsAsInProcess(Unknown Source) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273) at
org.springframework.scheduling.support.MethodInvokingRunnable.run(MethodInvokingRunnable.java:65)
at
org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:51)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at
java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662) |#]
The problem can be solved, when the application is disabled and enabled
afterwards. A complete undeploy and deploy works as well.
Did anything change the way how redeployments are executed in GlassFish
3.1.1?
Steps to reproduce the problem:
1) Start a default domain
2) Start the embedded Derby database with "asadmin start-database"
3) Create a war file for the attached sample project with "mvn package"
4) Deploy the war file. Now the log file should display a message about a
database update every 5 seconds.
5) Redeploy the war file. Now the database update fails and the
"TransactionRequiredException" occurs.
System configuration:
* GlassFish 3.1.1 Full Edition
* JDK 1.6.0_26
* Windows 7 or SuSE Enterprise Linux 11
Thanks for your help!
Stephan
--
[Message sent by forum member 'svollmer']
View Post: http://forums.java.net/node/831707