金蝶云星空k3cloud webapi報“java.lang.Class cannot be cast to java.lang.String”的錯誤

最近在對接金蝶云星空k3cloud webapi時,報一個莫名其妙的轉換異常,具體如下:

同步部門異常!
ERP接口登錄異常:java.lang.Class cannot be cast to java.lang.String at com.jkwms.k3cloudSyn.service.basics.DeptK3CloudService.synDept(DeptK3CloudService.java:89) at com.jkwms.k3cloudSyn.service.basics.DeptK3CloudService.byTime(DeptK3CloudService.java:32) ... 10 more

沒有頭緒,于是就本地用代碼測試了一下,也報錯:

jsFilePath:/D:/idea-workspace/k3-cloud/target/classes/com/kingdee/k3cloud/webapi/gxJs/dep_mapper.js
登錄失敗:java.lang.Class cannot be cast to java.lang.String
java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.Stringat com.jg.k3cloudwebapi.ApiClient.login(ApiClient.java:41)at com.jgmes.sync.util.BarnaclePlugin.executeQuery(BarnaclePlugin.java:12)at jdk.nashorn.internal.scripts.Script$Recompilation$1$58A$\^eval\_.generateSql(<eval>:60)at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:639)at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)at jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:199)at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:386)at jdk.nashorn.api.scripting.NashornScriptEngine.invokeFunction(NashornScriptEngine.java:190)at com.kingdee.tools.JSUtil.transform(JSUtil.java:61)at com.kingdee.k3cloud.webapi.sdktest.CommonTestNoApp.testBarnacleCall(CommonTestNoApp.java:44)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:766)at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147)at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86)at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93)at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92)at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$8(TestMethodTestDescriptor.java:217)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:213)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:138)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)at java.util.ArrayList.forEach(ArrayList.java:1255)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)at java.util.ArrayList.forEach(ArrayList.java:1255)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:198)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:169)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:93)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:58)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:141)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:57)at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103)at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85)at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47)at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:63)at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)

于是找之前項目的配置進行測試,竟然正常,于是用使用云星空自帶的webapi測試工具測試了下,結果是正常的

?

仔細一看,區別在于地址后面多了個“/”,加上“/”之后就正常了!

jsFilePath:/D:/idea-workspace/k3-cloud/target/classes/com/kingdee/k3cloud/webapi/gxJs/dep_mapper.js
login:true
resultSize:245
0-result:{"code":200,"msg":"拉取數據成功","data":[{"erpCode":"BM000001","depName":"生產部","depCode":"BM000001","parentId":0,"depId":100979,"levelId":".100979."},{"erpCode":"BM000002","depName":"銷售部","depCode":"BM000002","parentId":0,"depId":100980,"levelId":".100980."},{"erpCode":"BM000003","depName":"管理部門","depCode":"BM000003","parentId":0,"depId":100981,"levelId":".100981."},{"erpCode":"BM000004","depName":"董事會","depCode":"BM000004","parentId":0,"depId":100982,"levelId":".100982."},{"erpCode":"BM000005","depName":"總經辦","depCode":"BM000005","parentId":0,"depId":100983,"levelId":".100983."},{"erpCode":"BM000006","depName":"董秘辦","depCode":"BM000006","parentId":0,"depId":100984,"levelId":".100984."},{"erpCode":"BM000007","depName":"審計部","depCode":"BM000007","parentId":0,"depId":100985,"levelId":".100985."},{"erpCode":"BM000008","depName":"財務部","depCode":"BM000008","parentId":0,"depId":100986,"levelId":".100986."},{"erpCode":"BM000010","depName":"人力行政部","depCode":"BM000010","parentId":0,"depId":100987,"levelId":".100987."},{"erpCode":"BM000011","depName":"研發部","depCode":"BM000011","parentId":0,"depId":100988,"levelId":".100988."},{"erpCode":"BM000015","depName":"采購部","depCode":"BM000015","parentId":0,"depId":100989,"levelId":".100989."},{"erpCode":"BM000016","depName":"生產制造部","depCode":"BM000016","parentId":0,"depId":100990,"levelId":".100990."}]
totalCount:245Process finished with exit code 0

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/68086.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/68086.shtml
英文地址,請注明出處:http://en.pswp.cn/web/68086.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

【Android】jni開發之導入opencv和libyuv來進行圖像處理

做視頻圖像處理時需要對其進行水印的添加&#xff0c;放在應用層調用工具性能方面不太滿意&#xff0c;于是當下采用opencvlibyuv方法進行處理。 對于Android的jni開發不是很懂&#xff0c;我的需求是導入opencv方便在cpp中調用&#xff0c;但目前找到的教程都是把opencv作為模…

【MySQL】centos 7 忘記數據庫密碼

vim /etc/my.cnf文件&#xff1b; 在[mysqld]后添加skip-grant-tables&#xff08;登錄時跳過權限檢查&#xff09; 重啟MySQL服務&#xff1a;sudo systemctl restart mysqld 登錄mysql&#xff0c;輸入mysql –uroot –p&#xff1b;直接回車&#xff08;Enter&#xff09; 輸…

國產編輯器EverEdit - 自定義標記使用詳解

1 自定義標記使用詳解 1.1 應用場景 當閱讀日志等文件&#xff0c;用于調試或者檢查問題時&#xff0c;往往日志中會有很多關鍵性的單詞&#xff0c;比如&#xff1a;ERROR, FATAL等&#xff0c;但由于文本模式對這些關鍵詞并沒有突出顯示&#xff0c;造成檢查問題時&#xff…

Golang 并發機制-6:掌握優雅的錯誤處理藝術

并發編程可能是提高軟件系統效率和響應能力的一種強有力的技術。它允許多個工作負載同時運行&#xff0c;充分利用現代多核cpu。然而&#xff0c;巨大的能力帶來巨大的責任&#xff0c;良好的錯誤管理是并發編程的主要任務之一。 并發代碼的復雜性 并發編程增加了順序程序所不…

數據庫并發策略

并發控制是數據庫管理中的一個重要方面&#xff0c;它確保多個事務能夠正確地訪問和修改數據&#xff0c;同時保持數據的一致性和完整性。樂觀鎖、悲觀鎖和時間戳是并發控制的三種主要方法。以下是對這三種方法的詳細解析&#xff0c;并結合實踐進行分析&#xff1a; 一、樂觀…

JVM 四虛擬機棧

虛擬機棧出現的背景 由于跨平臺性的設計&#xff0c;Java的指令都是根據棧來設計的。不同平臺CPU架構不同&#xff0c;所以不能設計為基于寄存器的。優點是跨平臺&#xff0c;指令集小&#xff0c;編譯器容易實現&#xff0c;缺點是性能下降&#xff0c;實現同樣的功能需要更多…

鼠標拖尾特效

文章目錄 鼠標拖尾特效一、引言二、實現原理1、監聽鼠標移動事件2、生成拖尾元素3、控制元素生命周期 三、代碼實現四、使用示例五、總結 鼠標拖尾特效 一、引言 鼠標拖尾特效是一種非常酷炫的前端交互效果&#xff0c;能夠為網頁增添獨特的視覺體驗。它通常通過JavaScript和C…

6-圖像金字塔與輪廓檢測

文章目錄 6.圖像金字塔與輪廓檢測(1)圖像金字塔定義(2)金字塔制作方法(3)輪廓檢測方法(4)輪廓特征與近似(5)模板匹配方法6.圖像金字塔與輪廓檢測 (1)圖像金字塔定義 高斯金字塔拉普拉斯金字塔 高斯金字塔:向下采樣方法(縮小) 高斯金字塔:向上采樣方法(放大)…

RNN/LSTM/GRU 學習筆記

文章目錄 RNN/LSTM/GRU一、RNN1、為何引入RNN&#xff1f;2、RNN的基本結構3、各種形式的RNN及其應用4、RNN的缺陷5、如何應對RNN的缺陷&#xff1f;6、BPTT和BP的區別 二、LSTM1、LSTM 簡介2、LSTM如何緩解梯度消失與梯度爆炸&#xff1f; 三、GRU四、參考文獻 RNN/LSTM/GRU …

異步程序設計方式

目錄 一、異步編程種類簡介 二、線程 三、回調 四、Future、 Promise 及其他 五、反應式擴展 六、協程 一、異步編程種類簡介 幾十年以來&#xff0c;作為開發人員&#xff0c;我們面臨著需要解決的問題——如何防止我們的應用程序被阻塞。 當我們正在開發桌面應用&#…

qt-Quick3D筆記之官方例程Runtimeloader Example運行筆記

qt-Quick3D筆記之官方例程Runtimeloader Example運行筆記 文章目錄 qt-Quick3D筆記之官方例程Runtimeloader Example運行筆記1.例程運行效果2.例程縮略圖3.項目文件列表4.main.qml5.main.cpp6.CMakeLists.txt 1.例程運行效果 運行該項目需要自己準備一個模型文件 2.例程縮略圖…

以太坊入門【詳解】

以太坊的組成部分 P2P網絡&#xff1a;以太坊在以太坊網絡上運行&#xff0c;該網絡可在TCP端口30303上尋址&#xff0c;并運行一個協議。交易&#xff1a;以太坊交易時網絡消息&#xff0c;其中包括發送者&#xff0c;接受者&#xff0c;值和數據的有效載荷以太坊虛擬機&…

實驗十四 EL和JSTL

實驗十四 EL和JSTL 一、實驗目的 1、掌握EL表達式的使用 2、掌握JSTL的使用 二、實驗過程 1、在數據庫Book中建立表Tbook&#xff0c;包含圖書ID&#xff0c;圖書名稱&#xff0c;圖書價格。實現在bookQuery.jsp頁面中模糊查詢圖書&#xff0c;如果圖書的價格在50元以上&#…

安裝和卸載RabbitMQ

我的飛書:https://rvg7rs2jk1g.feishu.cn/docx/SUWXdDb0UoCV86xP6b3c7qtMn6b 使用Ubuntu環境進行安裝 一、安裝Erlang 在安裝RabbitMQ之前,我們需要先安裝Erlang,RabbitMQ需要Erlang的語言支持 #安裝Erlang sudo apt-get install erlang 在安裝的過程中,會彈出一段信息,此…

音視頻多媒體編解碼器基礎-codec

如果要從事編解碼多媒體的工作&#xff0c;需要準備哪些更為基礎的內容&#xff0c;這里幫你總結完。 因為數據類型不同所以編解碼算法不同&#xff0c;分為圖像、視頻和音頻三大類&#xff1b;因為流程不同&#xff0c;可以分為編碼和解碼兩部分&#xff1b;因為編碼器實現不…

ML基礎-Jupyter notebook中的魔法命令

在 Jupyter Notebook 或 IPython 環境中&#xff0c;“魔法命令”&#xff08;Magic Commands&#xff09;是一些以百分號&#xff08;%&#xff09;或驚嘆號&#xff08;!)開頭的特殊命令&#xff0c;用于執行一些與代碼運行環境相關的操作&#xff0c;而不僅僅是執行普通的 P…

【Unity2D 2022:UI】創建滾動視圖

一、創建Scroll View游戲對象 在Canvas畫布下新建Scroll View游戲對象 二、為Content游戲對象添加Grid Layout Group&#xff08;網格布局組&#xff09;組件 選中Content游戲物體&#xff0c;點擊Add Competent添加組件&#xff0c;搜索Grid Layout Group組件 三、調整Grid La…

9-收納的知識

[ComponentOf(typeof(xxx))]組件描述&#xff0c;表示是哪個實體的組件 [EntitySystemOf(typeof(xxx))] 系統描述 [Event(SceneType.Demo)] 定義事件&#xff0c;在指定場景的指定事件發生后觸發 [ChildOf(typeof(ComputersComponent))] 標明是誰的子實體 [ResponseType(na…

數據庫系統概念第六版記錄 一

1.關系型數據庫 關系型數據庫&#xff08;Relational Database&#xff0c;簡稱 RDB&#xff09;是基于關系模型的一種數據庫&#xff0c;它通過表格的形式來組織和存儲數據。每個表由若干行&#xff08;記錄&#xff09;和列&#xff08;字段&#xff09;組成&#xff0c;數據…

Vue前端開發-pinia之Actions插件

Store中的Actions部分&#xff0c;用于定義操作屬性的方法&#xff0c;類似于組件中的methods部分&#xff0c;它與Getters都可以操作State屬性&#xff0c;但在定義方法時&#xff0c;Getters是對State屬性進行加工處理&#xff0c;再返回使用&#xff0c;屬于內部計算;Action…