OK - It's bagged - Konstantin on the Tomcat Users list gave me a little tip -
When I compile using the anonymous override the compiler generates two files
"TestFilter.class" and
"TestFilter$1.class". I was only copying over TestFilter.class to the cas
webapp, hence the error.
Sorry for the noise. Gotta work on my java basics a little :-),
- Ole
Ole Ersoy wrote:
> Just one more comment on the last note. I decided to declare the
> request wrapper as an inner class of the filter. Now Tomcat will load
> the filter and it's not until the filter runs that I get the class not
> found exception. In this case, it says it cannot find the class that is
> inside the filter, and I'm starting to wonder if maybe CAS has some
> security manager settings that might prevent this class from loading
> with the request wrapper present. This is what the log says:
>
> SEVERE: Servlet.service() for servlet cas threw exception
> java.lang.ClassNotFoundException:
> test.TestFilter$AuthenticationRequestWrapper
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
>
>
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
>
>
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
> at test.TestFilter.doFilter(TestFilter.java:76)
>
> Line 76 of the test filter looks like this:
>
> AuthenticationRequestWrapper wrap = new
> AuthenticationRequestWrapper((
> HttpServletRequest)servletRequest);
>
>
> The AuthenticationRequestWrapper is declared as an inner class of
> TestFilter.
>
> Any ideas?
>
> Thanks,
> - Ole
>
>
> Ole Ersoy wrote:
>> Scott,
>>
>> Thanks for the extra link. Always good to have options. I may have
>> to give the action approach a shot. Right now I'm attempting to wrap
>> the filter like this:
>>
>> HttpServletRequestWrapper wrapper = new
>> HttpServletRequestWrapper((HttpServletRequest)servletRequest)
>> {
>> public String getParameter(String name)
>> {
>> return "foo";
>> }
>> };
>> But adding this code causes a class not found exception. I'm certain
>> because if I remove it and recompile, the filter loads again. I
>> already posted to Tomcat users list and sun's java forum about this,
>> since I don't think it has anything to do with CAS, but figured I'd
>> mention it in case anyone has experienced something similar.
>>
>> Thanks again,
>> - Ole
>>
>>
>>
>>
>>
>>
>> Scott Battaglia wrote:
>>> An alternative is declared in this thread:
>>> http://article.gmane.org/gmane.comp.java.jasig.cas.user/4420
>>>
>>> On Feb 2, 2008 3:23 PM, Ole Ersoy <[EMAIL PROTECTED]
>>> <mailto:[EMAIL PROTECTED]>> wrote:
>>>
>>> Hey Scott,
>>>
>>> I found the link I think:
>>>
>>> http://www.nabble.com/Default-service-url-for-cas-3.1.1-td15099512.html
>>>
>>> >
>>> > However, the default HttpServletRequest API does not expose a way
>>> to add
>>> > parameters.
>>>
>>> Ah - OK - The lights are starting to come on now - Thanks.
>>>
>>> > You'll either have to redirect and add the parameter or wrap
>>> > the request.
>>>
>>> OK - I like the wrap option. I'll give that a shot next.
>>> Incidentally, I found a forum link detailing various approaches
>>> that you mentioned, with a request wrapper example at the bottom, so
>>> I'll add it for future thread readers.
>>>
>>>
>>> http://forum.java.sun.com/thread.jspa?threadID=508155&messageID=2411271
>>>
>>> <http://forum.java.sun.com/thread.jspa?threadID=508155&messageID=2411271>
>>>
>>>
>>> Thanks!
>>> - Ole
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> > There is also another thread detailing how to set a
>>> > default service is one is not provided. I don't have the link
>>> handy but
>>> > a quick search of Nabble should uncover it.
>>> >
>>> > -Scott
>>> >
>>> > On Feb 1, 2008 3:03 PM, Ole Ersoy <[EMAIL PROTECTED]
>>> <mailto:[EMAIL PROTECTED]>
>>> > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
>>> >
>>> > OK - I think I got it. Just finishing up the post in case it
>>> helps
>>> > someone else. When I looked for the service on the
>>> ServletRequest
>>> > like this:
>>> >
>>> > req.getParameter("service");
>>> >
>>> > It returns null as the value of "service". However if I
>>> cast the
>>> > request to an HttpServletRequest, then I get the correct
>>> value is
>>> > return.
>>> >
>>> > Cheers,
>>> > -Ole
>>> >
>>> >
>>> > Scott Battaglia wrote:
>>> > > Are you looking to set the service parameter on the client
>>> or on
>>> > the server?
>>> > >
>>> > > -Scott
>>> > >
>>> > > On Jan 31, 2008 5:57 PM, Ole Ersoy <[EMAIL PROTECTED]
>>> <mailto:[EMAIL PROTECTED]>
>>> > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
>>> > > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>>> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>>> wrote:
>>> > >
>>> > > Hi,
>>> > >
>>> > > I'd like to set the service parameter before the
>>> authentication
>>> > > request reaches cas. Is this is simple as doing:
>>> > >
>>> > > request.setParameter("service",
>>> > > "http://theDefaultServiceHost/theDefaultService");
>>> > >
>>> > > The reason I'm suspicious is because I tried just
>>> getting the
>>> > > service parameter from an authentication request via a
>>> filter
>>> > like this:
>>> > >
>>> > > System.out.println("Service Parameter: " +
>>> > > servletRequest.getAttribute("service"));
>>> > >
>>> > > And it just prints null...
>>> > >
>>> > > Thoughts?
>>> > >
>>> > > Thanks,
>>> > > - Ole
>>> > >
>>> > >
>>> > >
>>> > > _______________________________________________
>>> > > Yale CAS mailing list
>>> > > [email protected] <mailto:[email protected]>
>>> <mailto:[email protected] <mailto:[email protected]>>
>>> > <mailto:[email protected] <mailto:[email protected]>
>>> <mailto:[email protected] <mailto:[email protected]>>>
>>> > > http://tp.its.yale.edu/mailman/listinfo/cas
>>> > >
>>> > >
>>> > >
>>> > >
>>> > > --
>>> > > -Scott Battaglia
>>> > >
>>> > > LinkedIn: http://www.linkedin.com/in/scottbattaglia
>>> > >
>>> > >
>>> > >
>>> >
>>> ------------------------------------------------------------------------
>>> > >
>>> > > _______________________________________________
>>> > > Yale CAS mailing list
>>> > > [email protected] <mailto:[email protected]>
>>> <mailto:[email protected] <mailto:[email protected]>>
>>> > > http://tp.its.yale.edu/mailman/listinfo/cas
>>> > _______________________________________________
>>> > Yale CAS mailing list
>>> > [email protected] <mailto:[email protected]>
>>> <mailto:[email protected] <mailto:[email protected]>>
>>> > http://tp.its.yale.edu/mailman/listinfo/cas
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > -Scott Battaglia
>>> >
>>> > LinkedIn: http://www.linkedin.com/in/scottbattaglia
>>> >
>>> >
>>> >
>>>
>>> ------------------------------------------------------------------------
>>> >
>>> > _______________________________________________
>>> > Yale CAS mailing list
>>> > [email protected] <mailto:[email protected]>
>>> > http://tp.its.yale.edu/mailman/listinfo/cas
>>> _______________________________________________
>>> Yale CAS mailing list
>>> [email protected] <mailto:[email protected]>
>>> http://tp.its.yale.edu/mailman/listinfo/cas
>>>
>>>
>>>
>>>
>>> --
>>> -Scott Battaglia
>>>
>>> LinkedIn: http://www.linkedin.com/in/scottbattaglia
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Yale CAS mailing list
>>> [email protected]
>>> http://tp.its.yale.edu/mailman/listinfo/cas
>>
>
_______________________________________________
Yale CAS mailing list
[email protected]
http://tp.its.yale.edu/mailman/listinfo/cas