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

CF 2018 Update 11 | argument type mismatch

Community Beginner ,
May 26, 2021 May 26, 2021

Hi,

Recently, i ran the update process from Update10 to Update11 for our CF 2018 Enterprise.

Screen Shot 2021-05-26 at 9.13.29 AM.png

However, we found that some (almost all) calls to REST services failed and throw the "java.lang.IllegalArgumentException: argument type mismatch" exception.

 

To isolate the error from our entire implementation I made a simple implementation to reproduce the error:

 

REST Service component (api.cfc)

component rest = true {
    /**
     * 
     * @httpmethod POST
     * @consumes application/json
     * @produces application/json
     * 
     */ 
    remote Input function echo(required Input payload) {
        return payload;
    }
}

Component (Input.cfc)

component {
    
    property type = string name = content required = true;

}

 

I ran an HTTP POST through Postman and got the following exception (exception.logs):

"Error","http-nio-8500-exec-8","05/26/21","09:12:36","","HTTP 500 Internal Server Error"
coldfusion.rest.method.dispatch.CFRestException: HTTP 500 Internal Server Error
	at coldfusion.rest.method.dispatch.CFRestException.handleException(CFRestException.java:103)
	at coldfusion.rest.method.dispatch.CFInvoker.dispatch(CFInvoker.java:98)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
	at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:308)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:291)
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1140)
	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:403)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:386)
	at coldfusion.rest.servlet.CFRestServletContainer.service(CFRestServletContainer.java:148)
	at coldfusion.rest.servlet.CFRestServletContainer.service(CFRestServletContainer.java:84)
	at coldfusion.rest.servlet.CFRestServlet.serviceUsingAlreadyInitializedContainers(CFRestServlet.java:1393)
	at coldfusion.rest.servlet.CFRestServlet.invoke(CFRestServlet.java:933)
	at coldfusion.rest.servlet.RestFilter.invoke(RestFilter.java:61)
	at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:96)
	at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
	at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
	at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
	at coldfusion.rest.servlet.RestWrapRequestFilter.invoke(RestWrapRequestFilter.java:46)
	at coldfusion.rest.servlet.CFRestServlet.invoke(CFRestServlet.java:526)
	at coldfusion.rest.servlet.CFRestServlet.service(CFRestServlet.java:517)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
	at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:311)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:46)
	at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:359)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:888)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1597)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
	at coldfusion.rest.method.dispatch.CFExecutionFilter.invoke(CFExecutionFilter.java:47)
	at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:594)
	at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:43)
	at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
	at coldfusion.rest.method.dispatch.CFInvoker.dispatch(CFInvoker.java:90)
	... 53 more

 

And the Postman output:Screen Shot 2021-05-26 at 11.02.13 AM.png

 

So, i decided to switch to Update 10, run the same code, and as expected, it worked!

Screen Shot 2021-05-26 at 11.16.48 AM.png

 

Postman output

Screen Shot 2021-05-26 at 11.18.18 AM.png

 

Is this the right place to post these types of errors and get an immediate fix from Adobe's support team?

 

I would appreciate your time and help.

ICL

2.1K
Translate
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
Community Expert ,
May 26, 2021 May 26, 2021

This is a good place to post them, but not a good place to get an immediate fix from Adobe. If you want Adobe to fix the problem, go to https://tracker.adobe.com/ (I think).

 

Dave Watts, Eidolon LLC

Dave Watts, Eidolon LLC
Translate
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
Community Beginner ,
May 26, 2021 May 26, 2021

Hi Dave, thanks for your reply.

 

Have you experienced a similar problem? Any ideas you can share with me to solve it?

 

ICL

Translate
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
Community Expert ,
May 26, 2021 May 26, 2021

Not really. It looks like your Java error says the REST API itself is returning a 500 error. Not sure why that would happen, but again I think going to the bug tracker is probably your best option.

 

Dave Watts, Eidolon LLC

Dave Watts, Eidolon LLC
Translate
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
Community Expert ,
May 26, 2021 May 26, 2021

To "I Castillo", I concur with Dave's responses, but I will add that I think there may be other things to consider before filing a bug report.

 

  • First, whenever there's any problem after an update, a first recommendation is to make sure there are "0 fatalerrors" reported in the update's install log. I have a blog post with more on that: https://coldfusion.adobe.com/2019/03/problems-applying-cf-update-check-first/
  • Second, the problem may be in the cfc called, rather than the rest mechanism. Have you tried calling your cfc within cf via createobject/invoke (or their tag equiv), just calling it as a component? You may see a more useful error. That update did have lots of changes. 
  • Indeed, did you confirm there was no error in the cf logs? 
  • Have you put a blank application.cfc into the folder in question, to make sure no other one there now (or in its parent folders, if none there now) might be where the "problem" is? 
  • (I'm writing this on my phone and so am unable to easily test things based on your code offered. Perhaps someone else may get to. ) 
  • Finally, you don't indicate if you upgraded the web server connector after either update. I don't see mention of ajp-related classes in the error, so I can't tells for sure if you're using iis or apache to call the cf page, or the cf built-in web server (such as port 8500). And I'm not aware of a connector bug related to rest, but it's worth ruling out by doing that upgrade. I have a blog post on that: https://www.carehart.org/blog/client/index.cfm/2019/11/13/when_how_update_cf_web_connector

 

Let's see if any of this may get you further, or may give you more to share if you file a bug report. 


/Charlie (troubleshooter, carehart. org)
Translate
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
Community Expert ,
May 30, 2021 May 30, 2021

I have a suggestion for the likely cause of the error and another for improvement.

 

Likely cause of error: ColdFusion expecting the caller to specify the http method. That is, something like

 

remote Input function echo(required Input payload) httpMethod="POST" {
...
}

 

Suggestion for improvement (which might or might not be relevant to the issue):

 

/* Component (Input.cfc) */
component accessors=true {    
    property type = "string" name = "content" required = true;
}

 

 

 

 

 

Translate
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
Community Expert ,
Jun 06, 2021 Jun 06, 2021

Hi @I Castillo , problem solved?

Translate
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
Community Beginner ,
Jun 07, 2021 Jun 07, 2021
LATEST

Hi BKBK,

 

I really appreciate your interest in the subject.

 

Let me tell you that we have decided to suspend the ColdFusion update for the moment. Later, when we finish the functionalities requested by the client, we will return to consider the update issue. As soon as we have news, I will let you know by this means.

 

ICL

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