I'm posting this again, because for some reason I didn't see the message come 
up in the mailing list, if you get it twice I'm sorry.

Attempting to add a service to our CAS implementation, we use Microsoft SQL 
Server as the DB backend.
Connection to the server is self is good and the service tickets are stored in 
the DB and the table for services was created.

When I go into the services interface and add a new service I get an error:
org.springframework.web.util.NestedServletException: Request processing failed; 
nested exception is org.springframework.orm.hibernate3.HibernateJdbcException: 
JDBC exception on Hibernate data access: SQLException for SQL [insert into 
RegisteredServiceImpl (allowedToProxy, anonymousAccess, description, enabled, 
evaluation_order, ignoreAttributes, name, serviceId, ssoEnabled, theme, id) 
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [null]; error code [0]; 
could not insert: [org.jasig.cas.services.RegisteredServiceImpl]; nested 
exception is org.hibernate.exception.GenericJDBCException: could not insert: 
[org.jasig.cas.services.RegisteredServiceImpl]
        
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:583)
        
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        
org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:115)
        
org.inspektr.common.web.ClientInfoThreadLocalFilter.doFilterInternal(ClientInfoThreadLocalFilter.java:48)
        
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
        
org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
        
org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
        
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
        ...

root cause

org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on 
Hibernate data access: SQLException for SQL [insert into RegisteredServiceImpl 
(allowedToProxy, anonymousAccess, description, enabled, evaluation_order, 
ignoreAttributes, name, serviceId, ssoEnabled, theme, id) values (?, ?, ?, ?, 
?, ?, ?, ?, ?, ?, ?)]; SQL state [null]; error code [0]; could not insert: 
[org.jasig.cas.services.RegisteredServiceImpl]; nested exception is 
org.hibernate.exception.GenericJDBCException: could not insert: 
[org.jasig.cas.services.RegisteredServiceImpl]
        
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:642)
        
org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:95)
        
org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
        
org.springframework.orm.jpa.JpaAccessor.translateIfNecessary(JpaAccessor.java:152)
        org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:189)
        org.springframework.orm.jpa.JpaTemplate.merge(JpaTemplate.java:276)
        
org.jasig.cas.services.JpaServiceRegistryDaoImpl.save(JpaServiceRegistryDaoImpl.java:36)
        
org.jasig.cas.services.DefaultServicesManagerImpl.save(DefaultServicesManagerImpl.java:118)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        java.lang.reflect.Method.invoke(Method.java:616)
                ...
root cause

org.hibernate.exception.GenericJDBCException: could not insert: 
[org.jasig.cas.services.RegisteredServiceImpl]
        
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
        
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
        
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        
org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:40)
        
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158)
        
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638)
        
org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
        org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
        
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
        
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
        
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
        
org.hibernate.ejb.event.EJB3MergeEventListener.saveWithGeneratedId(EJB3MergeEventListener.java:43)
        
org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:186)
        
org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:123)
        
org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:53)
        org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:677)
        org.hibernate.impl.SessionImpl.merge(SessionImpl.java:661)
        org.hibernate.impl.SessionImpl.merge(SessionImpl.java:665)
                ...
root cause

com.microsoft.sqlserver.jdbc.SQLServerException: The value is not set for the 
parameter number 11.
        
com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:170)
        
com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.buildParamTypeDefinitions(SQLServerPreparedStatement.java:260)
        
com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.buildPreparedStrings(SQLServerPreparedStatement.java:219)
        
com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doPrepExec(SQLServerPreparedStatement.java:596)
        
com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:384)
        
com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:338)
        com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4026)
        
com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1416)
        
com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:185)
        
com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:160)
        
com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:306)
        
org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:73)
        
org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33)
        
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158)
        
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638)
        
org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
        org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
        ...
It looks like the insert statement is coded to set an explicit ID but the table 
is designed with ID being an auto-incrementing number.

entityManagerFactory is defined with SQLServerDialect.

        <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="generateDdl" value="true"/>
                                <property name="showSql" value="true" />
                        </bean>
                </property>
                <property name="jpaProperties">
                        <props>
                                <prop 
key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
                                <prop key="hibernate.hbm2ddl.auto">update</prop>
                        </props>
                </property>
        </bean>

Thanks in advance for any assistance.

-Andrew



-- 
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