• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

ColdFusion 11 REST warnings in log file?

New Here ,
Mar 04, 2015 Mar 04, 2015

Copy link to clipboard

Copied

I'm building a RESTful API with ColdFusion 11.  Today I noticed there are a ton of warnings being logged to the coldfusion-error log file.  For example:

Mar 04, 2015 8:09:52 AM com.sun.jersey.spi.inject.Errors processErrorMessages

WARNING: The following warnings have been detected with resource and/or provider classes:

WARNING: A HTTP GET method, public void api.Country.GetCountry() throws coldfusion.xml.rpc.CFCInvocationException, MUST return a non-void type.

WARNING: A HTTP GET method, public void api.Log.GetLog(java.lang.Double) throws coldfusion.xml.rpc.CFCInvocationException, MUST return a non-void type.

WARNING: A HTTP GET method, public void api.Logout.LogoutUser(java.lang.Double) throws coldfusion.xml.rpc.CFCInvocationException, MUST return a non-void type.

Here is one of my API endpoint functions:

<cfcomponent restpath="country" rest="true" output="false" extends="cfc.data">

     <cffunction name="getCountry" access="remote" output="false" httpmethod="get" returntype="void">

          <cfset LOCAL.countryData = getCountryData()>

          <cfset LOCAL.restResponse = StructNew()>

          <cfset restResponse = REQUEST.apiObj.response(200, countryData)>

          <cfset restSetResponse(restResponse)>

     </cffunction>

</cfcomponent>

My understanding is that returntype=void is a MUST in order to use restSetResponse().  This code works great, but the warnings in the log file don't make sense to me. 

Am I doing something wrong? 

Or is this some sort of "gap" where logging isn't factoring in REST services/functionality? 

Is it possible to disable warning messages from getting logged? 

Thank you!

Brian White

Views

518

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources
Documentation