0

Zk+Spring+JPA

asked 2009-12-17 10:57:49 +0800

wordy gravatar image wordy
66 3

I'm using Hibernate as the JPA and Spring Security, there is a problem with the persistent when the security is apply.

It is the log:

INFO support.XmlWebApplicationContext - Refreshing org.springframework.web.context.support.XmlWebApplicationContext@29e357: display name [Root WebApplicationContext]; startup date [Thu Dec 17 11:35:23 EST 2009]; root of context hierarchy
203 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [config/application-context.xml]
437 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [config/datasource-context.xml]
609 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/SpringSecurityContext.xml]
1016 INFO config.HttpSecurityBeanDefinitionParser - Concurrent session filter in use, setting 'forceEagerSessionCreation' to true
1109 INFO support.XmlWebApplicationContext - Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@29e357]: org.springframework.beans.factory.support.DefaultListableBeanFactory@fd918a
2266 INFO config.PropertyPlaceholderConfigurer - Loading properties file from class path resource [config/datasource.properties]
2500 INFO support.XmlWebApplicationContext - Bean 'org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter#29ce8c' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2500 INFO support.XmlWebApplicationContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2531 INFO support.XmlWebApplicationContext - Bean '_delegatingMethodDefinitionSource' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2531 INFO support.XmlWebApplicationContext - Bean '_methodDefinitionSourceAdvisor' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2562 INFO support.XmlWebApplicationContext - Bean 'dataSource' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

And after the Autentication JPA Query, all queries throws the following error...

Failed to load /modules/security/secuser_list.zul

Cause: org.hibernate.SessionException: Session is closed!
javax.persistence.PersistenceException: org.hibernate.SessionException: Session is closed!
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:637)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:74)
at clases_persistentes.BasicDAO.find(BasicDAO.java:44)
at clases_persistentes.BasicDAO.find(BasicDAO.java:24)
at clases_persistentes.impl.Sec_userDAOImpl.find(Sec_userDAOImpl.java:81)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)


The spring config is similar to the generated in ZK Studio CRUD App, and the security is based in the ZK Smalltalks.

Any help will be appreciated.

Thanks in advance,

Edwin

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2009-12-18 04:58:34 +0800

samchuang gravatar image samchuang
4084 4

Hi ~~

I am not familiar with Spring Security, may I ask which smalltalk do you refer to?
and could you provide some sample code about how this exception happen??

link publish delete flag offensive edit

answered 2009-12-18 08:46:07 +0800

wordy gravatar image wordy
66 3

I solved the problem, it was my mistake, I just forgot the @Transactional annotation above the method declaration!!! :)

For that reason the Hibernate Session is closed!

Regards Edwin

link publish delete flag offensive edit

answered 2009-12-18 09:56:35 +0800

wordy gravatar image wordy
66 3

You can see the smalltalks at:

http://www.zkoss.org/forum/listComment/5897

And @samchuang tks anyway!!!

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-12-17 10:57:49 +0800

Seen: 1,056 times

Last updated: Dec 18 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More