Hallo

When using packagesToScan, it works fine without persistence.xml!

Did you only update the dev/4.1 or also the 4.0 documentation? Because it's not 
yet there and 4.0 seems to be the current stable.

BTW, the 4.1 docs also add org.jasig.cas.adaptors.jdbc to the list which is not
in your example. Should I add it as well?

Hibernate 4.1.0.Final works fine now, Hibernate 4.3.10.Final, the latest Final,
gives the following exception:

java.lang.NoSuchMethodError: 
javax.persistence.JoinTable.indexes()[Ljavax/persistence/Index;
        at 
org.hibernate.cfg.AnnotationBinder.bindJoinedTableAssociation(AnnotationBinder.java:2412)
        at 
org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:2140)
        at 
org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:963)
        at 
org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:796)
        at 
org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3845)
        at 
org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3799)
        at 
org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1412)
        at 
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1846)
        at 
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:857)
        at 
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
        at 
org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:425)
        at 
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:849)
        at 
org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152)
        at 
org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:67)
        at 
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:288)
        at 
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at 
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)
        at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:922)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
        ...

Wouldn't it be better to put a notice on the web page that people should
use the same hibernate.core.version property as used in the pom.xml of the
CAS version they are going to use? Just to avoid any incompatibilities.

best regards,

-christian-


Am Wed, 27 May 2015 12:02:37 +0400
schrieb Misagh Moayyed <mmoay...@unicon.net>:

> This is now handled by the packagesToScan setting. See this file for 
> reference:
> https://github.com/Jasig/cas/blob/master/cas-server-webapp-support/src/test/resources/jpaTestApplicationContext.xml
> 
> I have updated the docs.
> 
> CAS should work with all versions of Hibernate. What error did you get? 
> 
> - Misagh
> 
> > On May 27, 2015, at 11:15 AM, Christian Brunotte <c...@lathspell.de> wrote:
> > 
> > Hello
> > 
> > I was following the JPA Ticket Registiry tutorial on
> >  https://jasig.github.io/cas/4.0.x/installation/JPA-Ticket-Registry.html
> > but had problems getting Spring+Hibernate to work.
> > 
> > In CAS 3.x there was as persistence.xml that was inherited from 
> > cas-server-webapp when using the Maven overlay system:
> > 
> >  
> > https://github.com/Jasig/cas/blob/3.6.x/cas-server-webapp/src/main/resources/META-INF/persistence.xml
> > 
> > This file has vanished in 4.0.x:
> > 
> >  
> > https://github.com/Jasig/cas/tree/4.0.x/cas-server-webapp/src/main/resources/
> > 
> > Yet, it seems to be necessary:
> > 
> >  org.springframework.beans.factory.BeanCreationException: 
> >    Error creating bean with name 'entityManagerFactory' defined in 
> > ServletContext resource [/WEB-INF/spring-configuration/ticketRegistry.xml]:
> >      Invocation of init method failed; nested exception is 
> > java.lang.IllegalStateException: 
> >        No persistence units parsed from 
> > {classpath*:META-INF/persistence.xml}
> > 
> > Some sources on the net suggests that the persistence.xml might be
> > optional but at least it does not work with the above tutorial and
> > the latest versions of Hibernate and Spring in the pom.xml.
> > 
> > 
> > NB: I could only get CAS 4.0.1 to work with Hibernate 4.1.0.Final, not
> > 4.1.10.Final. It would be nice if the proper value of 
> > ${hibernate.core.version} could be either documented in the tutorial or 
> > inherited from the Maven Overlay. Or should that be the case and I did
> > something wrong?
> > 
> > Best Regards
> > 
> > -christian-
> > 
> > -- 
> > You are currently subscribed to cas-user@lists.jasig.org as: 
> > mmoay...@unicon.net
> > To unsubscribe, change settings or access archives, see 
> > http://www.ja-sig.org/wiki/display/JSG/cas-user
> 
> 


-- 
Content Delivery Server & Dienste
_________________________________________________________________________
NETCOLOGNE Gesellschaft für Telekommunikation mbH
Am Coloneum 9 | 50829 Köln
Tel: 0221 2222-8711 | Fax: 0221 2222-78711

www.netcologne.de

Geschäftsführer:
Jost Hermanns
Mario Wilhelm
Vorsitzender des Aufsichtsrates:
Dr. Andreas Cerbe
HRB 25580, AG Köln

Diese Nachricht (inklusive aller Anhänge) ist vertraulich. Sollten Sie diese
Nachricht versehentlich erhalten haben, bitten wir, den Absender (durch
Antwort-E-Mail) hiervon unverzüglich zu informieren und die Nachricht zu
löschen. Die E-Mail darf in diesem Fall weder vervielfältigt noch in anderer
Weise verwendet werden.

-- 
You are currently subscribed to cas-user@lists.jasig.org as: 
arch...@mail-archive.com
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to