Skip to content

missing class only in native image #721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
diginote opened this issue Jan 16, 2023 · 0 comments
Closed

missing class only in native image #721

diginote opened this issue Jan 16, 2023 · 0 comments
Assignees
Labels
Milestone

Comments

@diginote
Copy link

diginote commented Jan 16, 2023

Hi Team,

my spring boot app (v3.0.1) uses ldapTempate.search to get information from ldap server. On JVM-mode the app starts fine but in native mode it throws java.lang.ClassNotFoundException: javax.naming.ldap.PagedResultsResponseControl.

java.lang.ClassNotFoundException: javax.naming.ldap.PagedResultsResponseControl
myapp |       at [email protected]/java.lang.Class.forName(DynamicHub.java:1132) ~[com.company.apps.AppInfoServiceApplication:na]
myapp |       at [email protected]/java.lang.Class.forName(DynamicHub.java:1105) ~[com.company.apps.AppInfoServiceApplication:na]
myapp |       at org.springframework.ldap.control.AbstractFallbackRequestAndResponseControlDirContextProcessor.loadControlClasses(AbstractFallbackRequestAndResponseControlDirContextProcessor.java:110) ~[com.company.apps.AppInfoServiceApplication:3.0.0]
myapp |       at org.springframework.ldap.control.PagedResultsDirContextProcessor.<init>(PagedResultsDirContextProcessor.java:81) ~[na:na]
myapp |       at org.springframework.ldap.control.PagedResultsDirContextProcessor.<init>(PagedResultsDirContextProcessor.java:60) ~[na:na]
myapp |       at com.company.apps.service.ldap.LdapServiceHelper.loadAllStaff(LdapServiceHelper.java:42) ~[com.company.apps.AppInfoServiceApplication:na]
myapp |       at [email protected]/java.lang.reflect.Method.invoke(Method.java:568) ~[com.company.apps.AppInfoServiceApplication:na]
myapp |       at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[na:na]
myapp |       at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[com.company.apps.AppInfoServiceApplication:6.0.3]
myapp |       at [email protected]/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[na:na]
myapp |       at [email protected]/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[com.company.apps.AppInfoServiceApplication:na]
myapp |       at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na]
myapp |       at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[com.company.apps.AppInfoServiceApplication:na]
myapp |       at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
myapp |       at [email protected]/java.lang.Thread.run(Thread.java:833) ~[com.company.apps.AppInfoServiceApplication:na]
myapp |       at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775) ~[com.company.apps.AppInfoServiceApplication:na]
myapp |       at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203) ~[na:na]

I use the following dependency in my pom.yml

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-data-ldap</artifactId>
</dependency>

The LdapTemplate is autowired:

  ...
  
  @Autowired
  private LdapTemplate ldapTemplate;
  
  ...

 PagedResultsCookie cookie = new PagedResultsCookie(null);
 final PagedResultsDirContextProcessor pagedResultProcessor = new PagedResultsDirContextProcessor(Integer.MAX_VALUE);

 SearchControls searchControls = new SearchControls();
 searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);

 List<MyData> ldapSearchResult = ldapTemplate.search(
  myLdapSearch.getSearchBase(),
  myLdapSearch.getSearchFilter(),
  searchControls,
  myHelper.getExampleMapper(),
  pagedResultProcessor
);

Anybody an idea how to solve this issue?

@jzheaux jzheaux self-assigned this Jan 19, 2023
@jzheaux jzheaux added this to the 3.0.1 milestone Jan 19, 2023
@jzheaux jzheaux added type: bug A general bug in: core labels Jan 19, 2023
jzheaux added a commit to jzheaux/spring-aot-smoke-tests that referenced this issue Feb 15, 2023
jzheaux added a commit that referenced this issue Feb 15, 2023
jzheaux added a commit that referenced this issue Feb 15, 2023
jzheaux added a commit that referenced this issue Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants