[cas-user] 3.4.11 Null Pointer in Login

89 views
Skip to first unread message

Vitty, Paul

unread,
Nov 8, 2011, 8:45:34 PM11/8/11
to cas-...@lists.jasig.org
Hi,

Currently experiencing issues with 3.4.11 when attempting to log in. As you can see, the WHAT section of Inspektr log is logged as java.lang.NullPointerException. I haven't made any changes to the auditTrailContext.xml, it's coming through with the MVN overlay. Any help would be appreciated.

Below is an excerpt from the CAS log:

2011-11-09 01:30:59,278 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: [username: paul]
WHAT: supplied credentials: [username: paul]
ACTION: AUTHENTICATION_SUCCESS
APPLICATION: CAS
WHEN: Wed Nov 09 01:30:59 GMT 2011paul
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
=============================================================

>
2011-11-09 01:30:59,278 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: [username: paul]
WHAT: java.lang.NullPointerException
ACTION: TICKET_GRANTING_TICKET_NOT_CREATED
APPLICATION: CAS
WHEN: Wed Nov 09 01:30:59 GMT 2011
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
=============================================================

>
2011-11-09 01:30:59.279:WARN::/login
org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [AnnotatedAction@12f64b73 targetAction = [EvaluateAction@67d374be expression = authenticationViaFormAction.submit(flowRequestContext, flowScope.credentials, messageContext), resultExpression = flowScope.realSubmitResponse], attributes = map[[empty]]] in state 'realSubmit' of flow 'login' -- action execution attributes were 'map[[empty]]'
at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:60)
at org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:101)
at org.springframework.webflow.engine.State.enter(State.java:194)
at org.springframework.webflow.engine.Transition.execute(Transition.java:227)
at org.springframework.webflow.engine.impl.FlowExecutionImpl.execute(FlowExecutionImpl.java:391)
at org.springframework.webflow.engine.impl.RequestControlContextImpl.execute(RequestControlContextImpl.java:214)
at org.springframework.webflow.engine.TransitionableState.handleEvent(TransitionableState.java:119)
at org.springframework.webflow.engine.Flow.handleEvent(Flow.java:555)
at org.springframework.webflow.engine.impl.FlowExecutionImpl.handleEvent(FlowExecutionImpl.java:386)
at org.springframework.webflow.engine.impl.RequestControlContextImpl.handleEvent(RequestControlContextImpl.java:210)
at org.springframework.webflow.engine.ViewState.handleEvent(ViewState.java:254)
at org.springframework.webflow.engine.ViewState.resume(ViewState.java:218)
at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259)
at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169)
at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody2(SafeDispatcherServlet.java:115)
at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody3$advice(SafeDispatcherServlet.java:44)
at org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:1)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1221)
at com.github.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:63)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at org.mortbay.jetty.security.SslSocketConnector$SslConnection.run(SslSocketConnector.java:713)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)


Thanks
Paul

________________________________

This email and any attachments are confidential and intended solely for the use of the addressee and may contain information which is covered by legal, professional or other privilege. If you have received this email in error please notify the system manager at postm...@ulster.ac.uk and delete this email immediately. Any views or opinions expressed are solely those of the author and do not necessarily represent those of the University of Ulster. The University's computer systems may be monitored and communications carried out on them may be recorded to secure the effective operation of the system and for other lawful purposes. The University of Ulster does not guarantee that this email or any attachments are free from viruses or 100% secure. Unless expressly stated in the body of a separate attachment, the text of email is not intended to form a binding contract. Correspondence to and from the University may be subject to requests for disclosure by 3rd parties under relevant legislation. The University of Ulster was founded by Royal Charter in 1984 and is registered with company number RC000726 and VAT registered number GB672390524.The primary contact address for the University of Ulster in Northern Ireland is,Cromore Road, Coleraine, Co. Londonderry BT52 1SA

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

Scott Battaglia

unread,
Nov 8, 2011, 8:47:46 PM11/8/11
to cas-...@lists.jasig.org
As a test, can you try to see if login succeeds with auditing disabled? (just trying to narrow down the problem).



--
You are currently subscribed to cas-...@lists.jasig.org as: scott.b...@gmail.com

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

Vitty, Paul

unread,
Nov 8, 2011, 9:24:06 PM11/8/11
to cas-...@lists.jasig.org
Hi Scott,

I've narrowed it down to be something to do with JpaTicketRegistry. If I change my ticket registry to be the default ticket registry, everything works ok, but if I try to use the JpaTicketRegistry it fails.

I switched log4j up to debug, the area that seems to be causing the issue is:

2011-11-09 02:21:49,422 DEBUG [org.springframework.transaction.annotation.AnnotationTransactionAttributeSource] - <Adding transactional method [addTicket] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT]>
2011-11-09 02:21:49,422 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Found thread-bound EntityManager [org.hibernate.ejb.EntityManagerImpl@29cb6895] for JPA transaction>
2011-11-09 02:21:49,422 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Participating in existing transaction>
2011-11-09 02:21:49,423 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Participating transaction failed - marking existing transaction as rollback-only>
2011-11-09 02:21:49,423 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Setting JPA transaction on EntityManager [org.hibernate.ejb.EntityManagerImpl@29cb6895] rollback-only>
2011-11-09 02:21:49,423 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: [username: e225055]
WHAT: java.lang.NullPointerException
ACTION: TICKET_GRANTING_TICKET_NOT_CREATED
APPLICATION: CAS
WHEN: Wed Nov 09 02:21:49 GMT 2011
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
=============================================================

>
2011-11-09 02:21:49,423 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Initiating transaction rollback>
2011-11-09 02:21:49,423 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Rolling back JPA transaction on EntityManager [org.hibernate.ejb.EntityManagerImpl@29cb6895]>
2011-11-09 02:21:49,423 DEBUG [org.hibernate.transaction.JDBCTransaction] - <rollback>
2011-11-09 02:21:49,424 DEBUG [org.hibernate.transaction.JDBCTransaction] - <re-enabling autocommit>
2011-11-09 02:21:49,425 DEBUG [org.hibernate.transaction.JDBCTransaction] - <rolled back JDBC Connection>
2011-11-09 02:21:49,425 DEBUG [org.hibernate.jdbc.ConnectionManager] - <aggressively releasing JDBC connection>
2011-11-09 02:21:49,425 DEBUG [org.hibernate.jdbc.ConnectionManager] - <releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]>
2011-11-09 02:21:49,425 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Closing JPA EntityManager [org.hibernate.ejb.EntityManagerImpl@29cb6895] after transaction>
2011-11-09 02:21:49,425 DEBUG [org.springframework.orm.jpa.EntityManagerFactoryUtils] - <Closing JPA EntityManager>
2011-11-09 02:21:49,426 DEBUG [org.springframework.webflow.execution.AnnotatedAction] - <Clearing action execution attributes map[[empty]]>
2011-11-09 02:21:49,427 DEBUG [org.springframework.webflow.engine.impl.FlowExecutionImpl] - <Attempting to handle [org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [AnnotatedAction@1f65b124 targetAction = [EvaluateAction@1ea03c20 expression = authenticationViaFormAction.submit(flowRequestContext, flowScope.credentials, messageContext), resultExpression = flowScope.realSubmitResponse], attributes = map[[empty]]] in state 'realSubmit' of flow 'login' -- action execution attributes were 'map[[empty]]'] with root cause [java.lang.NullPointerException]>
2011-11-09 02:21:49,427 DEBUG [org.springframework.webflow.engine.impl.FlowExecutionImpl] - <Rethrowing unhandled flow execution exception>
2011-11-09 02:21:49,427 DEBUG [org.springframework.webflow.conversation.impl.SessionBindingConversationManager] - <Unlocking conversation 1>
2011-11-09 02:21:49,427 DEBUG [org.springframework.web.servlet.DispatcherServlet] - <Could not complete request>
org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [AnnotatedAction@1f65b124 targetAction = [EvaluateAction@1ea03c20 expression = authenticationViaFormAction.submit(flowRequestContext, flowScope.credentials, messageContext), resultExpression = flowScope.realSubmitResponse], attributes = map[[empty]]] in state 'realSubmit' of flow 'login' -- action execution attributes were 'map[[empty]]'
at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:60)

I can't see anything strange in my JPA version of the ticket registry either:

<bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry" />
    <!--Quartz -->
    <bean id="ticketRegistryCleaner"
        class="org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner"
        p:ticketRegistry-ref="ticketRegistry"
        p:lock-ref="cleanerLock" />
 
    <bean id="cleanerLock"
        class="org.jasig.cas.ticket.registry.support.JdbcLockingStrategy"
        p:uniqueId="${host.name}"
        p:platform="${ticket.cleaner.database.platform}"
        p:applicationId="cas-ticket-registry-cleaner"
        p:dataSource-ref="mysqlDataSource" />
 
    <bean id="ticketRegistryCleanerJobDetail"
        class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"
        p:targetObject-ref="ticketRegistryCleaner"
        p:targetMethod="clean" />
 
    <bean id="periodicTicketRegistryCleanerTrigger"
        class="org.springframework.scheduling.quartz.SimpleTriggerBean"
        p:jobDetail-ref="ticketRegistryCleanerJobDetail"
        p:startDelay="20000"
        p:repeatInterval="1800000" />

Paul

-- 
You are currently subscribed to cas-...@lists.jasig.org as: p.v...@ulster.ac.uk

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



This email and any attachments are confidential and intended solely for the use of the addressee and may contain information which is covered by legal, professional or other privilege. If you have received this email in error please notify the system manager at postm...@ulster.ac.uk and delete this email immediately. Any views or opinions expressed are solely those of the author and do not necessarily represent those of the University of Ulster. The University's computer systems may be monitored and communications carried out on them may be recorded to secure the effective operation of the system and for other lawful purposes. The University of Ulster does not guarantee that this email or any attachments are free from viruses or 100% secure. Unless expressly stated in the body of a separate attachment, the text of email is not intended to form a binding contract. Correspondence to and from the University may be subject to requests for disclosure by 3rd parties under relevant legislation. The University of Ulster was founded by Royal Charter in 1984 and is registered with company number RC000726 and VAT registered number GB672390524.The primary contact address for the University of Ulster in Northern Ireland is,Cromore Road, Coleraine, Co. Londonderry BT52 1SA
-- 

Scott Battaglia

unread,
Nov 8, 2011, 11:15:28 PM11/8/11
to cas-...@lists.jasig.org
The only major difference I see is that @Transactional annotations got added (which I didn't realize or somehow missed).  Any thoughts, Marvin?

Marvin Addison

unread,
Nov 9, 2011, 7:04:07 AM11/9/11
to cas-...@lists.jasig.org

> I switched log4j up to debug, the area that seems to be causing the issue is:
>
> 2011-11-09 02:21:49,422 DEBUG [org.springframework.transaction.annotation.AnnotationTransactionAttributeSource] - <Adding transactional method [addTicket] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT]>
> 2011-11-09 02:21:49,422 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Found thread-bound EntityManager [org.hibernate.ejb.EntityManagerImpl@29cb6895] for JPA transaction>
> 2011-11-09 02:21:49,422 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Participating in existing transaction>

Need more information right here.

> 2011-11-09 02:21:49,423 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Participating transaction failed - marking existing transaction as rollback-only>
> 2011-11-09 02:21:49,423 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Setting JPA transaction on EntityManager [org.hibernate.ejb.EntityManagerImpl@29cb6895] rollback-only>

Something is causing the tx to fail; need to know what. I'd recommend disabling auditing and see if you get more info. Also turn up the org.hibernate log level to DEBUG or even TRACE. We're looking for a SQL exception or other stack trace.

You should also review https://issues.jasig.org/browse/CAS-1051, which describes how to run the unit tests for JpaTicketRegistry for your particular DB platform in addition to the rationale for the transaction scoping changes.

M

Vitty, Paul

unread,
Nov 9, 2011, 10:51:17 AM11/9/11
to cas-...@lists.jasig.org
I have tried without auditing and there is no more information in the log output.

With all log levels up to DEBUG:

2011-11-09 14:38:24,628 DEBUG [org.springframework.transaction.annotation.AnnotationTransactionAttributeSource] - <Adding transactional method [addTicket] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT]>
2011-11-09 14:38:24,628 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Found thread-bound EntityManager [org.hibernate.ejb.EntityManagerImpl@18affbf6] for JPA transaction>
2011-11-09 14:38:24,628 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Participating in existing transaction>
2011-11-09 14:38:24,628 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Participating transaction failed - marking existing transaction as rollback-only>
2011-11-09 14:38:24,628 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Setting JPA transaction on EntityManager [org.hibernate.ejb.EntityManagerImpl@18affbf6] rollback-only>
2011-11-09 14:38:24,630 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Initiating transaction rollback>
2011-11-09 14:38:24,630 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Rolling back JPA transaction on EntityManager [org.hibernate.ejb.EntityManagerImpl@18affbf6]>
2011-11-09 14:38:24,630 DEBUG [org.hibernate.transaction.JDBCTransaction] - <rollback>
2011-11-09 14:38:24,656 DEBUG [org.hibernate.transaction.JDBCTransaction] - <re-enabling autocommit>
2011-11-09 14:38:24,657 DEBUG [org.hibernate.transaction.JDBCTransaction] - <rolled back JDBC Connection>
2011-11-09 14:38:24,657 DEBUG [org.hibernate.jdbc.ConnectionManager] - <aggressively releasing JDBC connection>
2011-11-09 14:38:24,657 DEBUG [org.hibernate.jdbc.ConnectionManager] - <releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]>
2011-11-09 14:38:24,657 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] - <Closing JPA EntityManager [org.hibernate.ejb.EntityManagerImpl@18affbf6] after transaction>
2011-11-09 14:38:24,657 DEBUG [org.springframework.orm.jpa.EntityManagerFactoryUtils] - <Closing JPA EntityManager>
2011-11-09 14:38:24,659 DEBUG [org.springframework.webflow.execution.AnnotatedAction] - <Clearing action execution attributes map[[empty]]>
2011-11-09 14:38:24,659 DEBUG [org.springframework.webflow.engine.impl.FlowExecutionImpl] - <Attempting to handle [org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [AnnotatedAction@72cf2e49 targetAction = [EvaluateAction@33bb3ce6 expression = authenticationViaFormAction.submit(flowRequestContext, flowScope.credentials, messageContext), resultExpression = flowScope.realSubmitResponse], attributes = map[[empty]]] in state 'realSubmit' of flow 'login' -- action execution attributes were 'map[[empty]]'] with root cause [java.lang.NullPointerException]>
2011-11-09 14:38:24,671 DEBUG [org.springframework.webflow.engine.impl.FlowExecutionImpl] - <Rethrowing unhandled flow execution exception>
2011-11-09 14:38:24,671 DEBUG [org.springframework.webflow.conversation.impl.SessionBindingConversationManager] - <Unlocking conversation 1>
2011-11-09 14:38:24,672 DEBUG [org.springframework.web.servlet.DispatcherServlet] - <Could not complete request>
org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [AnnotatedAction@72cf2e49 targetAction = [EvaluateAction@33bb3ce6 expression = authenticationViaFormAction.submit(flowRequestContext, flowScope.credentials, messageContext), resultExpression = flowScope.realSubmitResponse], attributes = map[[empty]]] in state 'realSubmit' of flow 'login' -- action execution attributes were 'map[[empty]]'
at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:60)

Marvin, I've been through the test suite in cas-server-core with "mvn -Dcas.jpa.concurrent=true clean test" and a correctly configured dataSource in jpaTestApplicationContext.xml. All the test pass.

I've modified the vanilla cas-server-webapp to reproduce the issue, see: https://github.com/pvitty/cas/commit/d28f811ccd02eb838a4de17f0a056bb5c410add2 for details. It creates the database tables correctly but still throws the errors above, you can use mvn integration-test jetty::run to reproduce.

I really can't see any obvious configuration issues in ticketRegistry.xml, any help would be appreciated.

Thanks
Paul

You are currently subscribed to cas-...@lists.jasig.org as: p.v...@ulster.ac.uk

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





This email and any attachments are confidential and intended solely for the use of the addressee and may contain information which is covered by legal, professional or other privilege. If you have received this email in error please notify the system manager at postm...@ulster.ac.uk and delete this email immediately. Any views or opinions expressed are solely those of the author and do not necessarily represent those of the University of Ulster. The University's computer systems may be monitored and communications carried out on them may be recorded to secure the effective operation of the system and for other lawful purposes. The University of Ulster does not guarantee that this email or any attachments are free from viruses or 100% secure. Unless expressly stated in the body of a separate attachment, the text of email is not intended to form a binding contract. Correspondence to and from the University may be subject to requests for disclosure by 3rd parties under relevant legislation. The University of Ulster was founded by Royal Charter in 1984 and is registered with company number RC000726 and VAT registered number GB672390524.The primary contact address for the University of Ulster in Northern Ireland is,Cromore Road, Coleraine, Co. Londonderry BT52 1SA
-- 

Marvin Addison

unread,
Nov 9, 2011, 11:28:48 AM11/9/11
to cas-...@lists.jasig.org
> I've modified the vanilla cas-server-webapp to reproduce the issue,
> see: https://github.com/pvitty/cas/commit/d28f811ccd02eb838a4de17f0a056bb5c410add2 for
> details. It creates the database tables correctly but still throws the
> errors above, you can use mvn integration-test jetty::run to reproduce.

Thanks for taking the time to come up with a test case. I will
investigate within the next couple days and get back to you.

It seems a good time to mention that we did our best to provide an
opportunity to catch these sorts of issues via the RC process.
Whether it's a CAS bug or something else, it would have been nice to
address this before a GA release. Having the community participate in
QA is absolutely necessary for testing components like JPA that have
large dependencies on configuration, platform, and environment. Would
you be willing to test your overlay for JPA fitness against future
release candidates?

M

--

Vitty, Paul

unread,
Nov 9, 2011, 11:33:10 AM11/9/11
to cas-...@lists.jasig.org
Thanks for getting back to me Marvin. I'd be more than willing to QA our JPA overlay in the future.

Thanks
Paul


On 9 Nov 2011, at 16:28, Marvin Addison wrote:

>> I've modified the vanilla cas-server-webapp to reproduce the issue,
>> see: https://github.com/pvitty/cas/commit/d28f811ccd02eb838a4de17f0a056bb5c410add2 for
>> details. It creates the database tables correctly but still throws the
>> errors above, you can use mvn integration-test jetty::run to reproduce.
>
> Thanks for taking the time to come up with a test case. I will
> investigate within the next couple days and get back to you.
>
> It seems a good time to mention that we did our best to provide an
> opportunity to catch these sorts of issues via the RC process.
> Whether it's a CAS bug or something else, it would have been nice to
> address this before a GA release. Having the community participate in
> QA is absolutely necessary for testing components like JPA that have
> large dependencies on configuration, platform, and environment. Would
> you be willing to test your overlay for JPA fitness against future
> release candidates?
>
> M
>
> --

> You are currently subscribed to cas-...@lists.jasig.org as: p.v...@ulster.ac.uk


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


________________________________

This email and any attachments are confidential and intended solely for the use of the addressee and may contain information which is covered by legal, professional or other privilege. If you have received this email in error please notify the system manager at postm...@ulster.ac.uk and delete this email immediately. Any views or opinions expressed are solely those of the author and do not necessarily represent those of the University of Ulster. The University's computer systems may be monitored and communications carried out on them may be recorded to secure the effective operation of the system and for other lawful purposes. The University of Ulster does not guarantee that this email or any attachments are free from viruses or 100% secure. Unless expressly stated in the body of a separate attachment, the text of email is not intended to form a binding contract. Correspondence to and from the University may be subject to requests for disclosure by 3rd parties under relevant legislation. The University of Ulster was founded by Royal Charter in 1984 and is registered with company number RC000726 and VAT registered number GB672390524.The primary contact address for the University of Ulster in Northern Ireland is,Cromore Road, Coleraine, Co. Londonderry BT52 1SA

--

Vitty, Paul

unread,
Nov 9, 2011, 12:20:57 PM11/9/11
to cas-...@lists.jasig.org
Marvin,

I believe I may have solved the issue, for some reason PersistenceContext is not being set via annotation https://github.com/Jasig/cas/blob/v3.4.11/cas-server-core/src/main/java/org/jasig/cas/ticket/registry/JpaTicketRegistry.java#L38 so the entityManager is null causing the null pointer.

Adding <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /> to the ticketRegistry.xml resolves the issue and appears to ensure that the entityManager is wired up. Perhaps https://wiki.jasig.org/display/CASUM/JpaTicketRegistry should be updated to this effect?

Thanks
Paul

Marvin Addison

unread,
Nov 9, 2011, 12:38:10 PM11/9/11
to cas-...@lists.jasig.org
> Adding <bean
> class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"
> /> to the ticketRegistry.xml resolves the issue and appears to ensure that
> the entityManager is wired up.

That's absolutely right. It's sitting right there in my overlay and I
simply forgot that configuration point when updating the docs.

> Perhaps https://wiki.jasig.org/display/CASUM/JpaTicketRegistry shuld be
> updated to this effect?

Done.

M

--

Gasper, John

unread,
Nov 9, 2011, 12:48:07 PM11/9/11
to cas-...@lists.jasig.org
Hi guys,

I'm also trying to get my CAS install upgraded 3.4.11. Before going through the trouble of blowing my stuff up would it make sense to change the cleanerLock to just the JpaLockingStrategy? Or, should JdbcLockingStrategy be left per the documentation/example on https://wiki.jasig.org/display/CASUM/JpaTicketRegistry.

<bean id="cleanerLock"
class="org.jasig.cas.ticket.registry.support.JdbcLockingStrategy"
p:uniqueId="${host.name}"
p:platform="${ticket.cleaner.database.platform}"
p:applicationId="cas-ticket-registry-cleaner"

p:dataSource-ref="dataSource" />

Thanks,
John

-----Original Message-----
From: Marvin Addison [mailto:marvin....@gmail.com]
Sent: Wednesday, November 09, 2011 9:38 AM
To: cas-...@lists.jasig.org
Subject: Re: [cas-user] 3.4.11 Null Pointer in Login

> Adding <bean
> class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"
> /> to the ticketRegistry.xml resolves the issue and appears to ensure
> that the entityManager is wired up.

That's absolutely right. It's sitting right there in my overlay and I simply forgot that configuration point when updating the docs.

> Perhaps https://wiki.jasig.org/display/CASUM/JpaTicketRegistry shuld
> be updated to this effect?

Done.

M

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

Vitty, Paul

unread,
Nov 9, 2011, 1:00:08 PM11/9/11
to cas-...@lists.jasig.org
Hi John,

If you follow the updated wiki instructions it works perfectly. All my integration tests passed.

Thanks
Paul Vitty

Apache/MySQL Web Platform Engineer
Application Platform Delivery
Information Services Directorate
University of Ulster

Tel: 02890 366273
Email: p.v...@ulster.ac.uk
Web: http://www.ulster.ac.uk/staff/p.vitty.html

> You are currently subscribed to cas-...@lists.jasig.org as: p.v...@ulster.ac.uk


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

________________________________

This email and any attachments are confidential and intended solely for the use of the addressee and may contain information which is covered by legal, professional or other privilege. If you have received this email in error please notify the system manager at postm...@ulster.ac.uk and delete this email immediately. Any views or opinions expressed are solely those of the author and do not necessarily represent those of the University of Ulster. The University's computer systems may be monitored and communications carried out on them may be recorded to secure the effective operation of the system and for other lawful purposes. The University of Ulster does not guarantee that this email or any attachments are free from viruses or 100% secure. Unless expressly stated in the body of a separate attachment, the text of email is not intended to form a binding contract. Correspondence to and from the University may be subject to requests for disclosure by 3rd parties under relevant legislation. The University of Ulster was founded by Royal Charter in 1984 and is registered with company number RC000726 and VAT registered number GB672390524.The primary contact address for the University of Ulster in Northern Ireland is,Cromore Road, Coleraine, Co. Londonderry BT52 1SA

--

Gasper, John

unread,
Nov 9, 2011, 1:11:47 PM11/9/11
to cas-...@lists.jasig.org
Hi Paul,

Yes, this also fixed my issue getting CAS to work for me... But if you look lower in the documentation at the cleaner bean, it uses the JdbcLockingStrategy. In trying to track down what I broke doing the install, I came across https://issues.jasig.org/browse/CAS-930. The last comment by Marvin indicates that the JdbcLockingStrategy should be deprecated.

My question was, although maybe not clearly articulated, does it make sense to switch that too?

John

Vitty, Paul

unread,
Nov 9, 2011, 1:26:11 PM11/9/11
to cas-...@lists.jasig.org
Hi John,

Yes, I see what you mean now.

I've updated my locking strategy to JPA and it seems to run fine:

<bean id="cleanerLock"
class="org.jasig.cas.ticket.registry.support.JpaLockingStrategy"
p:uniqueId="${host.name}"
p:applicationId="cas-ticket-registry-cleaner" />

Thanks
Paul

Marvin Addison

unread,
Nov 9, 2011, 2:40:32 PM11/9/11
to cas-...@lists.jasig.org
> I came across https://issues.jasig.org/browse/CAS-930. The last comment by Marvin indicates that the JdbcLockingStrategy should be deprecated.

It is indeed deprecated:
https://github.com/Jasig/cas/blob/master/cas-server-core/src/main/java/org/jasig/cas/ticket/registry/support/JdbcLockingStrategy.java

Today's lesson: documentation is hard. I was attempting to document
on the JpaTicketRegistry page the minumum changes that would be
required to upgrade. You certainly don't have to change
JdbcLockingStrategy -- it works just fine. But we found a way to
implement the same functionality using JPA that has a much lower
barrier to entry for new deployers. So the justification for
deprecation is that we have two components that do the same thing,
only the newer of the two is vastly simpler to deploy. I'll be sure
to document this shortly.

Sorry for the wasted cycles on this. Clearly we need to dot the i's
and cross the t's on the JPA docs going forward for new releases.

M

--

Gasper, John

unread,
Nov 9, 2011, 2:48:11 PM11/9/11
to cas-...@lists.jasig.org
Thanks for the update Marvin. I try do try to stay current with the desired/best practice when releases come out. If not, I end up down the road asking why isn't XXX not working now, only to learn that "we haven't done it that way in years". :)

I did start messing around, and I switching to:


<bean id="cleanerLock"
class="org.jasig.cas.ticket.registry.support.JpaLockingStrategy"

p:uniqueId="${host.name}"
p:applicationId="cas-ticket-registry-cleaner"
/>

Has seemed to be working so far (in test).

Feel free to include me (or let me know how to include myself) in release candidate testing.

John

John Gasper
Identity & Integration Architect    EWU Information Technology
202 Huston Hall    Cheney, WA 99004
509.359.6419    jga...@ewu.edu    www.ewu.edu


-----Original Message-----
From: Marvin Addison [mailto:marvin....@gmail.com]
Sent: Wednesday, November 09, 2011 11:41 AM
To: cas-...@lists.jasig.org
Subject: Re: [cas-user] 3.4.11 Null Pointer in Login

> I came across https://issues.jasig.org/browse/CAS-930. The last comment by Marvin indicates that the JdbcLockingStrategy should be deprecated.

Today's lesson: documentation is hard. I was attempting to document on the JpaTicketRegistry page the minumum changes that would be required to upgrade. You certainly don't have to change JdbcLockingStrategy -- it works just fine. But we found a way to implement the same functionality using JPA that has a much lower barrier to entry for new deployers. So the justification for deprecation is that we have two components that do the same thing, only the newer of the two is vastly simpler to deploy. I'll be sure to document this shortly.

Sorry for the wasted cycles on this. Clearly we need to dot the i's and cross the t's on the JPA docs going forward for new releases.

M

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

Marvin Addison

unread,
Nov 9, 2011, 3:32:23 PM11/9/11
to cas-...@lists.jasig.org
> Feel free to include me (or let me know how to include myself) in release candidate testing.

It's really a matter of simply taking initiative to test your overlays
against release candidates when we announce them. If you're on
cas-user, you should see the announcements.

I appreciate your willingness to help test. It really helps, when
folks like you take the time, to report some kind of feedback either
way. Something as simple as "looks good here" provides positive
feedback to the devs to proceed toward final release.

M

--

Reply all
Reply to author
Forward
0 new messages