CAS:JBoss中的cas-server-support-json-service-registry出现6.2.0-快照错误

2019年6月29日 14点热度 0条评论

找不到类错误:org.apereo.cas.services.ServiceRegistry]:工厂方法'jsonServiceRegistry'
抛出异常;嵌套的异常是java.lang.NoClassDefFoundError:com / sun / nio / file / SensitivityWatchEventModifier

我正在使用Cas-war-overlay(6.2.0-snapshot)。已包括
编译“ org.apereo.cas:cas-server-support-json-service-registry:$ {project.'cas.version'}”
在gradle依赖项部分。一切正常,直到2020年4月16日。从今天开始突然出现此错误。

堆栈跟踪:

Caused by: java.lang.NoClassDefFoundError: com/sun/nio/file/SensitivityWatchEventModifier
        at deployment.cas.war//org.apereo.cas.util.io.PathWatcherService.<init>(PathWatcherService.java:67)
        at deployment.cas.war//org.apereo.cas.services.resource.AbstractResourceBasedServiceRegistry.enableDefaultWatcherService(AbstractResourceBasedServiceRegistry.java:183)
        at deployment.cas.war//org.apereo.cas.config.JsonServiceRegistryConfiguration.jsonServiceRegistry(JsonServiceRegistryConfiguration.java:69)
        at deployment.cas.war//org.apereo.cas.config.JsonServiceRegistryConfiguration$$EnhancerBySpringCGLIB$$b4c519e.CGLIB$jsonServiceRegistry$0(<generated>)
        at deployment.cas.war//org.apereo.cas.config.JsonServiceRegistryConfiguration$$EnhancerBySpringCGLIB$$b4c519e$$FastClassBySpringCGLIB$$17923b01.invoke(<generated>)
        at deployment.cas.war//org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
        at deployment.cas.war//org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
        at deployment.cas.war//org.apereo.cas.config.JsonServiceRegistryConfiguration$$EnhancerBySpringCGLIB$$b4c519e.jsonServiceRegistry(<generated>)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at deployment.cas.war//org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ```

解决方案如下:

通过修改jboss-deployment-structure.xml,设法解决了这个问题。添加以下代码:

  <dependencies>
            <system export="true">
                <paths>
                    <path name="com/sun/nio/file"/>
                </paths>
            </system>
        </dependencies>