Separation of Concerns

90 views
Skip to first unread message

onclez...@gmail.com

unread,
Aug 24, 2015, 11:28:17 AM8/24/15
to Sculptor Generator
HI everybody !
I would like to separate some concerns.
Suppose i have my business model. Ok. Then, i would like to add some technicals concerns like profils handler : Roles/Permissions. So i have 2 separated Sculptor projects with their own model/persistence/etc...
How can i integrate my technical projet into my business project without having conflit  like this (multiple persistence units) ?

GRAVE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

org
.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in class path resource [EntityManagerFactory.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [EntityManagerFactory.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No persistence unit with name 'default' found

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [EntityManagerFactory.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No persistence unit with name 'default' found

Caused by: java.lang.IllegalArgumentException: No persistence unit with name 'default' found



When Spring found more than one persistence unit, it look for one that name is 'default'. Can we set this in the model or in the sculptor-generator.properties ?
Maybe the solution would be to use the business persistence unit into my technical project (if the use the same resource). Here the context of the business web project:

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true"            
         
debug="5"
         
reloadable="true"
         
crossContext="true">
   
<Resource
         
name="jdbc/myBusinessDS"
         
auth="Container"
         
type="javax.sql.DataSource"
         
driverClassName="com.mysql.jdbc.Driver"
         
url="jdbc:mysql://localhost:3306/test1"
         
username="test1"
         
password="password"
         
maxActive="100"
         
maxIdle="30"
         
maxWait="10000"
         
/>

   
<Resource
         
name="jdbc/myTechnicalDS"
         
auth="Container"
         
type="javax.sql.DataSource"
         
driverClassName="com.mysql.jdbc.Driver"
         
url="jdbc:mysql://localhost:3306/test1"
         
username="test1"
         
password="password"
           
/>
</Context>



The generate.jpa.annotation=false or jpa.provider=none not resolve the problem...

What do you think ?
Regards

Torsten Juergeleit

unread,
Aug 26, 2015, 6:58:05 AM8/26/15
to Sculptor Generator
When Spring found more than one persistence unit, it look for one that name is 'default'. Can we set this in the model or in the sculptor-generator.properties ?

For every Sculptor module a persistence unit entry is created in "persistence.xml" via JPATempl.xtend. The default unit name is derived from the application name. This can be modified in a module via the hint "persistenceUnit", e.g.

Application Library {
   Module media {

     hint="persistenceUnit=default"
   }
}

How to tweak the Spring configuration via "more.xml" is described here.

/Torsten

Torsten Juergeleit

unread,
Aug 26, 2015, 7:32:38 AM8/26/15
to Sculptor Generator
To handle multiple "persistence.xml" files Spring Datas "org.springframework.data.jpa.support.MergingPersistenceUnitManager" can be used in "more.xml".


/Torsten


On Monday, August 24, 2015 at 5:28:17 PM UTC+2, onclezebulon wrote:

onclez...@gmail.com

unread,
Aug 26, 2015, 1:01:02 PM8/26/15
to Sculptor Generator
Thx for reply Torsten !
Ok. Now is there a way to modify the generated path (and/or name) for EntityManagerFactory.xml, pub-sub.xml, Interceptor.xml, more.xml, generated-spring.properties and spring.properties ?

Best regards.

Torsten Juergeleit

unread,
Aug 27, 2015, 6:19:47 AM8/27/15
to Sculptor Generator
Now is there a way to modify the generated path (and/or name) for EntityManagerFactory.xml, pub-sub.xml, Interceptor.xml, more.xml, generated-spring.properties and spring.properties ?

Yes, but this is not an easy one. In SpingTempl the path is calculate via Properties.getResourceDir(). Currently the path used for Spring artefacts is hard-coded as "" in Properties.getResourceDirImpl(). Here it could be useful to retrieve the path from a property defined in [default-]sculptor-generator.properties instead.

To change the current behaviour you have to override the public method Properties.getResourceDir() via Sculptors extension mechanism.

/Torsten

onclez...@gmail.com

unread,
Aug 28, 2015, 9:46:59 AM8/28/15
to Sculptor Generator
Hi !
It's works perfectly !!!
Now, applicationContext.xml, EntityManagerFactory.xml, generated-spring.properties, Interceptor.xml and pub-sub.xml are generated in there own directory relative to there own project.
In my main project, in more.xml :
<import resource="classpath:myPreoccupationSpring/applicationContext.xml"/>

And here the log :

2015-08-28 14:45:20.255 [localhost-startStop-1] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [mainSpring/applicationContext.xml]
2015-08-28 14:45:20.351 [localhost-startStop-1] INFO  o.s.c.a.ClassPathBeanDefinitionScanner - JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning
2015-08-28 14:45:20.407 [localhost-startStop-1] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [mainSpring/EntityManagerFactory.xml]
2015-08-28 14:45:20.424 [localhost-startStop-1] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [mainSpring/pub-sub.xml]
2015-08-28 14:45:20.438 [localhost-startStop-1] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [mainSpring/Interceptor.xml]
2015-08-28 14:45:20.489 [localhost-startStop-1] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [mainSpring/more.xml]
2015-08-28 14:45:20.502 [localhost-startStop-1] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [myPreoccupationSpring/applicationContext.xml]
2015-08-28 14:45:20.521 [localhost-startStop-1] INFO  o.s.c.a.ClassPathBeanDefinitionScanner - JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning
2015-08-28 14:45:20.545 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'springPropertyConfig': replacing [Generic bean: class [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [mainSpring/applicationContext.xml]] with [Generic bean: class [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [myPreoccupationSpring/applicationContext.xml]]
2015-08-28 14:45:20.545 [localhost-startStop-1] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [myPreoccupationSpring/EntityManagerFactory.xml]
2015-08-28 14:45:20.555 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'entityManagerFactory': replacing [Generic bean: class [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [mainSpring/EntityManagerFactory.xml]] with [Generic bean: class [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [myPreoccupationSpring/EntityManagerFactory.xml]]
2015-08-28 14:45:20.556 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'txManager': replacing [Generic bean: class [org.springframework.orm.jpa.JpaTransactionManager]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [mainSpring/EntityManagerFactory.xml]] with [Generic bean: class [org.springframework.orm.jpa.JpaTransactionManager]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [myPreoccupationSpring/EntityManagerFactory.xml]]
2015-08-28 14:45:20.556 [localhost-startStop-1] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [myPreoccupationSpring/pub-sub.xml]
2015-08-28 14:45:20.566 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'publishAdvice': replacing [Generic bean: class [org.sculptor.framework.event.annotation.PublishAdvice]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [mainSpring/pub-sub.xml]] with [Generic bean: class [org.sculptor.framework.event.annotation.PublishAdvice]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [myPreoccupationSpring/pub-sub.xml]]
2015-08-28 14:45:20.566 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'subscribeBeanPostProcessor': replacing [Generic bean: class [org.sculptor.framework.event.annotation.SubscribeBeanPostProcessor]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [mainSpring/pub-sub.xml]] with [Generic bean: class [org.sculptor.framework.event.annotation.SubscribeBeanPostProcessor]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [myPreoccupationSpring/pub-sub.xml]]
2015-08-28 14:45:20.566 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'simpleEventBusImpl': replacing [Generic bean: class [org.sculptor.framework.event.SimpleEventBusImpl]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [mainSpring/pub-sub.xml]] with [Generic bean: class [org.sculptor.framework.event.SimpleEventBusImpl]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [myPreoccupationSpring/pub-sub.xml]]
2015-08-28 14:45:20.567 [localhost-startStop-1] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [myPreoccupationSpring/Interceptor.xml]
2015-08-28 14:45:20.585 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'jpaInterceptorFlushEager': replacing [Generic bean: class [org.springframework.orm.jpa.JpaInterceptor]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [mainSpring/Interceptor.xml]] with [Generic bean: class [org.springframework.orm.jpa.JpaInterceptor]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [myPreoccupationSpring/Interceptor.xml]]
2015-08-28 14:45:20.586 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'errorHandlingAdvice': replacing [Generic bean: class [org.sculptor.framework.errorhandling.ErrorHandlingAdvice]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [mainSpring/Interceptor.xml]] with [Generic bean: class [org.sculptor.framework.errorhandling.ErrorHandlingAdvice]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [myPreoccupationSpring/Interceptor.xml]]
2015-08-28 14:45:20.586 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'hibernateErrorHandlingAdvice': replacing [Generic bean: class [org.sculptor.framework.errorhandling.HibernateErrorHandlingAdvice]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [mainSpring/Interceptor.xml]] with [Generic bean: class [org.sculptor.framework.errorhandling.HibernateErrorHandlingAdvice]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [myPreoccupationSpring/Interceptor.xml]]
2015-08-28 14:45:20.586 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'serviceContextStoreAdvice': replacing [Generic bean: class [org.sculptor.framework.errorhandling.ServiceContextStoreAdvice]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [mainSpring/Interceptor.xml]] with [Generic bean: class [org.sculptor.framework.errorhandling.ServiceContextStoreAdvice]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [myPreoccupationSpring/Interceptor.xml]]
2015-08-28 14:45:20.586 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'txAdvice': replacing [Generic bean: class [org.springframework.transaction.interceptor.TransactionInterceptor]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Generic bean: class [org.springframework.transaction.interceptor.TransactionInterceptor]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
2015-08-28 14:45:20.587 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'businessService': replacing [Root bean: class [org.springframework.aop.aspectj.AspectJExpressionPointcut]; scope=prototype; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Root bean: class [org.springframework.aop.aspectj.AspectJExpressionPointcut]; scope=prototype; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
2015-08-28 14:45:20.587 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'readOnlyBusinessService': replacing [Root bean: class [org.springframework.aop.aspectj.AspectJExpressionPointcut]; scope=prototype; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Root bean: class [org.springframework.aop.aspectj.AspectJExpressionPointcut]; scope=prototype; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
2015-08-28 14:45:20.587 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'updatingBusinessService': replacing [Root bean: class [org.springframework.aop.aspectj.AspectJExpressionPointcut]; scope=prototype; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Root bean: class [org.springframework.aop.aspectj.AspectJExpressionPointcut]; scope=prototype; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
2015-08-28 14:45:20.587 [localhost-startStop-1] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [myPreoccupationSpring/more.xml]
2015-08-28 14:45:20.598 [localhost-startStop-1] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [spring/mvc-core-config.xml]
2015-08-28 14:45:20.619 [localhost-startStop-1] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [spring/mvc-view-config.xml]
2015-08-28 14:45:20.815 [localhost-startStop-1] INFO  o.s.b.f.c.PropertyPlaceholderConfigurer - Loading properties file from class path resource [myPreoccupationSpring/generated-spring.properties]
2015-08-28 14:45:20.815 [localhost-startStop-1] INFO  o.s.b.f.c.PropertyPlaceholderConfigurer - Loading properties file from class path resource [myPreoccupationSpring/spring.properties]
2015-08-28 14:45:20.884 [localhost-startStop-1] INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean - Building JPA container EntityManagerFactory for persistence unit 'default'
2015-08-28 14:45:21.004 [localhost-startStop-1] INFO  o.h.annotations.common.Version - HCANN000001: Hibernate Commons Annotations {4.0.2.Final}
2015-08-28 14:45:21.011 [localhost-startStop-1] INFO  org.hibernate.Version - HHH000412: Hibernate Core {4.2.15.Final}
2015-08-28 14:45:21.013 [localhost-startStop-1] INFO  org.hibernate.cfg.Environment - HHH000206: hibernate.properties not found
2015-08-28 14:45:21.015 [localhost-startStop-1] INFO  org.hibernate.cfg.Environment - HHH000021: Bytecode provider name : javassist
2015-08-28 14:45:21.037 [localhost-startStop-1] INFO  org.hibernate.ejb.Ejb3Configuration - HHH000204: Processing PersistenceUnitInfo [
    name
: default
   
...]
2015-08-28 14:45:21.183 [localhost-startStop-1] INFO  o.h.s.j.c.i.ConnectionProviderInitiator - HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
2015-08-28 14:45:23.289 [localhost-startStop-1] WARN  o.h.e.jdbc.internal.JdbcServicesImpl - HHH000342: Could not obtain connection to query metadata : Cannot create PoolableConnectionFactory (Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
2015-08-28 14:45:23.302 [localhost-startStop-1] INFO  org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
2015-08-28 14:45:23.316 [localhost-startStop-1] INFO  o.h.e.j.internal.LobCreatorBuilder - HHH000422: Disabling contextual LOB creation as connection was null
2015-08-28 14:45:23.426 [localhost-startStop-1] INFO  o.h.e.t.i.TransactionFactoryInitiator - HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory
2015-08-28 14:45:23.431 [localhost-startStop-1] INFO  o.h.h.i.a.ASTQueryTranslatorFactory - HHH000397: Using ASTQueryTranslatorFactory
2015-08-28 14:45:23.518 [localhost-startStop-1] INFO  o.h.cache.spi.UpdateTimestampsCache - HHH000250: Starting update timestamps cache at region: org.hibernate.cache.spi.UpdateTimestampsCache
2015-08-28 14:45:23.521 [localhost-startStop-1] WARN  o.h.c.e.AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.hibernate.cache.spi.UpdateTimestampsCache]; using defaults.
2015-08-28 14:45:23.536 [localhost-startStop-1] INFO  o.h.c.internal.StandardQueryCache - HHH000248: Starting query cache at region: org.hibernate.cache.internal.StandardQueryCache
2015-08-28 14:45:23.536 [localhost-startStop-1] WARN  o.h.c.e.AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.hibernate.cache.internal.StandardQueryCache]; using defaults.
2015-08-28 14:45:23.563 [localhost-startStop-1] INFO  o.h.validator.internal.util.Version - HV000001: Hibernate Validator 5.0.3.Final
2015-08-28 14:45:23.871 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'entityManagerFactory' of type [class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:23.969 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' of type [class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:23.971 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#1' of type [class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:23.972 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#2' of type [class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:23.973 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#3' of type [class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:23.974 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#4' of type [class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:23.975 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#5' of type [class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:23.976 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#6' of type [class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:23.977 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#7' of type [class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:23.978 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#8' of type [class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:23.979 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#9' of type [class org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:24.097 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'dataSource' of type [class org.springframework.jndi.JndiObjectFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:24.291 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'dataSource' of type [class com.sun.proxy.$Proxy40] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:24.392 [localhost-startStop-1] INFO  o.a.shiro.realm.AuthorizingRealm - No cache or cacheManager properties have been set.  Authorization cache cannot be obtained.
2015-08-28 14:45:24.392 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'myRealm' of type [class org.apache.shiro.realm.jdbc.JdbcRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:24.526 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'securityManager' of type [class org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:24.665 [localhost-startStop-1] INFO  o.s.w.c.s.XmlWebApplicationContext - Bean 'org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor#0' of type [class org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-08-28 14:45:24.746 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7680d40b: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,frontResource,catalogueOffreRepository,catalogueOffreService,internalCatalogueOffreService,mainServicesRepository,mainServicesService,internalMainServicesService,springPropertyConfig,entityManagerFactory,txManager,org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0,publishAdvice,subscribeBeanPostProcessor,simpleEventBusImpl,org.springframework.aop.config.internalAutoProxyCreator,jpaInterceptorFlushEager,errorHandlingAdvice,hibernateErrorHandlingAdvice,serviceContextStoreAdvice,txAdvice,businessService,readOnlyBusinessService,updatingBusinessService,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#1,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#2,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#3,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#4,permissionRepository,internalPermissionServices,permissionServices,profilServices,roleRepository,internalRoleServices,roleServices,userRepository,internalUserServices,userServices,org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#1,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#5,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#6,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#7,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#8,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#9,templateResolver,templateEngine,org.springframework.web.servlet.view.ContentNegotiatingViewResolver#0,cnManager,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#1,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#1,org.springframework.web.servlet.config.viewControllerHandlerMapping,messageSource,org.springframework.web.servlet.handler.SimpleMappingExceptionResolver#0,MainServicesWebResourceValidato,shiroFilter,securityManager,lifecycleBeanPostProcessor,dataSource,myRealm,org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator#0,org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor#0,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
2015-08-28 14:45:25.041 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7680d40b: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,frontResource,catalogueOffreRepository,catalogueOffreService,internalCatalogueOffreService,mainServicesRepository,mainServicesService,internalMainServicesService,springPropertyConfig,entityManagerFactory,txManager,org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0,publishAdvice,subscribeBeanPostProcessor,simpleEventBusImpl,org.springframework.aop.config.internalAutoProxyCreator,jpaInterceptorFlushEager,errorHandlingAdvice,hibernateErrorHandlingAdvice,serviceContextStoreAdvice,txAdvice,businessService,readOnlyBusinessService,updatingBusinessService,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#1,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#2,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#3,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#4,permissionRepository,internalPermissionServices,permissionServices,profilServices,roleRepository,internalRoleServices,roleServices,userRepository,internalUserServices,userServices,org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#1,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#5,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#6,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#7,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#8,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#9,templateResolver,templateEngine,org.springframework.web.servlet.view.ContentNegotiatingViewResolver#0,cnManager,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#1,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#1,org.springframework.web.servlet.config.viewControllerHandlerMapping,messageSource,org.springframework.web.servlet.handler.SimpleMappingExceptionResolver#0,MainServicesWebResourceValidato,shiroFilter,securityManager,lifecycleBeanPostProcessor,dataSource,myRealm,org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator#0,org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor#0,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
2015-08-28 14:45:25.042 [localhost-startStop-1] INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default'
2015-08-28 14:45:25.047 [localhost-startStop-1] ERROR o.s.web.context.ContextLoader - Context initialization failed
org
.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionRepository': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'MyPreoccupationEntityManagerFactory' is defined
    at org
.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:343) ~[spring-orm-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1122) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) ~[spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) ~[spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939) [tomcat-embed-core-7.0.47.jar:7.0.47]
    at org
.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) [tomcat-embed-core-7.0.47.jar:7.0.47]
    at org
.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-7.0.47.jar:7.0.47]
    at org
.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) [tomcat-embed-core-7.0.47.jar:7.0.47]
    at org
.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) [tomcat-embed-core-7.0.47.jar:7.0.47]
    at java
.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_71]
    at java
.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_71]
    at java
.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_71]
    at java
.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'MyPreoccupationEntityManagerFactory' is defined
    at org
.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:568) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1102) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:278) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.orm.jpa.EntityManagerFactoryUtils.findEntityManagerFactory(EntityManagerFactoryUtils.java:110) ~[spring-orm-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findNamedEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:512) ~[spring-orm-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:494) ~[spring-orm-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:660) ~[spring-orm-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:631) ~[spring-orm-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:159) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org
.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:340) ~[spring-orm-3.2.2.RELEASE.jar:3.2.2.RELEASE]
   
... 22 common frames omitted
ao
ût 28, 2015 2:45:25 PM org.apache.catalina.core.StandardContext listenerStart
GRAVE
: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org
.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionRepository': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'MyPreoccupationEntityManagerFactory' is defined
    at org
.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:343)
    at org
.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1122)
    at org
.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
    at org
.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
    at org
.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
    at org
.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org
.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
    at org
.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org
.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
    at org
.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
    at org
.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
    at org
.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
    at org
.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
    at org
.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
    at org
.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
    at org
.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
    at org
.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org
.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org
.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java
.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java
.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java
.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java
.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'MyPreoccupationEntityManagerFactory' is defined
    at org
.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:568)
    at org
.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1102)
    at org
.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:278)
    at org
.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
    at org
.springframework.orm.jpa.EntityManagerFactoryUtils.findEntityManagerFactory(EntityManagerFactoryUtils.java:110)
    at org
.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findNamedEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:512)
    at org
.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:494)
    at org
.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:660)
    at org
.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:631)
    at org
.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:159)
    at org
.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
    at org
.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:340)
   
... 22 more

The log seams to indicate that all beans are loaded but  the the persistence unit of my preoccupation is  looked for in the default, that is main project. As if there was 2 separated loaded context...
Am i wrong ?
Regards



Le lundi 24 août 2015 17:28:17 UTC+2, onclez...@gmail.com a écrit :

Torsten Juergeleit

unread,
Aug 28, 2015, 12:51:58 PM8/28/15
to Sculptor Generator
It's works perfectly !!!

Cool, congrats.

But you're not there yet :-P
Currently there're BeanOverriding issues due to redundant sets of Spring config files:


2015-08-28 14:45:20.545 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'springPropertyConfig': replacing [Generic bean: class [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [mainSpring/applicationContext.xml]] with [Generic bean: class [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [myPreoccupationSpring/applicationContext.xml]]

Unluckily there's currently no support for disabling the generation of certain Spring config files. Only the property "generate.spring=true" exists to disable the Spring support completely via Properties.isSpringToBeGenerated() (including Spring-related stuff in the generated classes, e.g. annotations).

So to suppress the generation of Spring config files you have override SpringTmpl.spring().

Maybe you can come up with a generic approach and provide a corresponding patch for Sculptors current implementation of SpringTmpl, Properties.xtend and default-sculptor-generator.properties.

/Torsten


On Friday, August 28, 2015 at 3:46:59 PM UTC+2, onclezebulon:
Reply all
Reply to author
Forward
0 new messages