小编rau*_*mus的帖子

springframework ldap核心问题与java模块

主java模块有这种问题。

rg.springframework.beans.factory.BeanCreationException:创建类路径资源中定义的名为“ldapContextSource”的bean时出错[org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapAutoConfiguration.class]:通过工厂方法实例化Bean失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化 [org.springframework.ldap.core.support.LdapContextSource]:工厂方法“ldapContextSource”抛出异常;嵌套异常是java.lang.IllegalAccessError:类org.springframework.ldap.core.support.AbstractContextSource(在模块spring.ldap.core中)无法访问类com.sun.jndi.ldap.LdapCtxFactory(在模块java.naming中),因为模块 java.naming 不会将 com.sun.jndi.ldap 导出到模块 spring.ldap.core
    在 spring.beans@5.2.2.RELEASE/org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:656) ~[spring-beans-5.2.2.RELEASE.jar:na]
    在 spring.beans@5.2.2.RELEASE/org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:636) ~[spring-beans-5.2.2.RELEASE.jar:na]
    在 spring.beans@5.2.2.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) ~[spring-beans-5.2.2.RELEASE.jar:na]
    在 spring.beans@5.2.2.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) ~[spring-beans-5.2.2.RELEASE.jar:na]
    在 spring.beans@5.2.2.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) ~[spring-beans-5.2.2.RELEASE.jar:na]
    在 spring.beans@5.2.2.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.2.RELEASE.jar:na]
    在 spring.beans@5.2.2.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.2.RELEASE.jar:na]
    在 spring.beans@5.2.2.RELEASE/org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.2.RELEASE.jar:na]
    在 spring.beans@5.2.2.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.2.RELEASE.jar:na]
    在 spring.beans@5.2.2.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.2.RELEASE.jar:na]
    在 spring.beans@5.2.2.RELEASE/org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) ~[spring-beans-5.2.2.RELEASE.jar:na]
    在 spring.context@5.2.2.RELEASE/org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.2.RELEASE.jar:na]
    在 spring.context@5.2.2.RELEASE/org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.2.RELEASE.jar:na]
    在 spring.boot@2.2.2.RELEASE/org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.2.RELEASE.jar:na]
    在 spring.boot@2.2.2.RELEASE/org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) ~[spring-boot-2.2.2.RELEASE.jar:na]
    在 spring.boot@2.2.2.RELEASE/org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.2.2.RELEASE.jar:na]
    在 spring.boot@2.2.2.RELEASE/org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.2.2.RELEASE.jar:na]
    在 app/com.test.app.App.main(App.java:9) ~[classes/:na]
引起:org.springframework.beans.BeanInstantiationException:无法实例化[org.springframework.ldap.core.support.LdapContextSource]:工厂方法“ldapContextSource”抛出异常;嵌套异常是java.lang.IllegalAccessError:类org.springframework.ldap.core.support.AbstractContextSource(在模块spring.ldap.core中)无法访问类com.sun.jndi.ldap.LdapCtxFactory(在模块java.naming中),因为模块 java.naming 不会将 com.sun.jndi.ldap 导出到模块 spring.ldap.core
    在 spring.beans@5.2.2.RELEASE/org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.2.2.RELEASE.jar:na]
    在 spring.beans@5.2.2.RELEASE/org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:651) ~[spring-beans-5.2.2.RELEASE.jar:na]
    ... 17个常用帧省略
引起:java.lang.IllegalAccessError:类org.springframework.ldap.core.support.AbstractContextSource(在模块spring.ldap.core中)无法访问类com.sun.jndi.ldap.LdapCtxFactory(在模块java.naming中),因为模块 java.naming 不会将 …

java ldap spring-ldap java-module java-11

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

java ×1

java-11 ×1

java-module ×1

ldap ×1

spring-ldap ×1