gpt4 book ai didi

java - 基于 OIM 自定义 ICF 的连接器抛出运行时异常

转载 作者:行者123 更新时间:2023-11-30 02:54:31 26 4
gpt4 key购买 nike

我创建了一个基于 ICF 的平面文件连接器,它使用 REST Web 服务从文件中读取/写入数据。我使用 jersey 实现 1.6 来编写 Web 服务和将调用该 Web 服务的 java 客户端。

我正在使用独立的java代码来测试CRUD功能。它在我初始化 Jersey 客户端的第一行给出了异常。

Client flatFileRestClient = Client.create();

我知道该错误是因为连接器服务器无法识别 Jersey 实现 jar。因此,根据 ICF 连接器的文档,我已将 Jersey bundle 放入 连接器服务器/lib 文件夹。我已重新启动连接器服务器并调用创建操作,但问题仍然存在。

我还在ConnectorServer.bat中添加了自定义jar的类路径文件位于 CONNECTOR_SERVER_HOME/bin 中。但问题仍然存在。

请找到 Eclipse 控制台上抛出的异常的完整堆栈跟踪:

java.lang.RuntimeException: javax/ws/rs/ext/Providers
at org.identityconnectors.framework.impl.serializer.CommonObjectHandlers$17.createException(CommonObjectHandlers.java:301)
at org.identityconnectors.framework.impl.serializer.CommonObjectHandlers$ThrowableHandler.deserialize(CommonObjectHandlers.java:115)
at org.identityconnectors.framework.impl.serializer.binary.BinaryObjectDecoder$InternalDecoder.readObject(BinaryObjectDecoder.java:162)
at org.identityconnectors.framework.impl.serializer.binary.BinaryObjectDecoder.readObject(BinaryObjectDecoder.java:313)
at org.identityconnectors.framework.impl.serializer.binary.BinaryObjectDecoder.readObjectField(BinaryObjectDecoder.java:417)
at org.identityconnectors.framework.impl.serializer.MessageHandlers$5.deserialize(MessageHandlers.java:155)
at org.identityconnectors.framework.impl.serializer.binary.BinaryObjectDecoder$InternalDecoder.readObject(BinaryObjectDecoder.java:162)
at org.identityconnectors.framework.impl.serializer.binary.BinaryObjectDecoder.readObject(BinaryObjectDecoder.java:313)
at org.identityconnectors.framework.impl.api.remote.RemoteFrameworkConnection.readObject(RemoteFrameworkConnection.java:153)
at org.identityconnectors.framework.impl.api.remote.RemoteOperationInvocationHandler.invoke(RemoteOperationInvocationHandler.java:101)
at com.sun.proxy.$Proxy0.create(Unknown Source)
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:606)
at org.identityconnectors.framework.impl.api.DelegatingTimeoutProxy.invoke(DelegatingTimeoutProxy.java:107)
at com.sun.proxy.$Proxy0.create(Unknown Source)
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:606)
at org.identityconnectors.framework.impl.api.LoggingProxy.invoke(LoggingProxy.java:76)
at com.sun.proxy.$Proxy0.create(Unknown Source)
at org.identityconnectors.framework.impl.api.AbstractConnectorFacade.create(AbstractConnectorFacade.java:123)
at org.identityconnectors.flatfileconnector.test.TestOperations.create(TestOperations.java:37)
at org.identityconnectors.flatfileconnector.test.TestOperations.main(TestOperations.java:44)

请注意连接器服务器上抛出的异常:

Jun 06, 2016 5:19:13 PM org.identityconnectors.framework.server.impl.ConnectionL
istener processOperationRequest
SEVERE: javax/ws/rs/ext/Providers
java.lang.NoClassDefFoundError: javax/ws/rs/ext/Providers
at org.identityconnectors.flatfileconnector.restclient.FlatFileRestClient.<
init>(FlatFileRestClient.java:18)
at org.identityconnectors.flatfileconnector.FlatFileConnector.create(FlatFileConnector.java:85)
at org.identityconnectors.framework.impl.api.local.operations.CreateImpl
.create(CreateImpl.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.identityconnectors.framework.impl.api.local.operations.ConnectorA
PIOperationRunnerProxy.invoke(ConnectorAPIOperationRunnerProxy.java:93)
at com.sun.proxy.$Proxy3.create(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.identityconnectors.framework.impl.api.local.operations.ThreadClas
sLoaderManagerProxy.invoke(ThreadClassLoaderManagerProxy.java:107)
at com.sun.proxy.$Proxy3.create(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.identityconnectors.framework.impl.api.DelegatingTimeoutProxy.invo
ke(DelegatingTimeoutProxy.java:107)
at com.sun.proxy.$Proxy3.create(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.identityconnectors.framework.impl.api.LoggingProxy.invoke(Logging
Proxy.java:76)
at com.sun.proxy.$Proxy3.create(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.identityconnectors.framework.server.impl.ConnectionProcessor.proc
essOperationRequest(ConnectionProcessor.java:287)
at org.identityconnectors.framework.server.impl.ConnectionProcessor.proc
essRequest(ConnectionProcessor.java:191)
at org.identityconnectors.framework.server.impl.ConnectionProcessor.run(
ConnectionProcessor.java:121)
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:745)
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.ext.Providers
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 37 more

尽早提供任何帮助将不胜感激。

最佳答案

问题是由于我正在使用的 REST API jar 造成的。我已经反编译了 jersey-bundle-1.6.jar 并发现该 jar 中不存在 javax.ws.rs.ext.Providers.class 。所以我下载了Jersey-bundler-1.16.jar的Java 6编译版本

关于java - 基于 OIM 自定义 ICF 的连接器抛出运行时异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37658290/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com