Unable to get REST API to work CAS 4.1.7 overlay

66 views
Skip to first unread message

Yan Zhou

unread,
May 10, 2016, 10:36:49 AM5/10/16
to CAS Community
Hi there,

I am unable to get REST API to work with my CAS 4.1.7 overlay setup. I do have a local copy of web.xml.

All I did was to add this in my overlay pom.xml:  the jar does show up in my CAS  web-inf/lib directory.  The other required changes are already in my Web.xml.

 <dependency>
    <groupId>org.jasig.cas</groupId>
    <artifactId>cas-server-support-rest</artifactId>
    <version>${cas.version}</version>
    <scope>runtime</scope>
</dependency>

My problem is that when I post to /cas/v1/tickets  endpoint, I am getting this error, basically, it says cannot find the controller handling  /v1/tickets  endpoint, but I do not know what I am missing. 

2016-05-10 10:29:13,995 DEBUG [org.springframework.web.servlet.DispatcherServlet] - <DispatcherServlet with name 'cas' processing POST request for [/cas/v1/tickets]>
2016-05-10 10:29:13,996 DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - <Looking up handler method for path /tickets>
2016-05-10 10:29:14,001 DEBUG [org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver] - <Resolving exception from handler [null]: org.springframew
ork.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data;boundary=----WebKitFormBoundaryu37ixELagG431V6M' not supported>
2016-05-10 10:29:14,003 DEBUG [org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver] - <Resolving exception from handler [null]: org.springframework.web.H
ttpMediaTypeNotSupportedException: Content type 'multipart/form-data;boundary=----WebKitFormBoundaryu37ixELagG431V6M' not supported>
2016-05-10 10:29:14,005 DEBUG [org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver] - <Resolving exception from handler [null]: org.springframework.web.Http
MediaTypeNotSupportedException: Content type 'multipart/form-data;boundary=----WebKitFormBoundaryu37ixELagG431V6M' not supported>

What am I missing?

Thanks in advance. 

Yan

P.S.

I do have a local version of Web.xml, based on what is in JASIG CAS. the following changes are ALREADY in web.xml.  So, I do not have to change anything.

<servlet-mapping>
    <servlet-name>cas</servlet-name>
    <url-pattern>/v1/*</url-pattern>
</servlet-mapping>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
      /WEB-INF/spring-configuration/*.xml
      /WEB-INF/deployerConfigContext.xml
      classpath*:/META-INF/spring/*.xml
    </param-value>
</context-param>

Yan Zhou

unread,
May 10, 2016, 10:55:21 AM5/10/16
to CAS Community
Figured it out.  Thanks for the documentation.

Yan
Reply all
Reply to author
Forward
0 new messages