Hi,
I get a strange error today, I could not see any clue to find what was wrong.
Wrapped by: com.thingworx.common.exceptions.InvalidRequestException: Execution error in service script [FileRepoThingName] : Wrapped java.lang.Exception: File Already Exists Cause: File Already Exists at com.thingworx.dsl.engine.DSLProcessor.executeService(DSLProcessor.java:311) ~[thingworx-platform-common-7.4.1-b62.jar:na] at com.thingworx.dsl.DSLServiceHandler.processService(DSLServiceHandler.java:37) ~[thingworx-platform-common-7.4.1-b62.jar:na] at com.thingworx.things.Thing.processServiceRequestDirect(Thing.java:7183) ~[thingworx-platform-common-7.4.1-b62.jar:na] at com.thingworx.things.Thing.processAPIServiceRequest(Thing.java:7121) ~[thingworx-platform-common-7.4.1-b62.jar:na] at com.thingworx.webservices.BaseService.handleInvoke(BaseService.java:2954) ~[thingworx-platform-common-7.4.1-b62.jar:na] at com.thingworx.webservices.BaseService.service(BaseService.java:332) ~[thingworx-platform-common-7.4.1-b62.jar:na] at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [servlet-api.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) [catalina.jar:8.0.44] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.44] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-websocket.jar:8.0.44] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.44] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.44] at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:220) [javamelody.jar:1.65.0] at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:197) [javamelody.jar:1.65.0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.44] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.44] at com.thingworx.security.contenttype.ContentTypeFilter.doFilter(ContentTypeFilter.java:109) [thingworx-platform-common-7.4.1-b62.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.44] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.44] at com.thingworx.security.filter.ValidationFilter.doFilter(ValidationFilter.java:22) [thingworx-platform-common-7.4.1-b62.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.44] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.44] at com.thingworx.security.authentication.AuthenticationFilter.propagateRequest(AuthenticationFilter.java:436) [thingworx-platform-common-7.4.1-b62.jar:na] at com.thingworx.security.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:164) [thingworx-platform-common-7.4.1-b62.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.44] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.44] at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) [urlrewritefilter-4.0.4.jar:4.0.4] at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) [urlrewritefilter-4.0.4.jar:4.0.4] at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) [urlrewritefilter-4.0.4.jar:4.0.4] at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389) [urlrewritefilter-4.0.4.jar:4.0.4] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.44] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.44] at com.thingworx.security.filter.ClickjackFilter.doFilter(ClickjackFilter.java:188) [thingworx-platform-common-7.4.1-b62.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.44] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.44] at com.thingworx.security.filter.ProhibitIfNotLeaderFilter.doFilter(ProhibitIfNotLeaderFilter.java:119) [thingworx-platform-common-7.4.1-b62.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.44] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.44] at com.thingworx.security.filter.HttpResponseHeadersFilter.doFilter(HttpResponseHeadersFilter.java:52) [thingworx-platform-common-7.4.1-b62.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.44] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.44] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) [catalina.jar:8.0.44] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94) [catalina.jar:8.0.44] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) [catalina.jar:8.0.44] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [catalina.jar:8.0.44] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [catalina.jar:8.0.44] at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) [catalina.jar:8.0.44] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [catalina.jar:8.0.44] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502) [catalina.jar:8.0.44] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132) [tomcat-coyote.jar:8.0.44] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) [tomcat-coyote.jar:8.0.44] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1533) [tomcat-coyote.jar:8.0.44] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1489) [tomcat-coyote.jar:8.0.44] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_171] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_171] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.0.44] at java.lang.Thread.run(Unknown Source) [na:1.8.0_171]
Any suggestion would be really appreciated.
My Bests,
Hung Tran
Solved! Go to Solution.
Hi Tyler Misner,
I found out which line of code caused this error, CreateFolder() is called when the folder already exists. As you see, the error should be cleared "Folder Already Exists" or at least show which line of code caused this error.
You may look into the case, cause RhinoException.lineNumber() should return which row caused this error
My Bests,
Hung Tran
Hello Hung,
Thank you for reaching out on the PTC Developers Community.
Could you please provide some further information surrounding the error? For example, were you running a specific service at the time? If so and the service is custom could you provide us with the code to review?
Additionally can you confirm what ThingWorx version you are using?
Thank you,
Tyler Misner
ThingWorx Technical Support Engineer
Hi Tyler Misner,
The exception is wrapped and truncated, it is not clear to identify what is wrong. Yes, a custom service is invoked and it sometimes stopped working and give this error. That's a 200+ line of code service, and it is a pain to find out which line of code causes this error, especially that error only happens sometimes. Due to security policy, I could not publish this source code here.
If you look into the stack trace, the Thingworx version is there. 7.4.1-b62
Wrapped by: com.thingworx.common.exceptions.InvalidRequestException: Execution error in service script [FileRepoThingName] : Wrapped java.lang.Exception: File Already Exists Cause: File Already Exists at com.thingworx.dsl.engine.DSLProcessor.executeService(DSLProcessor.java:311) ~[thingworx-platform-common-7.4.1-b62.jar:na] at com.thingworx.dsl.DSLServiceHandler.processService(DSLServiceHandler.java:37) ~[thingworx-platform-common-7.4.1-b62.jar:na] at com.thingworx.things.Thing.processServiceRequestDirect(Thing.java:7183) ~[thingworx-platform-common-7.4.1-b62.jar:na]
My Bests,
Hung Tran
Hello again Hung,
Thank you for the reply here.
As you cannot post the service code directly would it possible to further outline the functionality of the service? What does the service do and are there specific input parameters which lead to this error?
I've tried searching internally for potentially related issues in which this or something similar was generated but did not find anything.
Regards,
Tyler Misner
ThingWorx Technical Support Engineer
Hi Tyler Misner,
I found out which line of code caused this error, CreateFolder() is called when the folder already exists. As you see, the error should be cleared "Folder Already Exists" or at least show which line of code caused this error.
You may look into the case, cause RhinoException.lineNumber() should return which row caused this error
My Bests,
Hung Tran