CAS Table creation?

16 messages Options
Embed this post
Permalink
Andrew Tillinghast

CAS Table creation?

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Still working with CAS, JBoss 5, JPA and MS SQL.

Working in ticketRegistry.xml

No matter what I tried I couldn't seem to get JPA connecting to my MS SQL box, I tried with the MS SQLJBC package, and the JTDS package. Always goto datasource not found issues, even tried changing the datasource to org.springframework.jdbc.datasource.DriverManagerDataSource

I do seem to have JPA working however by connecting it to the JBoss JTA via JNDI:

<bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="persistenceUnitName" value="CasPersistence"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
</props>
</property>
    </bean>

Now CAS is loading correctly and JBoss is identifying it as persistent but the CAS tables don't seem to be created. I was expecting I would see them in the JBoss database I have on the SQL box along side the JBoss persistence tables but they aren't there.
Right now quartz is throwing an exception: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
and on login: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@13dc9f3 targetAction = org.jasig.cas.web.flow.AuthenticationViaFormAction@11d6c3a, attributes = map['method' -> 'submit']] in state 'submit' of flow 'login-webflow' -- action execution attributes were 'map['method' -> 'submit']'; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl; nested exception is java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
I'm wondering is I just create the CAS tables by hand it might work.

Andrew Tillinghast
Sr. Web Developer
270 Mohegan Avenue
New LondonCT 06320-4196
Ph:860 439-5265 Fax: 860 439-2871
P Think before you print

CONFIDENTIALITY: This email (including any attachments) may contain confidential,
proprietary and privileged information, and unauthorized disclosure or use is 
prohibited. If you received this email in error, please notify the sender and delete
this email from your system.

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

Scott Battaglia-2

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
Andrew,

Does the user have the appropriate privileges to create the tables on the fly?

Cheers
Scott


On Tue, Jun 23, 2009 at 1:31 PM, Andrew Tillinghast <[hidden email]> wrote:
Still working with CAS, JBoss 5, JPA and MS SQL.

Working in ticketRegistry.xml

No matter what I tried I couldn't seem to get JPA connecting to my MS SQL box, I tried with the MS SQLJBC package, and the JTDS package. Always goto datasource not found issues, even tried changing the datasource to org.springframework.jdbc.datasource.DriverManagerDataSource

I do seem to have JPA working however by connecting it to the JBoss JTA via JNDI:

<bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="persistenceUnitName" value="CasPersistence"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
</props>
</property>
    </bean>

Now CAS is loading correctly and JBoss is identifying it as persistent but the CAS tables don't seem to be created. I was expecting I would see them in the JBoss database I have on the SQL box along side the JBoss persistence tables but they aren't there.
Right now quartz is throwing an exception: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
and on login: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@13dc9f3 targetAction = org.jasig.cas.web.flow.AuthenticationViaFormAction@11d6c3a, attributes = map['method' -> 'submit']] in state 'submit' of flow 'login-webflow' -- action execution attributes were 'map['method' -> 'submit']'; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl; nested exception is java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
I'm wondering is I just create the CAS tables by hand it might work.

Andrew Tillinghast
Sr. Web Developer
270 Mohegan Avenue
New London, CT 06320-4196
Ph:860 439-5265 Fax: 860 439-2871
P Think before you print

CONFIDENTIALITY: This email (including any attachments) may contain confidential,
proprietary and privileged information, and unauthorized disclosure or use is 
prohibited. If you received this email in error, please notify the sender and delete
this email from your system.

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

Andrew Tillinghast

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Yes, the user in the JTA connection is aliased to DBO and was able to create the JBoss tables on the fly.

-Andrew 

On Jun 23, 2009, at 1:56 PM, Scott Battaglia wrote:

Andrew,

Does the user have the appropriate privileges to create the tables on the fly?

Cheers
Scott


On Tue, Jun 23, 2009 at 1:31 PM, Andrew Tillinghast <[hidden email]> wrote:
Still working with CAS, JBoss 5, JPA and MS SQL.

Working in ticketRegistry.xml

No matter what I tried I couldn't seem to get JPA connecting to my MS SQL box, I tried with the MS SQLJBC package, and the JTDS package. Always goto datasource not found issues, even tried changing the datasource to org.springframework.jdbc.datasource.DriverManagerDataSource

I do seem to have JPA working however by connecting it to the JBoss JTA via JNDI:

<bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="persistenceUnitName" value="CasPersistence"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
</props>
</property>
    </bean>

Now CAS is loading correctly and JBoss is identifying it as persistent but the CAS tables don't seem to be created. I was expecting I would see them in the JBoss database I have on the SQL box along side the JBoss persistence tables but they aren't there.
Right now quartz is throwing an exception: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
and on login: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@13dc9f3 targetAction = org.jasig.cas.web.flow.AuthenticationViaFormAction@11d6c3a, attributes = map['method' -> 'submit']] in state 'submit' of flow 'login-webflow' -- action execution attributes were 'map['method' -> 'submit']'; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl; nested exception is java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
I'm wondering is I just create the CAS tables by hand it might work.

<image.gif>
Andrew Tillinghast
Sr. Web Developer
270 Mohegan Avenue
New London, CT 06320-4196
Ph:860 439-5265 Fax: 860 439-2871
P Think before you print

CONFIDENTIALITY: This email (including any attachments) may contain confidential,
proprietary and privileged information, and unauthorized disclosure or use is 
prohibited. If you received this email in error, please notify the sender and delete
this email from your system.

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Scott Battaglia-2

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Andrew Tillinghast
There's a parameter to tell Hibernate to generate the tables on startup.  It doesn't look configured there and I'm not sure what the default value is.


On Tue, Jun 23, 2009 at 1:31 PM, Andrew Tillinghast <[hidden email]> wrote:
Still working with CAS, JBoss 5, JPA and MS SQL.

Working in ticketRegistry.xml

No matter what I tried I couldn't seem to get JPA connecting to my MS SQL box, I tried with the MS SQLJBC package, and the JTDS package. Always goto datasource not found issues, even tried changing the datasource to org.springframework.jdbc.datasource.DriverManagerDataSource

I do seem to have JPA working however by connecting it to the JBoss JTA via JNDI:

<bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="persistenceUnitName" value="CasPersistence"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
</props>
</property>
    </bean>

Now CAS is loading correctly and JBoss is identifying it as persistent but the CAS tables don't seem to be created. I was expecting I would see them in the JBoss database I have on the SQL box along side the JBoss persistence tables but they aren't there.
Right now quartz is throwing an exception: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
and on login: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@13dc9f3 targetAction = org.jasig.cas.web.flow.AuthenticationViaFormAction@11d6c3a, attributes = map['method' -> 'submit']] in state 'submit' of flow 'login-webflow' -- action execution attributes were 'map['method' -> 'submit']'; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl; nested exception is java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
I'm wondering is I just create the CAS tables by hand it might work.

Andrew Tillinghast
Sr. Web Developer
270 Mohegan Avenue
New London, CT 06320-4196
Ph:860 439-5265 Fax: 860 439-2871
P Think before you print

CONFIDENTIALITY: This email (including any attachments) may contain confidential,
proprietary and privileged information, and unauthorized disclosure or use is 
prohibited. If you received this email in error, please notify the sender and delete
this email from your system.

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

Andrew Tillinghast

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Scott Battaglia-2
Some javascript/style in this post has been disabled (why?)
The other pieces of the JTA/Persistence config:

$JBOSS_HOME/Server/all/deploy/cas.ear/cas.war/classes/META-INF/persistence.xml
version="1.0">
<persistence-unit name="CasPersistence" transaction-type="JTA">
        <jta-data-source>java:/DefaultDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:/CasPersistence"/>
</properties>
</persistence-unit>
</persistence>

$JBOSS_HOME/Server/all/deploy/mssql-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>DefaultDS</jndi-name>
    <connection-url>jdbc:sqlserver://devdb.conncoll.edu:1433</connection-url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
    <databaseName>JBoss</databaseName>
    <user-name>xxxxx</user-name>
    <password>*****</password>
      <metadata>
         <type-mapping>MS SQLSERVER2000</type-mapping>
      </metadata>
  </local-tx-datasource>
</datasources>

-Andrew 

On Jun 23, 2009, at 1:56 PM, Scott Battaglia wrote:

Andrew,

Does the user have the appropriate privileges to create the tables on the fly?

Cheers
Scott


On Tue, Jun 23, 2009 at 1:31 PM, Andrew Tillinghast <[hidden email]> wrote:
Still working with CAS, JBoss 5, JPA and MS SQL.

Working in ticketRegistry.xml

No matter what I tried I couldn't seem to get JPA connecting to my MS SQL box, I tried with the MS SQLJBC package, and the JTDS package. Always goto datasource not found issues, even tried changing the datasource to org.springframework.jdbc.datasource.DriverManagerDataSource

I do seem to have JPA working however by connecting it to the JBoss JTA via JNDI:

<bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="persistenceUnitName" value="CasPersistence"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
</props>
</property>
    </bean>

Now CAS is loading correctly and JBoss is identifying it as persistent but the CAS tables don't seem to be created. I was expecting I would see them in the JBoss database I have on the SQL box along side the JBoss persistence tables but they aren't there.
Right now quartz is throwing an exception: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
and on login: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@13dc9f3 targetAction = org.jasig.cas.web.flow.AuthenticationViaFormAction@11d6c3a, attributes = map['method' -> 'submit']] in state 'submit' of flow 'login-webflow' -- action execution attributes were 'map['method' -> 'submit']'; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl; nested exception is java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
I'm wondering is I just create the CAS tables by hand it might work.

<image.gif>
Andrew Tillinghast
Sr. Web Developer
270 Mohegan Avenue
New London, CT 06320-4196
Ph:860 439-5265 Fax: 860 439-2871
P Think before you print

CONFIDENTIALITY: This email (including any attachments) may contain confidential,
proprietary and privileged information, and unauthorized disclosure or use is 
prohibited. If you received this email in error, please notify the sender and delete
this email from your system.

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Scott Battaglia-2

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
it looks okay.  The only thing I do differently is that my "hibernate.hbm2ddl.auto" is in the Spring configuration. I.e.
http://www.ja-sig.org/wiki/display/CASUM/JpaTicketRegistry

Not sure if that makes a difference at all.

Cheers,
Scott


On Tue, Jun 23, 2009 at 2:06 PM, Andrew Tillinghast <[hidden email]> wrote:
The other pieces of the JTA/Persistence config:

$JBOSS_HOME/Server/all/deploy/cas.ear/cas.war/classes/META-INF/persistence.xml
version="1.0">
<persistence-unit name="CasPersistence" transaction-type="JTA">
        <jta-data-source>java:/DefaultDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:/CasPersistence"/>
</properties>
</persistence-unit>
</persistence>

$JBOSS_HOME/Server/all/deploy/mssql-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>DefaultDS</jndi-name>
    <connection-url>jdbc:sqlserver://devdb.conncoll.edu:1433</connection-url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
    <databaseName>JBoss</databaseName>
    <user-name>xxxxx</user-name>
    <password>*****</password>
      <metadata>
         <type-mapping>MS SQLSERVER2000</type-mapping>
      </metadata>
  </local-tx-datasource>
</datasources>

-Andrew 

On Jun 23, 2009, at 1:56 PM, Scott Battaglia wrote:

Andrew,

Does the user have the appropriate privileges to create the tables on the fly?

Cheers
Scott


On Tue, Jun 23, 2009 at 1:31 PM, Andrew Tillinghast <[hidden email]> wrote:
Still working with CAS, JBoss 5, JPA and MS SQL.

Working in ticketRegistry.xml

No matter what I tried I couldn't seem to get JPA connecting to my MS SQL box, I tried with the MS SQLJBC package, and the JTDS package. Always goto datasource not found issues, even tried changing the datasource to org.springframework.jdbc.datasource.DriverManagerDataSource

I do seem to have JPA working however by connecting it to the JBoss JTA via JNDI:

<bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="persistenceUnitName" value="CasPersistence"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
</props>
</property>
    </bean>

Now CAS is loading correctly and JBoss is identifying it as persistent but the CAS tables don't seem to be created. I was expecting I would see them in the JBoss database I have on the SQL box along side the JBoss persistence tables but they aren't there.
Right now quartz is throwing an exception: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
and on login: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@13dc9f3 targetAction = org.jasig.cas.web.flow.AuthenticationViaFormAction@11d6c3a, attributes = map['method' -> 'submit']] in state 'submit' of flow 'login-webflow' -- action execution attributes were 'map['method' -> 'submit']'; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl; nested exception is java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
I'm wondering is I just create the CAS tables by hand it might work.

<image.gif>
Andrew Tillinghast
Sr. Web Developer
270 Mohegan Avenue
New London, CT 06320-4196
Ph:860 439-5265 Fax: 860 439-2871
P Think before you print

CONFIDENTIALITY: This email (including any attachments) may contain confidential,
proprietary and privileged information, and unauthorized disclosure or use is 
prohibited. If you received this email in error, please notify the sender and delete
this email from your system.

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Andrew Tillinghast

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
I added that line, and I changed the JTA reference so that it's a datasource, right now the CAS service starts without any errors and it correctly authenticates the user, when the user successfully logs in however CAS errors out with:

09:36:00,146 ERROR [[cas]] Servlet.service() for servlet cas threw exception
java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:223)
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.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:358)
at $Proxy298.persist(Unknown Source)
at org.springframework.orm.jpa.JpaTemplate$5.doInJpa(JpaTemplate.java:268)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184)
at org.springframework.orm.jpa.JpaTemplate.persist(JpaTemplate.java:266)
at org.jasig.cas.ticket.registry.JpaTicketRegistry.addTicket(JpaTicketRegistry.java:48)
at org.jasig.cas.CentralAuthenticationServiceImpl.createTicketGrantingTicket(CentralAuthenticationServiceImpl.java:425)
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:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
....

Here is my ticketRegistry,xml now:

<?xml version="1.0" encoding="UTF-8"?>
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
<!-- JPA attached to jboss persistence unit -->
    <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="dataSource" ref="dataSource"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="generateDdl" value="true" />
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
<prop key="hibernate.transaction.auto_close_session">true</prop>
<prop key="hibernate.current_session_context_class">jta</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
</props>
</property>
    </bean>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:/DefaultDS"></property>
</bean>

<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName" value="java:/TransactionManager" />
<property name="autodetectUserTransaction" value="false" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
        <!-- TICKET REGISTRY CLEANER --> <bean id="ticketRegistryCleaner" class="org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner" p:ticketRegistry-ref="ticketRegistry" /> <bean id="jobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean" p:targetObject-ref="ticketRegistryCleaner" p:targetMethod="clean" /> <bean id="triggerJobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.SimpleTriggerBean" p:jobDetail-ref="jobDetailTicketRegistryCleaner" p:startDelay="20000" p:repeatInterval="5000000" /> <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref local="triggerJobDetailTicketRegistryCleaner" /> </list> </property> </bean> </beans>

At this point I have everything else working except persistence/clustering any help at all would be great, or help figuring out why the data source wouldn't work when I tried normal JPA instead of the JTA connection.


-Andrew 

On Jun 24, 2009, at 8:44 AM, Scott Battaglia wrote:

it looks okay.  The only thing I do differently is that my "hibernate.hbm2ddl.auto" is in the Spring configuration. I.e.
http://www.ja-sig.org/wiki/display/CASUM/JpaTicketRegistry

Not sure if that makes a difference at all.

Cheers,
Scott


On Tue, Jun 23, 2009 at 2:06 PM, Andrew Tillinghast <[hidden email]> wrote:
The other pieces of the JTA/Persistence config:

$JBOSS_HOME/Server/all/deploy/cas.ear/cas.war/classes/META-INF/persistence.xml
version="1.0">
<persistence-unit name="CasPersistence" transaction-type="JTA">
        <jta-data-source>java:/DefaultDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:/CasPersistence"/>
</properties>
</persistence-unit>
</persistence>

$JBOSS_HOME/Server/all/deploy/mssql-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>DefaultDS</jndi-name>
    <connection-url>jdbc:sqlserver://devdb.conncoll.edu:1433</connection-url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
    <databaseName>JBoss</databaseName>
    <user-name>xxxxx</user-name>
    <password>*****</password>
      <metadata>
         <type-mapping>MS SQLSERVER2000</type-mapping>
      </metadata>
  </local-tx-datasource>
</datasources>

-Andrew 

On Jun 23, 2009, at 1:56 PM, Scott Battaglia wrote:

Andrew,

Does the user have the appropriate privileges to create the tables on the fly?

Cheers
Scott


On Tue, Jun 23, 2009 at 1:31 PM, Andrew Tillinghast <[hidden email]> wrote:
Still working with CAS, JBoss 5, JPA and MS SQL.

Working in ticketRegistry.xml

No matter what I tried I couldn't seem to get JPA connecting to my MS SQL box, I tried with the MS SQLJBC package, and the JTDS package. Always goto datasource not found issues, even tried changing the datasource to org.springframework.jdbc.datasource.DriverManagerDataSource

I do seem to have JPA working however by connecting it to the JBoss JTA via JNDI:

<bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="persistenceUnitName" value="CasPersistence"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
</props>
</property>
    </bean>

Now CAS is loading correctly and JBoss is identifying it as persistent but the CAS tables don't seem to be created. I was expecting I would see them in the JBoss database I have on the SQL box along side the JBoss persistence tables but they aren't there.
Right now quartz is throwing an exception: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
and on login: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@13dc9f3 targetAction = org.jasig.cas.web.flow.AuthenticationViaFormAction@11d6c3a, attributes = map['method' -> 'submit']] in state 'submit' of flow 'login-webflow' -- action execution attributes were 'map['method' -> 'submit']'; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl; nested exception is java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
I'm wondering is I just create the CAS tables by hand it might work.

<image.gif>
Andrew Tillinghast
Sr. Web Developer
270 Mohegan Avenue
New London, CT 06320-4196
Ph:860 439-5265 Fax: 860 439-2871
P Think before you print

CONFIDENTIALITY: This email (including any attachments) may contain confidential,
proprietary and privileged information, and unauthorized disclosure or use is 
prohibited. If you received this email in error, please notify the sender and delete
this email from your system.

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Scott Battaglia-2

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
You're confusing me. ;-)  What's the actual problem?  Last time you said the tables hadn't been created now you're saying the dataource isn't working.




On Wed, Jun 24, 2009 at 9:44 AM, Andrew Tillinghast <[hidden email]> wrote:
I added that line, and I changed the JTA reference so that it's a datasource, right now the CAS service starts without any errors and it correctly authenticates the user, when the user successfully logs in however CAS errors out with:

09:36:00,146 ERROR [[cas]] Servlet.service() for servlet cas threw exception
java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:223)
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.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:358)
at $Proxy298.persist(Unknown Source)
at org.springframework.orm.jpa.JpaTemplate$5.doInJpa(JpaTemplate.java:268)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184)
at org.springframework.orm.jpa.JpaTemplate.persist(JpaTemplate.java:266)
at org.jasig.cas.ticket.registry.JpaTicketRegistry.addTicket(JpaTicketRegistry.java:48)
at org.jasig.cas.CentralAuthenticationServiceImpl.createTicketGrantingTicket(CentralAuthenticationServiceImpl.java:425)
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:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
....

Here is my ticketRegistry,xml now:

<?xml version="1.0" encoding="UTF-8"?>
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
<!-- JPA attached to jboss persistence unit -->
    <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="dataSource" ref="dataSource"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="generateDdl" value="true" />
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
<prop key="hibernate.transaction.auto_close_session">true</prop>
<prop key="hibernate.current_session_context_class">jta</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
</props>
</property>
    </bean>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:/DefaultDS"></property>
</bean>

<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName" value="java:/TransactionManager" />
<property name="autodetectUserTransaction" value="false" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
        <!-- TICKET REGISTRY CLEANER --> <bean id="ticketRegistryCleaner" class="org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner" p:ticketRegistry-ref="ticketRegistry" /> <bean id="jobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean" p:targetObject-ref="ticketRegistryCleaner" p:targetMethod="clean" /> <bean id="triggerJobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.SimpleTriggerBean" p:jobDetail-ref="jobDetailTicketRegistryCleaner" p:startDelay="20000" p:repeatInterval="5000000" /> <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref local="triggerJobDetailTicketRegistryCleaner" /> </list> </property> </bean> </beans>

At this point I have everything else working except persistence/clustering any help at all would be great, or help figuring out why the data source wouldn't work when I tried normal JPA instead of the JTA connection.


-Andrew 

On Jun 24, 2009, at 8:44 AM, Scott Battaglia wrote:

it looks okay.  The only thing I do differently is that my "hibernate.hbm2ddl.auto" is in the Spring configuration. I.e.
http://www.ja-sig.org/wiki/display/CASUM/JpaTicketRegistry

Not sure if that makes a difference at all.

Cheers,
Scott


On Tue, Jun 23, 2009 at 2:06 PM, Andrew Tillinghast <[hidden email]> wrote:
The other pieces of the JTA/Persistence config:

$JBOSS_HOME/Server/all/deploy/cas.ear/cas.war/classes/META-INF/persistence.xml
version="1.0">
<persistence-unit name="CasPersistence" transaction-type="JTA">
        <jta-data-source>java:/DefaultDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:/CasPersistence"/>
</properties>
</persistence-unit>
</persistence>

$JBOSS_HOME/Server/all/deploy/mssql-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>DefaultDS</jndi-name>
    <connection-url>jdbc:sqlserver://devdb.conncoll.edu:1433</connection-url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
    <databaseName>JBoss</databaseName>
    <user-name>xxxxx</user-name>
    <password>*****</password>
      <metadata>
         <type-mapping>MS SQLSERVER2000</type-mapping>
      </metadata>
  </local-tx-datasource>
</datasources>

-Andrew 

On Jun 23, 2009, at 1:56 PM, Scott Battaglia wrote:

Andrew,

Does the user have the appropriate privileges to create the tables on the fly?

Cheers
Scott


On Tue, Jun 23, 2009 at 1:31 PM, Andrew Tillinghast <[hidden email]> wrote:
Still working with CAS, JBoss 5, JPA and MS SQL.

Working in ticketRegistry.xml

No matter what I tried I couldn't seem to get JPA connecting to my MS SQL box, I tried with the MS SQLJBC package, and the JTDS package. Always goto datasource not found issues, even tried changing the datasource to org.springframework.jdbc.datasource.DriverManagerDataSource

I do seem to have JPA working however by connecting it to the JBoss JTA via JNDI:

<bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="persistenceUnitName" value="CasPersistence"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
</props>
</property>
    </bean>

Now CAS is loading correctly and JBoss is identifying it as persistent but the CAS tables don't seem to be created. I was expecting I would see them in the JBoss database I have on the SQL box along side the JBoss persistence tables but they aren't there.
Right now quartz is throwing an exception: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
and on login: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@13dc9f3 targetAction = org.jasig.cas.web.flow.AuthenticationViaFormAction@11d6c3a, attributes = map['method' -> 'submit']] in state 'submit' of flow 'login-webflow' -- action execution attributes were 'map['method' -> 'submit']'; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl; nested exception is java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
I'm wondering is I just create the CAS tables by hand it might work.

<image.gif>
Andrew Tillinghast
Sr. Web Developer
270 Mohegan Avenue
New London, CT 06320-4196
Ph:860 439-5265 Fax: 860 439-2871
P Think before you print

CONFIDENTIALITY: This email (including any attachments) may contain confidential,
proprietary and privileged information, and unauthorized disclosure or use is 
prohibited. If you received this email in error, please notify the sender and delete
this email from your system.

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Andrew Tillinghast

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Ok, sorry to be confusing. Let me clarify.

We're running on JBoss 5.1.0GA and for other applications we need JBoss rather then Tomcat, would prefer 5.X could possibly function under 4.2.x also seems like going 4.2 would just delay the issue.

I've got CAS installed with OW, LDAP etc, but no persistence if I use the <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.DefaultTicketRegistry" /> the CAS service is working fine, actually deployed in production this way right now and working for the few hundred students that check email during the summer.

We'll be "casifying" additional applications and use volume will increase as the summer end so we'll need High Availablity/Clustering so I'm attempting to establish persistence, I've reviewed the persistence overview here: http://www.ja-sig.org/wiki/display/CASUM/Service+Availability+Strategies and I've chosen to go with JPA because we have an existing clustered MS SQL server on our backend.

I've followed through the steps in the JPA instructions here: http://www.ja-sig.org/wiki/display/CASUM/JpaTicketRegistry

However, when attempting to follow those instructions CAS startup would fail with "Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/lookup/DataSourceLookup"

This error came up even though I tried different datasources and I made sure that the proper jars were in my classpath. I tried using the SQLJDBC drivers and data source first and then also with the jtds ones. All of them came back with the DataSourceLookup error.

Example of one of the datasource beans I tried:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="net.sourceforge.jtds.jdbc.Driver"
p:url="jdbc:jtds:sqlserver://devdb.conncoll.edu:1433;database=CAS;"
         p:username="xxxxxx"
     p:password="******" />

After some more research I found information about connecting the JPA persistence to the JBoss JTA persistence. http://www.swview.org/node/214
I changed my ticketRegistry.xml as per the my previous list posting.
Now CAS starts error free and validates login but fails on creating the ticket when login is successful  the text of the error leads me to think that the database connection is established but the tables aren't there when trying to save the ticket.

Despite the error free startup I'm not seeing tables for CAS being created in the jboss databse (no error in CAS.log either.) 

CAS.log shows the following error on Clean, which is essentially the same error as ticket create:

2009-06-24 11:53:38,841 INFO [org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] - Starting cleaning of expired tickets from ticket registry at [Wed Jun 24 11:53:38 EDT 2009]
2009-06-24 11:53:39,177 ERROR [org.quartz.core.JobRunShell] - Job DEFAULT.jobDetailTicketRegistryCleaner threw an unhandled Exception: 
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'clean' on target class [class $Proxy292] failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:269)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:271)
at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
....

I fully admit that I may be misreading the error,  and that the JNDI/JTA/JPA connection might be failing and just not generating any warnings or error. While I am a reasonably skilled programer I am far from a JAVA guru. 
At this point I am begging for assistance with persistence I am not restricted to JPA as the solution it just seemed the most reasonable clustering solution for our environment with already having established an HA SQL server for our other apps on the same server.

-Andrew 

On Jun 24, 2009, at 9:49 AM, Scott Battaglia wrote:

You're confusing me. ;-)  What's the actual problem?  Last time you said the tables hadn't been created now you're saying the dataource isn't working.




On Wed, Jun 24, 2009 at 9:44 AM, Andrew Tillinghast <[hidden email]> wrote:
I added that line, and I changed the JTA reference so that it's a datasource, right now the CAS service starts without any errors and it correctly authenticates the user, when the user successfully logs in however CAS errors out with:

09:36:00,146 ERROR [[cas]] Servlet.service() for servlet cas threw exception
java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:223)
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.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:358)
at $Proxy298.persist(Unknown Source)
at org.springframework.orm.jpa.JpaTemplate$5.doInJpa(JpaTemplate.java:268)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184)
at org.springframework.orm.jpa.JpaTemplate.persist(JpaTemplate.java:266)
at org.jasig.cas.ticket.registry.JpaTicketRegistry.addTicket(JpaTicketRegistry.java:48)
at org.jasig.cas.CentralAuthenticationServiceImpl.createTicketGrantingTicket(CentralAuthenticationServiceImpl.java:425)
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:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
....

Here is my ticketRegistry,xml now:

<?xml version="1.0" encoding="UTF-8"?>
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
<!-- JPA attached to jboss persistence unit -->
    <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="dataSource" ref="dataSource"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="generateDdl" value="true" />
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
<prop key="hibernate.transaction.auto_close_session">true</prop>
<prop key="hibernate.current_session_context_class">jta</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
</props>
</property>
    </bean>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:/DefaultDS"></property>
</bean>

<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName" value="java:/TransactionManager" />
<property name="autodetectUserTransaction" value="false" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
        <!-- TICKET REGISTRY CLEANER --> <bean id="ticketRegistryCleaner" class="org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner" p:ticketRegistry-ref="ticketRegistry" /> <bean id="jobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean" p:targetObject-ref="ticketRegistryCleaner" p:targetMethod="clean" /> <bean id="triggerJobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.SimpleTriggerBean" p:jobDetail-ref="jobDetailTicketRegistryCleaner" p:startDelay="20000" p:repeatInterval="5000000" /> <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref local="triggerJobDetailTicketRegistryCleaner" /> </list> </property> </bean> </beans>

At this point I have everything else working except persistence/clustering any help at all would be great, or help figuring out why the data source wouldn't work when I tried normal JPA instead of the JTA connection.


-Andrew 


-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Scott Battaglia-2

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
I'm not sure why your tables aren't being created.  The typical reason is that the database user doesn't have the appropriate permissions.  Can you drop the WAR file in a simple Tomcat instance just to see if it works from there? (its probably a pain in the butt to do that, but I'm not familiar enough with JBoss to tell you that something is wrong)



On Wed, Jun 24, 2009 at 12:23 PM, Andrew Tillinghast <[hidden email]> wrote:
Ok, sorry to be confusing. Let me clarify.

We're running on JBoss 5.1.0GA and for other applications we need JBoss rather then Tomcat, would prefer 5.X could possibly function under 4.2.x also seems like going 4.2 would just delay the issue.

I've got CAS installed with OW, LDAP etc, but no persistence if I use the <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.DefaultTicketRegistry" /> the CAS service is working fine, actually deployed in production this way right now and working for the few hundred students that check email during the summer.

We'll be "casifying" additional applications and use volume will increase as the summer end so we'll need High Availablity/Clustering so I'm attempting to establish persistence, I've reviewed the persistence overview here: http://www.ja-sig.org/wiki/display/CASUM/Service+Availability+Strategies and I've chosen to go with JPA because we have an existing clustered MS SQL server on our backend.

I've followed through the steps in the JPA instructions here: http://www.ja-sig.org/wiki/display/CASUM/JpaTicketRegistry

However, when attempting to follow those instructions CAS startup would fail with "Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/lookup/DataSourceLookup"

This error came up even though I tried different datasources and I made sure that the proper jars were in my classpath. I tried using the SQLJDBC drivers and data source first and then also with the jtds ones. All of them came back with the DataSourceLookup error.

Example of one of the datasource beans I tried:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="net.sourceforge.jtds.jdbc.Driver"
p:url="jdbc:jtds:sqlserver://devdb.conncoll.edu:1433;database=CAS;"
         p:username="xxxxxx"
     p:password="******" />

After some more research I found information about connecting the JPA persistence to the JBoss JTA persistence. http://www.swview.org/node/214
I changed my ticketRegistry.xml as per the my previous list posting.
Now CAS starts error free and validates login but fails on creating the ticket when login is successful  the text of the error leads me to think that the database connection is established but the tables aren't there when trying to save the ticket.

Despite the error free startup I'm not seeing tables for CAS being created in the jboss databse (no error in CAS.log either.) 

CAS.log shows the following error on Clean, which is essentially the same error as ticket create:

2009-06-24 11:53:38,841 INFO [org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] - Starting cleaning of expired tickets from ticket registry at [Wed Jun 24 11:53:38 EDT 2009]
2009-06-24 11:53:39,177 ERROR [org.quartz.core.JobRunShell] - Job DEFAULT.jobDetailTicketRegistryCleaner threw an unhandled Exception: 
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'clean' on target class [class $Proxy292] failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:269)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:271)
at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
....

I fully admit that I may be misreading the error,  and that the JNDI/JTA/JPA connection might be failing and just not generating any warnings or error. While I am a reasonably skilled programer I am far from a JAVA guru. 
At this point I am begging for assistance with persistence I am not restricted to JPA as the solution it just seemed the most reasonable clustering solution for our environment with already having established an HA SQL server for our other apps on the same server.

-Andrew 

On Jun 24, 2009, at 9:49 AM, Scott Battaglia wrote:

You're confusing me. ;-)  What's the actual problem?  Last time you said the tables hadn't been created now you're saying the dataource isn't working.




On Wed, Jun 24, 2009 at 9:44 AM, Andrew Tillinghast <[hidden email]> wrote:
I added that line, and I changed the JTA reference so that it's a datasource, right now the CAS service starts without any errors and it correctly authenticates the user, when the user successfully logs in however CAS errors out with:

09:36:00,146 ERROR [[cas]] Servlet.service() for servlet cas threw exception
java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:223)
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.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:358)
at $Proxy298.persist(Unknown Source)
at org.springframework.orm.jpa.JpaTemplate$5.doInJpa(JpaTemplate.java:268)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184)
at org.springframework.orm.jpa.JpaTemplate.persist(JpaTemplate.java:266)
at org.jasig.cas.ticket.registry.JpaTicketRegistry.addTicket(JpaTicketRegistry.java:48)
at org.jasig.cas.CentralAuthenticationServiceImpl.createTicketGrantingTicket(CentralAuthenticationServiceImpl.java:425)
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:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
....

Here is my ticketRegistry,xml now:

<?xml version="1.0" encoding="UTF-8"?>
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
<!-- JPA attached to jboss persistence unit -->
    <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="dataSource" ref="dataSource"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="generateDdl" value="true" />
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
<prop key="hibernate.transaction.auto_close_session">true</prop>
<prop key="hibernate.current_session_context_class">jta</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
</props>
</property>
    </bean>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:/DefaultDS"></property>
</bean>

<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName" value="java:/TransactionManager" />
<property name="autodetectUserTransaction" value="false" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
        <!-- TICKET REGISTRY CLEANER --> <bean id="ticketRegistryCleaner" class="org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner" p:ticketRegistry-ref="ticketRegistry" /> <bean id="jobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean" p:targetObject-ref="ticketRegistryCleaner" p:targetMethod="clean" /> <bean id="triggerJobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.SimpleTriggerBean" p:jobDetail-ref="jobDetailTicketRegistryCleaner" p:startDelay="20000" p:repeatInterval="5000000" /> <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref local="triggerJobDetailTicketRegistryCleaner" /> </list> </property> </bean> </beans>

At this point I have everything else working except persistence/clustering any help at all would be great, or help figuring out why the data source wouldn't work when I tried normal JPA instead of the JTA connection.


-Andrew 


-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Andrew Tillinghast

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
I'm not sure either, I'm going to step back through and see what I can find.


This appears to set CAS to use Jboss as the authentication source.

Doing a little extrapolation, if I enabled JBoss to authenticate against my ldap, with the JBoss SSO/Persistence configured behind the scenes and then tied CAS on that wouldn't I end up with persistent CAS and the added benefit  of single sign on to the JBoss components?

A JBoss LDap guide being available here: http://docs.hp.com/en/5992-3330/ch02s06.html

-Andrew 

On Jun 24, 2009, at 10:20 PM, Scott Battaglia wrote:

I'm not sure why your tables aren't being created.  The typical reason is that the database user doesn't have the appropriate permissions.  Can you drop the WAR file in a simple Tomcat instance just to see if it works from there? (its probably a pain in the butt to do that, but I'm not familiar enough with JBoss to tell you that something is wrong)



On Wed, Jun 24, 2009 at 12:23 PM, Andrew Tillinghast <[hidden email]> wrote:
Ok, sorry to be confusing. Let me clarify.

We're running on JBoss 5.1.0GA and for other applications we need JBoss rather then Tomcat, would prefer 5.X could possibly function under 4.2.x also seems like going 4.2 would just delay the issue.

I've got CAS installed with OW, LDAP etc, but no persistence if I use the <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.DefaultTicketRegistry" /> the CAS service is working fine, actually deployed in production this way right now and working for the few hundred students that check email during the summer.

We'll be "casifying" additional applications and use volume will increase as the summer end so we'll need High Availablity/Clustering so I'm attempting to establish persistence, I've reviewed the persistence overview here: http://www.ja-sig.org/wiki/display/CASUM/Service+Availability+Strategies and I've chosen to go with JPA because we have an existing clustered MS SQL server on our backend.

I've followed through the steps in the JPA instructions here: http://www.ja-sig.org/wiki/display/CASUM/JpaTicketRegistry

However, when attempting to follow those instructions CAS startup would fail with "Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/lookup/DataSourceLookup"

This error came up even though I tried different datasources and I made sure that the proper jars were in my classpath. I tried using the SQLJDBC drivers and data source first and then also with the jtds ones. All of them came back with the DataSourceLookup error.

Example of one of the datasource beans I tried:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="net.sourceforge.jtds.jdbc.Driver"
p:url="jdbc:jtds:sqlserver://devdb.conncoll.edu:1433;database=CAS;"
         p:username="xxxxxx"
     p:password="******" />

After some more research I found information about connecting the JPA persistence to the JBoss JTA persistence. http://www.swview.org/node/214
I changed my ticketRegistry.xml as per the my previous list posting.
Now CAS starts error free and validates login but fails on creating the ticket when login is successful  the text of the error leads me to think that the database connection is established but the tables aren't there when trying to save the ticket.

Despite the error free startup I'm not seeing tables for CAS being created in the jboss databse (no error in CAS.log either.) 

CAS.log shows the following error on Clean, which is essentially the same error as ticket create:

2009-06-24 11:53:38,841 INFO [org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] - Starting cleaning of expired tickets from ticket registry at [Wed Jun 24 11:53:38 EDT 2009]
2009-06-24 11:53:39,177 ERROR [org.quartz.core.JobRunShell] - Job DEFAULT.jobDetailTicketRegistryCleaner threw an unhandled Exception: 
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'clean' on target class [class $Proxy292] failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:269)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:271)
at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
....

I fully admit that I may be misreading the error,  and that the JNDI/JTA/JPA connection might be failing and just not generating any warnings or error. While I am a reasonably skilled programer I am far from a JAVA guru. 
At this point I am begging for assistance with persistence I am not restricted to JPA as the solution it just seemed the most reasonable clustering solution for our environment with already having established an HA SQL server for our other apps on the same server.

-Andrew 

On Jun 24, 2009, at 9:49 AM, Scott Battaglia wrote:

You're confusing me. ;-)  What's the actual problem?  Last time you said the tables hadn't been created now you're saying the dataource isn't working.




On Wed, Jun 24, 2009 at 9:44 AM, Andrew Tillinghast <[hidden email]> wrote:
I added that line, and I changed the JTA reference so that it's a datasource, right now the CAS service starts without any errors and it correctly authenticates the user, when the user successfully logs in however CAS errors out with:

09:36:00,146 ERROR [[cas]] Servlet.service() for servlet cas threw exception
java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:223)
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.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:358)
at $Proxy298.persist(Unknown Source)
at org.springframework.orm.jpa.JpaTemplate$5.doInJpa(JpaTemplate.java:268)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184)
at org.springframework.orm.jpa.JpaTemplate.persist(JpaTemplate.java:266)
at org.jasig.cas.ticket.registry.JpaTicketRegistry.addTicket(JpaTicketRegistry.java:48)
at org.jasig.cas.CentralAuthenticationServiceImpl.createTicketGrantingTicket(CentralAuthenticationServiceImpl.java:425)
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:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
....

Here is my ticketRegistry,xml now:

<?xml version="1.0" encoding="UTF-8"?>
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
<!-- JPA attached to jboss persistence unit -->
    <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="dataSource" ref="dataSource"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="generateDdl" value="true" />
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
<prop key="hibernate.transaction.auto_close_session">true</prop>
<prop key="hibernate.current_session_context_class">jta</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
</props>
</property>
    </bean>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:/DefaultDS"></property>
</bean>

<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName" value="java:/TransactionManager" />
<property name="autodetectUserTransaction" value="false" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
        <!-- TICKET REGISTRY CLEANER --> <bean id="ticketRegistryCleaner" class="org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner" p:ticketRegistry-ref="ticketRegistry" /> <bean id="jobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean" p:targetObject-ref="ticketRegistryCleaner" p:targetMethod="clean" /> <bean id="triggerJobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.SimpleTriggerBean" p:jobDetail-ref="jobDetailTicketRegistryCleaner" p:startDelay="20000" p:repeatInterval="5000000" /> <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref local="triggerJobDetailTicketRegistryCleaner" /> </list> </property> </bean> </beans>

At this point I have everything else working except persistence/clustering any help at all would be great, or help figuring out why the data source wouldn't work when I tried normal JPA instead of the JTA connection.


-Andrew 


-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Andrew Tillinghast

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Scott Battaglia-2
Some javascript/style in this post has been disabled (why?)
Problem with dropping it into tomcat, tomcat would have the JTA/persistence/JNDI for this to attach to.

I've reconstructed my maven build to build from CAS 3.3.3

I've created a second data source for the CAS persistence and updated the ticket registry for spring 2.5, still getting an error that seems to indicate the tables don't exist (still no tables in the database either) there aren't any error indicating that the table build failed. 

Error message:
2009-07-03 15:09:11,923 INFO [org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] - Starting cleaning of expired tickets from ticket registry at [Fri Jul 03 15:09:11 GMT 2009]
2009-07-03 15:09:12,407 ERROR [org.quartz.core.JobRunShell] - Job DEFAULT.jobDetailTicketRegistryCleaner threw an unhandled Exception: 
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'clean' on target class [class org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:269)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:271)
at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
at org.springframework.orm.jpa.JpaAccessor.translateIfNecessary(JpaAccessor.java:152)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:189)
at org.springframework.orm.jpa.JpaTemplate.executeFind(JpaTemplate.java:151)
at org.springframework.orm.jpa.JpaTemplate.find(JpaTemplate.java:311)
at org.springframework.orm.jpa.JpaTemplate.find(JpaTemplate.java:307)
at org.jasig.cas.ticket.registry.JpaTicketRegistry.getTickets(JpaTicketRegistry.java:117)
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)

TicketRegistry.xml
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
<!-- JPA attached to jboss persistence unit -->
    <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<jee:jndi-lookup id="entityManagerFactory" jndi-name="java:CasPersistence"/>
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" />
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>

persistence.xml
version="1.0">
<persistence-unit name="CasPersistence" transaction-type="JTA">
     <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>java:CAS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:CasPersistence"/> 
</properties>
</persistence-unit>
</persistence>

cas-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>CAS</jndi-name>
    <connection-url>jdbc:sqlserver://devdb.conncoll.edu:1433;databaseName=CAS</connection-url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</driver-class>
    <user-name>xxxxx</user-name>
    <password>*****</password>
<check-valid-connection-sql>SELECT 1 FROM sysobjects</check-valid-connection-sql>
<metadata>
<type-mapping>MS SQLSERVER2000</type-mapping>
</metadata>
  </local-tx-datasource>
</datasources>

One idea I'd like to try, if anyone has the SQL script for the table create I want to see if the persistence functions when the tables exist. 

-Andrew 

On Jun 24, 2009, at 10:20 PM, Scott Battaglia wrote:

I'm not sure why your tables aren't being created.  The typical reason is that the database user doesn't have the appropriate permissions.  Can you drop the WAR file in a simple Tomcat instance just to see if it works from there? (its probably a pain in the butt to do that, but I'm not familiar enough with JBoss to tell you that something is wrong)



On Wed, Jun 24, 2009 at 12:23 PM, Andrew Tillinghast <[hidden email]> wrote:
Ok, sorry to be confusing. Let me clarify.

We're running on JBoss 5.1.0GA and for other applications we need JBoss rather then Tomcat, would prefer 5.X could possibly function under 4.2.x also seems like going 4.2 would just delay the issue.

I've got CAS installed with OW, LDAP etc, but no persistence if I use the <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.DefaultTicketRegistry" /> the CAS service is working fine, actually deployed in production this way right now and working for the few hundred students that check email during the summer.

We'll be "casifying" additional applications and use volume will increase as the summer end so we'll need High Availablity/Clustering so I'm attempting to establish persistence, I've reviewed the persistence overview here: http://www.ja-sig.org/wiki/display/CASUM/Service+Availability+Strategies and I've chosen to go with JPA because we have an existing clustered MS SQL server on our backend.

I've followed through the steps in the JPA instructions here: http://www.ja-sig.org/wiki/display/CASUM/JpaTicketRegistry

However, when attempting to follow those instructions CAS startup would fail with "Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/lookup/DataSourceLookup"

This error came up even though I tried different datasources and I made sure that the proper jars were in my classpath. I tried using the SQLJDBC drivers and data source first and then also with the jtds ones. All of them came back with the DataSourceLookup error.

Example of one of the datasource beans I tried:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="net.sourceforge.jtds.jdbc.Driver"
p:url="jdbc:jtds:sqlserver://devdb.conncoll.edu:1433;database=CAS;"
         p:username="xxxxxx"
     p:password="******" />

After some more research I found information about connecting the JPA persistence to the JBoss JTA persistence. http://www.swview.org/node/214
I changed my ticketRegistry.xml as per the my previous list posting.
Now CAS starts error free and validates login but fails on creating the ticket when login is successful  the text of the error leads me to think that the database connection is established but the tables aren't there when trying to save the ticket.

Despite the error free startup I'm not seeing tables for CAS being created in the jboss databse (no error in CAS.log either.) 

CAS.log shows the following error on Clean, which is essentially the same error as ticket create:

2009-06-24 11:53:38,841 INFO [org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] - Starting cleaning of expired tickets from ticket registry at [Wed Jun 24 11:53:38 EDT 2009]
2009-06-24 11:53:39,177 ERROR [org.quartz.core.JobRunShell] - Job DEFAULT.jobDetailTicketRegistryCleaner threw an unhandled Exception: 
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'clean' on target class [class $Proxy292] failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:269)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:271)
at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
....

I fully admit that I may be misreading the error,  and that the JNDI/JTA/JPA connection might be failing and just not generating any warnings or error. While I am a reasonably skilled programer I am far from a JAVA guru. 
At this point I am begging for assistance with persistence I am not restricted to JPA as the solution it just seemed the most reasonable clustering solution for our environment with already having established an HA SQL server for our other apps on the same server.

-Andrew 

On Jun 24, 2009, at 9:49 AM, Scott Battaglia wrote:

You're confusing me. ;-)  What's the actual problem?  Last time you said the tables hadn't been created now you're saying the dataource isn't working.




On Wed, Jun 24, 2009 at 9:44 AM, Andrew Tillinghast <[hidden email]> wrote:
I added that line, and I changed the JTA reference so that it's a datasource, right now the CAS service starts without any errors and it correctly authenticates the user, when the user successfully logs in however CAS errors out with:

09:36:00,146 ERROR [[cas]] Servlet.service() for servlet cas threw exception
java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:223)
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.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:358)
at $Proxy298.persist(Unknown Source)
at org.springframework.orm.jpa.JpaTemplate$5.doInJpa(JpaTemplate.java:268)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184)
at org.springframework.orm.jpa.JpaTemplate.persist(JpaTemplate.java:266)
at org.jasig.cas.ticket.registry.JpaTicketRegistry.addTicket(JpaTicketRegistry.java:48)
at org.jasig.cas.CentralAuthenticationServiceImpl.createTicketGrantingTicket(CentralAuthenticationServiceImpl.java:425)
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:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
....

Here is my ticketRegistry,xml now:

<?xml version="1.0" encoding="UTF-8"?>
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
<!-- JPA attached to jboss persistence unit -->
    <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="dataSource" ref="dataSource"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="generateDdl" value="true" />
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
<prop key="hibernate.transaction.auto_close_session">true</prop>
<prop key="hibernate.current_session_context_class">jta</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
</props>
</property>
    </bean>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:/DefaultDS"></property>
</bean>

<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName" value="java:/TransactionManager" />
<property name="autodetectUserTransaction" value="false" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
        <!-- TICKET REGISTRY CLEANER --> <bean id="ticketRegistryCleaner" class="org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner" p:ticketRegistry-ref="ticketRegistry" /> <bean id="jobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean" p:targetObject-ref="ticketRegistryCleaner" p:targetMethod="clean" /> <bean id="triggerJobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.SimpleTriggerBean" p:jobDetail-ref="jobDetailTicketRegistryCleaner" p:startDelay="20000" p:repeatInterval="5000000" /> <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref local="triggerJobDetailTicketRegistryCleaner" /> </list> </property> </bean> </beans>

At this point I have everything else working except persistence/clustering any help at all would be great, or help figuring out why the data source wouldn't work when I tried normal JPA instead of the JTA connection.


-Andrew 


-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Scott Battaglia-2

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
If I remember I'll try and create them tomorrow do a mysql dump.  Feel free to shoot me an email to remind me ;-)


On Fri, Jul 3, 2009 at 11:31 AM, Andrew Tillinghast <[hidden email]> wrote:
Problem with dropping it into tomcat, tomcat would have the JTA/persistence/JNDI for this to attach to.

I've reconstructed my maven build to build from CAS 3.3.3

I've created a second data source for the CAS persistence and updated the ticket registry for spring 2.5, still getting an error that seems to indicate the tables don't exist (still no tables in the database either) there aren't any error indicating that the table build failed. 

Error message:
2009-07-03 15:09:11,923 INFO [org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] - Starting cleaning of expired tickets from ticket registry at [Fri Jul 03 15:09:11 GMT 2009]
2009-07-03 15:09:12,407 ERROR [org.quartz.core.JobRunShell] - Job DEFAULT.jobDetailTicketRegistryCleaner threw an unhandled Exception: 
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'clean' on target class [class org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:269)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:271)
at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
at org.springframework.orm.jpa.JpaAccessor.translateIfNecessary(JpaAccessor.java:152)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:189)
at org.springframework.orm.jpa.JpaTemplate.executeFind(JpaTemplate.java:151)
at org.springframework.orm.jpa.JpaTemplate.find(JpaTemplate.java:311)
at org.springframework.orm.jpa.JpaTemplate.find(JpaTemplate.java:307)
at org.jasig.cas.ticket.registry.JpaTicketRegistry.getTickets(JpaTicketRegistry.java:117)
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)

TicketRegistry.xml
<!-- JPA attached to jboss persistence unit -->
    <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<jee:jndi-lookup id="entityManagerFactory" jndi-name="java:CasPersistence"/>
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" />
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>

persistence.xml
version="1.0">
<persistence-unit name="CasPersistence" transaction-type="JTA">
     <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>java:CAS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:CasPersistence"/> 
</properties>
</persistence-unit>
</persistence>

cas-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>CAS</jndi-name>
    <connection-url>jdbc:sqlserver://devdb.conncoll.edu:1433;databaseName=CAS</connection-url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</driver-class>
    <user-name>xxxxx</user-name>
    <password>*****</password>
<check-valid-connection-sql>SELECT 1 FROM sysobjects</check-valid-connection-sql>
<metadata>
<type-mapping>MS SQLSERVER2000</type-mapping>
</metadata>
  </local-tx-datasource>
</datasources>

One idea I'd like to try, if anyone has the SQL script for the table create I want to see if the persistence functions when the tables exist. 

-Andrew 

On Jun 24, 2009, at 10:20 PM, Scott Battaglia wrote:

I'm not sure why your tables aren't being created.  The typical reason is that the database user doesn't have the appropriate permissions.  Can you drop the WAR file in a simple Tomcat instance just to see if it works from there? (its probably a pain in the butt to do that, but I'm not familiar enough with JBoss to tell you that something is wrong)



On Wed, Jun 24, 2009 at 12:23 PM, Andrew Tillinghast <[hidden email]> wrote:
Ok, sorry to be confusing. Let me clarify.

We're running on JBoss 5.1.0GA and for other applications we need JBoss rather then Tomcat, would prefer 5.X could possibly function under 4.2.x also seems like going 4.2 would just delay the issue.

I've got CAS installed with OW, LDAP etc, but no persistence if I use the <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.DefaultTicketRegistry" /> the CAS service is working fine, actually deployed in production this way right now and working for the few hundred students that check email during the summer.

We'll be "casifying" additional applications and use volume will increase as the summer end so we'll need High Availablity/Clustering so I'm attempting to establish persistence, I've reviewed the persistence overview here: http://www.ja-sig.org/wiki/display/CASUM/Service+Availability+Strategies and I've chosen to go with JPA because we have an existing clustered MS SQL server on our backend.

I've followed through the steps in the JPA instructions here: http://www.ja-sig.org/wiki/display/CASUM/JpaTicketRegistry

However, when attempting to follow those instructions CAS startup would fail with "Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/lookup/DataSourceLookup"

This error came up even though I tried different datasources and I made sure that the proper jars were in my classpath. I tried using the SQLJDBC drivers and data source first and then also with the jtds ones. All of them came back with the DataSourceLookup error.

Example of one of the datasource beans I tried:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="net.sourceforge.jtds.jdbc.Driver"
p:url="jdbc:jtds:sqlserver://devdb.conncoll.edu:1433;database=CAS;"
         p:username="xxxxxx"
     p:password="******" />

After some more research I found information about connecting the JPA persistence to the JBoss JTA persistence. http://www.swview.org/node/214
I changed my ticketRegistry.xml as per the my previous list posting.
Now CAS starts error free and validates login but fails on creating the ticket when login is successful  the text of the error leads me to think that the database connection is established but the tables aren't there when trying to save the ticket.

Despite the error free startup I'm not seeing tables for CAS being created in the jboss databse (no error in CAS.log either.) 

CAS.log shows the following error on Clean, which is essentially the same error as ticket create:

2009-06-24 11:53:38,841 INFO [org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] - Starting cleaning of expired tickets from ticket registry at [Wed Jun 24 11:53:38 EDT 2009]
2009-06-24 11:53:39,177 ERROR [org.quartz.core.JobRunShell] - Job DEFAULT.jobDetailTicketRegistryCleaner threw an unhandled Exception: 
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'clean' on target class [class $Proxy292] failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:269)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:271)
at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
....

I fully admit that I may be misreading the error,  and that the JNDI/JTA/JPA connection might be failing and just not generating any warnings or error. While I am a reasonably skilled programer I am far from a JAVA guru. 
At this point I am begging for assistance with persistence I am not restricted to JPA as the solution it just seemed the most reasonable clustering solution for our environment with already having established an HA SQL server for our other apps on the same server.

-Andrew 

On Jun 24, 2009, at 9:49 AM, Scott Battaglia wrote:

You're confusing me. ;-)  What's the actual problem?  Last time you said the tables hadn't been created now you're saying the dataource isn't working.




On Wed, Jun 24, 2009 at 9:44 AM, Andrew Tillinghast <[hidden email]> wrote:
I added that line, and I changed the JTA reference so that it's a datasource, right now the CAS service starts without any errors and it correctly authenticates the user, when the user successfully logs in however CAS errors out with:

09:36:00,146 ERROR [[cas]] Servlet.service() for servlet cas threw exception
java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:223)
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.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:358)
at $Proxy298.persist(Unknown Source)
at org.springframework.orm.jpa.JpaTemplate$5.doInJpa(JpaTemplate.java:268)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184)
at org.springframework.orm.jpa.JpaTemplate.persist(JpaTemplate.java:266)
at org.jasig.cas.ticket.registry.JpaTicketRegistry.addTicket(JpaTicketRegistry.java:48)
at org.jasig.cas.CentralAuthenticationServiceImpl.createTicketGrantingTicket(CentralAuthenticationServiceImpl.java:425)
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:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
....

Here is my ticketRegistry,xml now:

<?xml version="1.0" encoding="UTF-8"?>
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
<!-- JPA attached to jboss persistence unit -->
    <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="dataSource" ref="dataSource"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="generateDdl" value="true" />
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
<prop key="hibernate.transaction.auto_close_session">true</prop>
<prop key="hibernate.current_session_context_class">jta</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
</props>
</property>
    </bean>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:/DefaultDS"></property>
</bean>

<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName" value="java:/TransactionManager" />
<property name="autodetectUserTransaction" value="false" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
        <!-- TICKET REGISTRY CLEANER --> <bean id="ticketRegistryCleaner" class="org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner" p:ticketRegistry-ref="ticketRegistry" /> <bean id="jobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean" p:targetObject-ref="ticketRegistryCleaner" p:targetMethod="clean" /> <bean id="triggerJobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.SimpleTriggerBean" p:jobDetail-ref="jobDetailTicketRegistryCleaner" p:startDelay="20000" p:repeatInterval="5000000" /> <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref local="triggerJobDetailTicketRegistryCleaner" /> </list> </property> </bean> </beans>

At this point I have everything else working except persistence/clustering any help at all would be great, or help figuring out why the data source wouldn't work when I tried normal JPA instead of the JTA connection.


-Andrew 


-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Andrew Tillinghast

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Going to ask again, could someone send me the create table script for the CAS JPA persistence tables?

-Andrew 

On Jul 8, 2009, at 11:04 PM, Scott Battaglia wrote:

I've been pretty busy at work lately.  I'll try and do it tomorrow.

Cheers,
Scott


On Wed, Jul 8, 2009 at 5:18 PM, Andrew Tillinghast <[hidden email]> wrote:
Another reminder email that you were going to send an sql dump.

-Andrew 

On Jul 6, 2009, at 10:23 PM, Scott Battaglia wrote:

If I remember I'll try and create them tomorrow do a mysql dump.  Feel free to shoot me an email to remind me ;-)


On Fri, Jul 3, 2009 at 11:31 AM, Andrew Tillinghast <[hidden email]> wrote:
Problem with dropping it into tomcat, tomcat would have the JTA/persistence/JNDI for this to attach to.

I've reconstructed my maven build to build from CAS 3.3.3

I've created a second data source for the CAS persistence and updated the ticket registry for spring 2.5, still getting an error that seems to indicate the tables don't exist (still no tables in the database either) there aren't any error indicating that the table build failed. 

Error message:
2009-07-03 15:09:11,923 INFO [org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] - Starting cleaning of expired tickets from ticket registry at [Fri Jul 03 15:09:11 GMT 2009]
2009-07-03 15:09:12,407 ERROR [org.quartz.core.JobRunShell] - Job DEFAULT.jobDetailTicketRegistryCleaner threw an unhandled Exception: 
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'clean' on target class [class org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:269)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:271)
at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
at org.springframework.orm.jpa.JpaAccessor.translateIfNecessary(JpaAccessor.java:152)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:189)
at org.springframework.orm.jpa.JpaTemplate.executeFind(JpaTemplate.java:151)
at org.springframework.orm.jpa.JpaTemplate.find(JpaTemplate.java:311)
at org.springframework.orm.jpa.JpaTemplate.find(JpaTemplate.java:307)
at org.jasig.cas.ticket.registry.JpaTicketRegistry.getTickets(JpaTicketRegistry.java:117)
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)

TicketRegistry.xml
<!-- JPA attached to jboss persistence unit -->
    <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<jee:jndi-lookup id="entityManagerFactory" jndi-name="java:CasPersistence"/>
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" />
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>

persistence.xml
version="1.0">
<persistence-unit name="CasPersistence" transaction-type="JTA">
     <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>java:CAS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:CasPersistence"/> 
</properties>
</persistence-unit>
</persistence>

cas-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>CAS</jndi-name>
    <connection-url>jdbc:sqlserver://devdb.conncoll.edu:1433;databaseName=CAS</connection-url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</driver-class>
    <user-name>xxxxx</user-name>
    <password>*****</password>
<check-valid-connection-sql>SELECT 1 FROM sysobjects</check-valid-connection-sql>
<metadata>
<type-mapping>MS SQLSERVER2000</type-mapping>
</metadata>
  </local-tx-datasource>
</datasources>

One idea I'd like to try, if anyone has the SQL script for the table create I want to see if the persistence functions when the tables exist. 

-Andrew 

On Jun 24, 2009, at 10:20 PM, Scott Battaglia wrote:

I'm not sure why your tables aren't being created.  The typical reason is that the database user doesn't have the appropriate permissions.  Can you drop the WAR file in a simple Tomcat instance just to see if it works from there? (its probably a pain in the butt to do that, but I'm not familiar enough with JBoss to tell you that something is wrong)



On Wed, Jun 24, 2009 at 12:23 PM, Andrew Tillinghast <[hidden email]> wrote:
Ok, sorry to be confusing. Let me clarify.

We're running on JBoss 5.1.0GA and for other applications we need JBoss rather then Tomcat, would prefer 5.X could possibly function under 4.2.x also seems like going 4.2 would just delay the issue.

I've got CAS installed with OW, LDAP etc, but no persistence if I use the <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.DefaultTicketRegistry" /> the CAS service is working fine, actually deployed in production this way right now and working for the few hundred students that check email during the summer.

We'll be "casifying" additional applications and use volume will increase as the summer end so we'll need High Availablity/Clustering so I'm attempting to establish persistence, I've reviewed the persistence overview here: http://www.ja-sig.org/wiki/display/CASUM/Service+Availability+Strategies and I've chosen to go with JPA because we have an existing clustered MS SQL server on our backend.

I've followed through the steps in the JPA instructions here: http://www.ja-sig.org/wiki/display/CASUM/JpaTicketRegistry

However, when attempting to follow those instructions CAS startup would fail with "Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/lookup/DataSourceLookup"

This error came up even though I tried different datasources and I made sure that the proper jars were in my classpath. I tried using the SQLJDBC drivers and data source first and then also with the jtds ones. All of them came back with the DataSourceLookup error.

Example of one of the datasource beans I tried:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="net.sourceforge.jtds.jdbc.Driver"
p:url="jdbc:jtds:sqlserver://devdb.conncoll.edu:1433;database=CAS;"
         p:username="xxxxxx"
     p:password="******" />

After some more research I found information about connecting the JPA persistence to the JBoss JTA persistence. http://www.swview.org/node/214
I changed my ticketRegistry.xml as per the my previous list posting.
Now CAS starts error free and validates login but fails on creating the ticket when login is successful  the text of the error leads me to think that the database connection is established but the tables aren't there when trying to save the ticket.

Despite the error free startup I'm not seeing tables for CAS being created in the jboss databse (no error in CAS.log either.) 

CAS.log shows the following error on Clean, which is essentially the same error as ticket create:

2009-06-24 11:53:38,841 INFO [org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] - Starting cleaning of expired tickets from ticket registry at [Wed Jun 24 11:53:38 EDT 2009]
2009-06-24 11:53:39,177 ERROR [org.quartz.core.JobRunShell] - Job DEFAULT.jobDetailTicketRegistryCleaner threw an unhandled Exception: 
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'clean' on target class [class $Proxy292] failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:269)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:271)
at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
....

I fully admit that I may be misreading the error,  and that the JNDI/JTA/JPA connection might be failing and just not generating any warnings or error. While I am a reasonably skilled programer I am far from a JAVA guru. 
At this point I am begging for assistance with persistence I am not restricted to JPA as the solution it just seemed the most reasonable clustering solution for our environment with already having established an HA SQL server for our other apps on the same server.

-Andrew 

On Jun 24, 2009, at 9:49 AM, Scott Battaglia wrote:

You're confusing me. ;-)  What's the actual problem?  Last time you said the tables hadn't been created now you're saying the dataource isn't working.




On Wed, Jun 24, 2009 at 9:44 AM, Andrew Tillinghast <[hidden email]> wrote:
I added that line, and I changed the JTA reference so that it's a datasource, right now the CAS service starts without any errors and it correctly authenticates the user, when the user successfully logs in however CAS errors out with:

09:36:00,146 ERROR [[cas]] Servlet.service() for servlet cas threw exception
java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:223)
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.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:358)
at $Proxy298.persist(Unknown Source)
at org.springframework.orm.jpa.JpaTemplate$5.doInJpa(JpaTemplate.java:268)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184)
at org.springframework.orm.jpa.JpaTemplate.persist(JpaTemplate.java:266)
at org.jasig.cas.ticket.registry.JpaTicketRegistry.addTicket(JpaTicketRegistry.java:48)
at org.jasig.cas.CentralAuthenticationServiceImpl.createTicketGrantingTicket(CentralAuthenticationServiceImpl.java:425)
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:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
....

Here is my ticketRegistry,xml now:

<?xml version="1.0" encoding="UTF-8"?>
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
<!-- JPA attached to jboss persistence unit -->
    <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="dataSource" ref="dataSource"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="generateDdl" value="true" />
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
<prop key="hibernate.transaction.auto_close_session">true</prop>
<prop key="hibernate.current_session_context_class">jta</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
</props>
</property>
    </bean>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:/DefaultDS"></property>
</bean>

<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName" value="java:/TransactionManager" />
<property name="autodetectUserTransaction" value="false" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
        <!-- TICKET REGISTRY CLEANER --> <bean id="ticketRegistryCleaner" class="org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner" p:ticketRegistry-ref="ticketRegistry" /> <bean id="jobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean" p:targetObject-ref="ticketRegistryCleaner" p:targetMethod="clean" /> <bean id="triggerJobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.SimpleTriggerBean" p:jobDetail-ref="jobDetailTicketRegistryCleaner" p:startDelay="20000" p:repeatInterval="5000000" /> <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref local="triggerJobDetailTicketRegistryCleaner" /> </list> </property> </bean> </beans>

At this point I have everything else working except persistence/clustering any help at all would be great, or help figuring out why the data source wouldn't work when I tried normal JPA instead of the JTA connection.


-Andrew 


-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user



-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Cyrille Le Clerc

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
Hello Andrew,

Here is the Oracle DDL script our DBA gave us :

create table SERVICETICKET (ID varchar2(255 char) not null, NUMBER_OF_TIMES_USED number(10,0), CREATION_TIME number(19,0), EXPIRATION_POLICY blob not null, LAST_TIME_USED number(19,0), PREVIOUS_LAST_TIME_USED number(19,0), FROM_NEW_LOGIN number(1,0) not null, TICKET_ALREADY_GRANTED number(1,0) not null, SERVICE blob not null, ticketGrantingTicket_ID varchar2(255 char), constraint PK_SERVICETICKET primary key (ID) using index tablespace idxTablespace) tablespace dataTablespace pctfree 30 initrans 4;
create table TICKETGRANTINGTICKET (ID varchar2(255 char) not null, NUMBER_OF_TIMES_USED number(10,0), CREATION_TIME number(19,0), EXPIRATION_POLICY blob not null, LAST_TIME_USED number(19,0), PREVIOUS_LAST_TIME_USED number(19,0), AUTHENTICATION blob not null, EXPIRED number(1,0) not null, SERVICES_GRANTED_ACCESS_TO blob not null, ticketGrantingTicket_ID varchar2(255 char), constraint PK_TICKETGRANTINGTICKET primary key (ID) using index tablespace idxTablespace) tablespace dataTablespace pctfree 30 initrans 4;
alter table SERVICETICKET add constraint FK_ST_TO_TGT foreign key (ticketGrantingTicket_ID) references TICKETGRANTINGTICKET ON DELETE CASCADE;
alter table TICKETGRANTINGTICKET add constraint FK_TGT_TO_TGT foreign key (ticketGrantingTicket_ID) references TICKETGRANTINGTICKET;
create index IDX_ST_TGT_ID on SERVICETICKET(ticketGrantingTicket_ID) tablespace idxTablespace;
create index IDX_TGT_TGT_ID on TICKETGRANTINGTICKET(ticketGrantingTicket_ID) tablespace idxTablespace;


Sorry but I cant explain the rational behind "pctfree 30 initrans 4". This configuration has been successfully used with more than 500K TGT created per day.

Hope this helps,

Cyrille

Cyrille Le Clerc

Xebia IT Architects

          

Email :

Tél :

Mobile :

Web :

 

 

[hidden email]

+33(0)1 46 91 76 16

+33(0)6 61 33 69 86

www.xebia.fr

blog.xebia.fr

 

          

Siège Social

La Défense Colisée

10 / 12 Avenue de l'Arche

Faubourg de l'Arche

92419 Courbevoie Cedex

 

          

Xebia blogue !


On Tue, Jul 14, 2009 at 2:00 PM, Andrew Tillinghast <[hidden email]> wrote:
Going to ask again, could someone send me the create table script for the CAS JPA persistence tables?

-Andrew 

On Jul 8, 2009, at 11:04 PM, Scott Battaglia wrote:

I've been pretty busy at work lately.  I'll try and do it tomorrow.

Cheers,
Scott


On Wed, Jul 8, 2009 at 5:18 PM, Andrew Tillinghast <[hidden email]> wrote:
Another reminder email that you were going to send an sql dump.

-Andrew 

On Jul 6, 2009, at 10:23 PM, Scott Battaglia wrote:

If I remember I'll try and create them tomorrow do a mysql dump.  Feel free to shoot me an email to remind me ;-)


On Fri, Jul 3, 2009 at 11:31 AM, Andrew Tillinghast <[hidden email]> wrote:
Problem with dropping it into tomcat, tomcat would have the JTA/persistence/JNDI for this to attach to.

I've reconstructed my maven build to build from CAS 3.3.3

I've created a second data source for the CAS persistence and updated the ticket registry for spring 2.5, still getting an error that seems to indicate the tables don't exist (still no tables in the database either) there aren't any error indicating that the table build failed. 

Error message:
2009-07-03 15:09:11,923 INFO [org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] - Starting cleaning of expired tickets from ticket registry at [Fri Jul 03 15:09:11 GMT 2009]
2009-07-03 15:09:12,407 ERROR [org.quartz.core.JobRunShell] - Job DEFAULT.jobDetailTicketRegistryCleaner threw an unhandled Exception: 
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'clean' on target class [class org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:269)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [select t from TicketGrantingTicketImpl t]
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:271)
at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
at org.springframework.orm.jpa.JpaAccessor.translateIfNecessary(JpaAccessor.java:152)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:189)
at org.springframework.orm.jpa.JpaTemplate.executeFind(JpaTemplate.java:151)
at org.springframework.orm.jpa.JpaTemplate.find(JpaTemplate.java:311)
at org.springframework.orm.jpa.JpaTemplate.find(JpaTemplate.java:307)
at org.jasig.cas.ticket.registry.JpaTicketRegistry.getTickets(JpaTicketRegistry.java:117)
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)

TicketRegistry.xml
<!-- JPA attached to jboss persistence unit -->
    <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<jee:jndi-lookup id="entityManagerFactory" jndi-name="java:CasPersistence"/>
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" />
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>

persistence.xml
version="1.0">
<persistence-unit name="CasPersistence" transaction-type="JTA">
     <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>java:CAS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:CasPersistence"/> 
</properties>
</persistence-unit>
</persistence>

cas-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>CAS</jndi-name>
    <connection-url>jdbc:sqlserver://devdb.conncoll.edu:1433;databaseName=CAS</connection-url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</driver-class>
    <user-name>xxxxx</user-name>
    <password>*****</password>
<check-valid-connection-sql>SELECT 1 FROM sysobjects</check-valid-connection-sql>
<metadata>
<type-mapping>MS SQLSERVER2000</type-mapping>
</metadata>
  </local-tx-datasource>
</datasources>

One idea I'd like to try, if anyone has the SQL script for the table create I want to see if the persistence functions when the tables exist. 

-Andrew 

On Jun 24, 2009, at 10:20 PM, Scott Battaglia wrote:

I'm not sure why your tables aren't being created.  The typical reason is that the database user doesn't have the appropriate permissions.  Can you drop the WAR file in a simple Tomcat instance just to see if it works from there? (its probably a pain in the butt to do that, but I'm not familiar enough with JBoss to tell you that something is wrong)



On Wed, Jun 24, 2009 at 12:23 PM, Andrew Tillinghast <[hidden email]> wrote:
Ok, sorry to be confusing. Let me clarify.

We're running on JBoss 5.1.0GA and for other applications we need JBoss rather then Tomcat, would prefer 5.X could possibly function under 4.2.x also seems like going 4.2 would just delay the issue.

I've got CAS installed with OW, LDAP etc, but no persistence if I use the <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.DefaultTicketRegistry" /> the CAS service is working fine, actually deployed in production this way right now and working for the few hundred students that check email during the summer.

We'll be "casifying" additional applications and use volume will increase as the summer end so we'll need High Availablity/Clustering so I'm attempting to establish persistence, I've reviewed the persistence overview here: http://www.ja-sig.org/wiki/display/CASUM/Service+Availability+Strategies and I've chosen to go with JPA because we have an existing clustered MS SQL server on our backend.

I've followed through the steps in the JPA instructions here: http://www.ja-sig.org/wiki/display/CASUM/JpaTicketRegistry

However, when attempting to follow those instructions CAS startup would fail with "Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/lookup/DataSourceLookup"

This error came up even though I tried different datasources and I made sure that the proper jars were in my classpath. I tried using the SQLJDBC drivers and data source first and then also with the jtds ones. All of them came back with the DataSourceLookup error.

Example of one of the datasource beans I tried:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="net.sourceforge.jtds.jdbc.Driver"
p:url="jdbc:jtds:sqlserver://devdb.conncoll.edu:1433;database=CAS;"
         p:username="xxxxxx"
     p:password="******" />

After some more research I found information about connecting the JPA persistence to the JBoss JTA persistence. http://www.swview.org/node/214
I changed my ticketRegistry.xml as per the my previous list posting.
Now CAS starts error free and validates login but fails on creating the ticket when login is successful  the text of the error leads me to think that the database connection is established but the tables aren't there when trying to save the ticket.

Despite the error free startup I'm not seeing tables for CAS being created in the jboss databse (no error in CAS.log either.) 

CAS.log shows the following error on Clean, which is essentially the same error as ticket create:

2009-06-24 11:53:38,841 INFO [org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] - Starting cleaning of expired tickets from ticket registry at [Wed Jun 24 11:53:38 EDT 2009]
2009-06-24 11:53:39,177 ERROR [org.quartz.core.JobRunShell] - Job DEFAULT.jobDetailTicketRegistryCleaner threw an unhandled Exception: 
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'clean' on target class [class $Proxy292] failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:269)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TicketGrantingTicketImpl is not mapped [from TicketGrantingTicketImpl]
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:271)
at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
....

I fully admit that I may be misreading the error,  and that the JNDI/JTA/JPA connection might be failing and just not generating any warnings or error. While I am a reasonably skilled programer I am far from a JAVA guru. 
At this point I am begging for assistance with persistence I am not restricted to JPA as the solution it just seemed the most reasonable clustering solution for our environment with already having established an HA SQL server for our other apps on the same server.

-Andrew 

On Jun 24, 2009, at 9:49 AM, Scott Battaglia wrote:

You're confusing me. ;-)  What's the actual problem?  Last time you said the tables hadn't been created now you're saying the dataource isn't working.




On Wed, Jun 24, 2009 at 9:44 AM, Andrew Tillinghast <[hidden email]> wrote:
I added that line, and I changed the JTA reference so that it's a datasource, right now the CAS service starts without any errors and it correctly authenticates the user, when the user successfully logs in however CAS errors out with:

09:36:00,146 ERROR [[cas]] Servlet.service() for servlet cas threw exception
java.lang.IllegalArgumentException: Unknown entity: org.jasig.cas.ticket.TicketGrantingTicketImpl
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:223)
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.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:358)
at $Proxy298.persist(Unknown Source)
at org.springframework.orm.jpa.JpaTemplate$5.doInJpa(JpaTemplate.java:268)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184)
at org.springframework.orm.jpa.JpaTemplate.persist(JpaTemplate.java:266)
at org.jasig.cas.ticket.registry.JpaTicketRegistry.addTicket(JpaTicketRegistry.java:48)
at org.jasig.cas.CentralAuthenticationServiceImpl.createTicketGrantingTicket(CentralAuthenticationServiceImpl.java:425)
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:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
....

Here is my ticketRegistry,xml now:

<?xml version="1.0" encoding="UTF-8"?>
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
<!-- JPA attached to jboss persistence unit -->
    <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
     <constructor-arg index="0" ref="entityManagerFactory" />
    </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="dataSource" ref="dataSource"/>    
  <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="generateDdl" value="true" />
<property name="database" value="SQL_SERVER"/>
</bean>
</property>    
<property name="jpaProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop>
<prop key="hibernate.transaction.auto_close_session">true</prop>
<prop key="hibernate.current_session_context_class">jta</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
</props>
</property>
    </bean>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:/DefaultDS"></property>
</bean>

<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName" value="java:/TransactionManager" />
<property name="autodetectUserTransaction" value="false" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
        <!-- TICKET REGISTRY CLEANER --> <bean id="ticketRegistryCleaner" class="org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner" p:ticketRegistry-ref="ticketRegistry" /> <bean id="jobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean" p:targetObject-ref="ticketRegistryCleaner" p:targetMethod="clean" /> <bean id="triggerJobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.SimpleTriggerBean" p:jobDetail-ref="jobDetailTicketRegistryCleaner" p:startDelay="20000" p:repeatInterval="5000000" /> <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref local="triggerJobDetailTicketRegistryCleaner" /> </list> </property> </bean> </beans>

At this point I have everything else working except persistence/clustering any help at all would be great, or help figuring out why the data source wouldn't work when I tried normal JPA instead of the JTA connection.


-Andrew 


-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user



-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Balakrishna Karki

Re: CAS Table creation?

Reply Threaded More More options
Print post
Permalink
Hi,
ÿ  I am looking for a SSO solution. We have differnet systems namely
ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿ  2. Web sphere applications
ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿ  3. IIS hosted applications
ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿ  4. Apache Tomcat hosted applications
These systems are present in differnet platforms as well like Windows,Linux and AIX.
Please suggest me if CAS can help me out in getting single sign on problem solved.
Thanks,
Balakrishna
-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user