带有Java模块的springframework ldap核心问题

问题描述 投票:2回答:1

在主要的Java模块中遇到这种问题。

rg.springframework.beans.factory.BeanCreationException:在类路径资源[org / springframework / boot / autoconfigure / ldap / embedded / EmbeddedLdapAutoConfiguration.class]中创建名称为“ ldapContextSource”的bean时出错:通过工厂方法实例化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在[email protected]/org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:656)〜[spring-beans-5.2.2.RELEASE.jar:na]在[email protected]/org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:636)〜[spring-beans-5.2.2.RELEASE.jar:na]在[email protected]/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338)〜[spring-beans-5.2.2.RELEASE.jar:na]在[email protected]/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)〜[spring-beans-5.2.2.RELEASE.jar:na]在[email protected]/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)〜[spring-beans-5.2.2.RELEASE.jar:na]在[email protected]/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)〜[spring-beans-5.2.2.RELEASE.jar:na]在[email protected]/org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)〜[spring-beans-5.2.2.RELEASE.jar:na]在[email protected]/org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)〜[spring-beans-5.2.2.RELEASE.jar:na]在[email protected]/org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)〜[spring-beans-5.2.2.RELEASE.jar:na]在[email protected]/org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)〜[spring-beans-5.2.2.RELEASE.jar:na]在[email protected]/org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)〜[spring-beans-5.2.2.RELEASE.jar:na]在[email protected]/org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)〜[spring-context-5.2.2.RELEASE.jar:na]在[email protected]/org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)〜[spring-context-5.2.2.RELEASE.jar:na]在[email protected]/org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)〜[spring-boot-2.2.2.RELEASE.jar:na]在[email protected]/org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)〜[spring-boot-2.2.2.RELEASE.jar:na]在[email protected]/org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)〜[spring-boot-2.2.2.RELEASE.jar:na]在[email protected]/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在[email protected]/org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)〜[spring-beans-5.2.2.RELEASE.jar:na]在[email protected]/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不会将com.sun.jndi.ldap导出到模块spring.ldap.core在[email protected]/org.springframework.ldap.core.support.AbstractContextSource。(AbstractContextSource.java:77)〜[spring-ldap-core-2.3.2.RELEASE.jar:na]在[email protected]/org.springframework.boot.autoconfigure.ldap.embedded.EmbeddedLdapAutoConfiguration.ldapContextSource(EmbeddedLdapAutoConfiguration.java:93)〜[spring-boot-autoconfigure-2.2.2.RELEASE.jar :na]在java.base / jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(本机方法)〜[na:na]在java.base / jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)〜[na:na]在java.base / jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)〜[na:na]在java.base / java.lang.reflect.Method.invoke(Method.java:566)〜[na:na]在[email protected]/org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)〜[spring-beans-5.2.2.RELEASE.jar:na]...省略了18个通用框架流程以退出代码1完成

我知道发生了什么问题,但是除了从主模块中删除module-info.java之外,还有其他解决方法吗?>

主Java模块出现了此类问题。 rg.springframework.beans.factory.BeanCreationException:在类路径资源[org / ...

java ldap java-11 spring-ldap java-module
1个回答
1
投票
module java.naming不会将com.sun.jndi.ldap导出到模块spring.ldap.core
© www.soinside.com 2019 - 2024. All rights reserved.