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

OIM Custom ICF based connector throwing runtime exception

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

我正在使用独立的 java 代码来测试 CRUD functionality.It 在我初始化球衣客户端的第一行给出异常。

Client flatFileRestClient = Client.create();

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

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

请查找在 eclipse 控制台上抛出的异常的完整堆栈跟踪:

java.lang.RuntimeException: javax/ws/rs/ext/Providers
at org.identityconnectors.framework.impl.serializer.CommonObjectHandlers.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.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.run(URLClassLoader.java:366)
        at java.net.URLClassLoader.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 并发现 javax.ws.rs.ext.Providers.class 不存在于那个罐子里。所以我下载了 Java 6 complied 版本的 Jersey-bundler-1.16.jar