CAS Java client 3.1.9 with Tomcat 6.0.20

5 messages Options
Embed this post
Permalink
hoichong

CAS Java client 3.1.9 with Tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
Hi,
I am currently testing out CAS server 3.3.4 with CAS java client 3.1.9.

I deploy CAS server into Tomcat 6.0.20 and use Apache 2.2 as a reverse
proxy to CAS with SSL enabled on Apache end.

I access the CAS login page from this URL https://localpc/cas/login 
able to login successfully using admin/admin
Stop Tomcat.

Then I proceed to add filters to tomcat examples servlets  and the
necessary filter mappings.
http://localpc:8080/examples/servlets/servlet/HelloWorldExample


Config added into web.xml :

  <filter>
    <filter-name>CAS Authentication Filter</filter-name>
     
<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
    <init-param>
        <param-name>casServerLoginUrl</param-name>
        <param-value>https://localpc/cas/login</param-value>
    </init-param>
  </filter>

  <filter>
    <filter-name>CAS Validation Filter</filter-name>
     
<filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
    <init-param>
        <param-name>casServerUrlPrefix</param-name>
        <param-value>https://localpc/cas</param-value>
    </init-param>
  </filter>

  <filter>
    <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
     
<filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
  </filter>


    <filter-mapping>
        <filter-name>CAS Authentication Filter</filter-name>
        <url-pattern>/servlets/servlet/HelloWorldExample</url-pattern>
    </filter-mapping>


I copied the following JARS into the examples/WEB-INF/lib
cas-client-core-3.1.9
commons-collections-3.2
commons-logging-1.1
xmlsec-1.3.0

Then start tomcat again.

CAS server will start nicely, but examples webapp will fail to start
with the following error message
Nov 11, 2009 1:14:06 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Nov 11, 2009 1:14:06 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/examples] startup failed due to previous errors

Any ideas on what could be wrong with my changes to the web.xml or the
particular deployment of CAS client.

Thank you.

Cheers.
Hoi Chong

p.s
If I replace the CAS java client 3.1.9 with CAS client 2.1.1 (Yale) and
change the filters and filter-mapping accordingly,
the examples webapp will startup nicely and I can see the CAS login page
while accessing
http://localpc:8080/examples/servlets/servlet/HelloWorldExample

--
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 Java client 3.1.9 with Tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
There's no reason it shouldn't work unless you're missing a JAR or you've got a typo.  We use it all the time on Tomcat 6.  (though I don't know if I've tried with 6.0.20 specifically (I have 6.0.18 installed).  Double check your logs to see if there are any errors in any of the other log files.

Cheers,
Scott


On Tue, Nov 10, 2009 at 12:33 PM, Hoi Chong <[hidden email]> wrote:
Hi,
I am currently testing out CAS server 3.3.4 with CAS java client 3.1.9.

I deploy CAS server into Tomcat 6.0.20 and use Apache 2.2 as a reverse proxy to CAS with SSL enabled on Apache end.

I access the CAS login page from this URL https://localpc/cas/login  able to login successfully using admin/admin
Stop Tomcat.

Then I proceed to add filters to tomcat examples servlets  and the necessary filter mappings.
http://localpc:8080/examples/servlets/servlet/HelloWorldExample


Config added into web.xml :

 <filter>
  <filter-name>CAS Authentication Filter</filter-name>
    <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
  <init-param>
      <param-name>casServerLoginUrl</param-name>
      <param-value>https://localpc/cas/login</param-value>
  </init-param>
 </filter>

 <filter>
  <filter-name>CAS Validation Filter</filter-name>
    <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
  <init-param>
      <param-name>casServerUrlPrefix</param-name>
      <param-value>https://localpc/cas</param-value>
  </init-param>
 </filter>

 <filter>
  <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
    <filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
 </filter>


  <filter-mapping>
      <filter-name>CAS Authentication Filter</filter-name>
      <url-pattern>/servlets/servlet/HelloWorldExample</url-pattern>
  </filter-mapping>


I copied the following JARS into the examples/WEB-INF/lib
cas-client-core-3.1.9
commons-collections-3.2
commons-logging-1.1
xmlsec-1.3.0

Then start tomcat again.

CAS server will start nicely, but examples webapp will fail to start with the following error message
Nov 11, 2009 1:14:06 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Nov 11, 2009 1:14:06 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/examples] startup failed due to previous errors

Any ideas on what could be wrong with my changes to the web.xml or the particular deployment of CAS client.

Thank you.

Cheers.
Hoi Chong

p.s
If I replace the CAS java client 3.1.9 with CAS client 2.1.1 (Yale) and change the filters and filter-mapping accordingly,
the examples webapp will startup nicely and I can see the CAS login page while accessing
http://localpc:8080/examples/servlets/servlet/HelloWorldExample

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

Re: CAS Java client 3.1.9 with Tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
In reply to this post by hoichong
> CAS server will start nicely, but examples webapp will fail to start with
> the following error message
> Nov 11, 2009 1:14:06 AM org.apache.catalina.core.StandardContext start
> SEVERE: Error filterStart
> Nov 11, 2009 1:14:06 AM org.apache.catalina.core.StandardContext start
> SEVERE: Context [/examples] startup failed due to previous errors

Typically the cause of a failed servlet start is logged previously, as
indicated by the text of the last message above.  The cause would
likely have more specific information that could help us diagnose your
problem.  Can you provide the stack trace that precedes the message
above?  In some cases the message may not be written to the
console.log file, which I believe is the one you have quoted above.
The $TOMCAT_HOME/logs/catalina.out file may contain the information
you want in that case.

M

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

Re: CAS Java client 3.1.9 with Tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
Hi Scott, Marvin,
Thanks for the pointers.

I did a more thorough check on other log files
(localhost.2009-11-12.log) and found this exception...

Nov 12, 2009 12:14:07 AM org.apache.catalina.core.StandardContext
filterStart
SEVERE: Exception starting filter CAS Validation Filter
java.lang.IllegalArgumentException: serverName or service must be set.
    at org.jasig.cas.client.util.CommonUtils.assertTrue(CommonUtils.java:88)
    at
org.jasig.cas.client.util.AbstractCasFilter.init(AbstractCasFilter.java:84)
    at
org.jasig.cas.client.validation.AbstractTicketValidationFilter.init(AbstractTicketValidationFilter.java:74)

Turns out, it must have a parameter for serverName in the CAS Validation
Filter.
Added that in, and it is working fine now.

  <filter>
    <filter-name>CAS Validation Filter</filter-name>
     
<filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
    <init-param>
        <param-name>casServerUrlPrefix</param-name>
        <param-value>https://localpc/cas</param-value>
    </init-param>
    <init-param>
        <param-name>serverName</param-name>
        <param-value>http://localpc:9090</param-value>
    </init-param>
  </filter>

Best Regards.
Hoi Chong



Marvin Addison wrote:

>> CAS server will start nicely, but examples webapp will fail to start with
>> the following error message
>> Nov 11, 2009 1:14:06 AM org.apache.catalina.core.StandardContext start
>> SEVERE: Error filterStart
>> Nov 11, 2009 1:14:06 AM org.apache.catalina.core.StandardContext start
>> SEVERE: Context [/examples] startup failed due to previous errors
>>    
>
> Typically the cause of a failed servlet start is logged previously, as
> indicated by the text of the last message above.  The cause would
> likely have more specific information that could help us diagnose your
> problem.  Can you provide the stack trace that precedes the message
> above?  In some cases the message may not be written to the
> console.log file, which I believe is the one you have quoted above.
> The $TOMCAT_HOME/logs/catalina.out file may contain the information
> you want in that case.
>
> M
>
>  


--
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 Java client 3.1.9 with Tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
Glad you found the reason.  Just a note that our filters support supplying values at the context-param level.  So if two filters need the same value, instead of supplying it as an init param you can supply it at a higher level.

Cheers,
Scott


On Wed, Nov 11, 2009 at 11:29 AM, Hoi Chong <[hidden email]> wrote:
Hi Scott, Marvin,
Thanks for the pointers.

I did a more thorough check on other log files (localhost.2009-11-12.log) and found this exception...

Nov 12, 2009 12:14:07 AM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter CAS Validation Filter
java.lang.IllegalArgumentException: serverName or service must be set.
  at org.jasig.cas.client.util.CommonUtils.assertTrue(CommonUtils.java:88)
  at org.jasig.cas.client.util.AbstractCasFilter.init(AbstractCasFilter.java:84)
  at org.jasig.cas.client.validation.AbstractTicketValidationFilter.init(AbstractTicketValidationFilter.java:74)

Turns out, it must have a parameter for serverName in the CAS Validation Filter.
Added that in, and it is working fine now.


 <filter>
  <filter-name>CAS Validation Filter</filter-name>
    <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
  <init-param>
      <param-name>casServerUrlPrefix</param-name>
      <param-value>https://localpc/cas</param-value>
  </init-param>
  <init-param>
      <param-name>serverName</param-name>
      <param-value>http://localpc:9090</param-value>
  </init-param>
 </filter>

Best Regards.
Hoi Chong




Marvin Addison wrote:
CAS server will start nicely, but examples webapp will fail to start with
the following error message
Nov 11, 2009 1:14:06 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Nov 11, 2009 1:14:06 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/examples] startup failed due to previous errors
   

Typically the cause of a failed servlet start is logged previously, as
indicated by the text of the last message above.  The cause would
likely have more specific information that could help us diagnose your
problem.  Can you provide the stack trace that precedes the message
above?  In some cases the message may not be written to the
console.log file, which I believe is the one you have quoted above.
The $TOMCAT_HOME/logs/catalina.out file may contain the information
you want in that case.

M

 


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