The other pieces of the JTA/Persistence config:

$JBOSS_HOME/Server/all/deploy/cas.ear/cas.war/classes/META-INF/ 
persistence.xml
<persistence xmlns="http://java.sun.com/xml/ns/persistence";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence 
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd 
"
        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 <[email protected] 
> > 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 [annotatedact...@13dc9f3 targetAction =  
> org.jasig.cas.web.flow.authenticationviaformact...@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
> [email protected]
> 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 [email protected] as: 
> [email protected]
>
>
> To unsubscribe, change settings or access archives, see 
> http://www.ja-sig.org/wiki/display/JSG/cas-user
>
> -- 
> You are currently subscribed to [email protected] as: 
> [email protected]
> To unsubscribe, change settings or access archives, see 
> http://www.ja-sig.org/wiki/display/JSG/cas-user


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

Reply via email to