First off, I do not believe this a duplicate question as people have received this error while performing different operations.
Overview of the problem:
- Web service works
- After x amount of time, it fails and produces said error below.
- No code changes take place in order for us to have to refresh.
- It isn't until we then refresh the service that it begins working again.
- No patterns, usually fails hour(s) after refreshing.
I have a REST web service which is referencing a CFC from an outside directory and utilizes a CF mapping. The web service worked when it was first entered through the CF admin. I nor no one else on my team can figure out a pattern, but it appears a few hours after the web service is refreshed, it fails and generates this error:
"Error","ajp-bio-8014-exec-1478","01/01/14","12:00:00","ApplicationName","object is not an instance of declaring class The specific sequence of files included or processed is: \myWeb\Site\REST\Service\Folder\myService.cfc'' "
java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ObjectOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:258)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at coldfusion.rest.method.dispatch.CFExceptionHandlingDispatcher.dispatch(CFExceptionHandlingDispatcher.java:63)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
at coldfusion.rest.servlet.CFRestServletContainer.service(CFRestServletContainer.java:143)
at coldfusion.rest.servlet.CFRestServletContainer.service(CFRestServletContainer.java:88)
at coldfusion.rest.servlet.CFRestServlet.invoke(CFRestServlet.java:384)
at coldfusion.rest.servlet.RestFilter.invoke(RestFilter.java:58)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
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:48)
at coldfusion.rest.servlet.CFRestServlet.invoke(CFRestServlet.java:356)
at coldfusion.rest.servlet.CFRestServlet.service(CFRestServlet.java:347)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.seefusion.Filter.doFilter(Filter.java:49)
at com.seefusion.SeeFusion.doFilter(SeeFusion.java:1500)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:97)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doNext(FusionReactorRequestHandler.java:437)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doHttpServletRequest(FusionReactorRequestHandler.java:311)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doFusionRequest(FusionReactorRequestHandler.java:192)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.handle(FusionReactorRequestHandler.java:472)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:36)
at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:79)
at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intergral.fusionreactor.agent.filter.FusionReactorStaticFilter.doFilter(FusionReactorStaticFilter.java:53)
at com.intergral.fusionreactor.agent.pointcuts.NewFilterChainPointCut$1.invoke(NewFilterChainPointCut.java:41)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:204)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Like I said, we refresh the service and it works, but only time tells until it fails again and there's no pattern and the code is not changing whatsoever. Let me give you a more simpler version of the service:
<cfcomponent rest="true" restPath="/" extends="utils.utils">
<cffunction name="generatePDF" produces="application/json" access="remote" returnType="any" httpMethod="POST" restPath="service-pdf">
<cfargument name="id" required="true" type="string" restargsource="form" />
<cfset var result = "" />
<cfset var remote_address = cgi.remote_addr />
<cfset s3Obj = new utils.s3(accessKeyId="mySecretID", secretAccessKey="mySecretKey") />
<cfset path = "the\path\to\store\the\pdf\" />
<cfset objExpSub = new expenses.FormFill() />
<cfset expenseSubmission = objExpSub.geSubmission(arguments.id) />
<cftry>
<cfset result = objExpSub.generatePDF(expenseSubmission, path) />
<cfcatch type="any">
<cfset result = {message="#cfcatch.message#", detail="#cfcatch.detail#", stacktrace="#cfcatch.stacktrace#"}>
<cfreturn serializeJSON(result) />
<cfabort>
</cfcatch>
</cftry>
<cfif result>
<cfset result = {result = true} />
</cfif>
<cfreturn serializeJSON(result) />
</cffunction>
</cfcomponent>
Then there's a .NET web service that's then calling our web service. The REST web service is in its own directory and currently does not utilize an Application.cfc. Can't see how that would be causing any issues though.
What we're thinking is the issue and from everything I've seen, has to do with the fact that the service folder and the associated classes being instantiated within the service are being referenced by a custom CF mapping. So they don't exist at the CF root and they all don't exist in the same folder.
Edit (03/03/2014): What I did forget to mention is that <cfset objExpSub = new expenses.FormFill() />
is instantiating an object via a CF mapping, but that mapping is to our ColdBox application components. I'm not an expert in ColdBox, but could there be an issue with that?
Update (03/03/2014): We're going to strip out the components from our ColdBox application directory and see what kind of results we get. I'm guessing we'll still see the error, but just trying to eliminate another possibility. Will update with our findings.
This is literally all I have to go off, so if you need more information than this, be specific because there isn't too much more I can provide.
Repeating myself, the web service WORKS! It just randomly breaks and throws an error that means nothing to any of us for no reason whatsoever.
Thanks for help in advance.