0

I am using ByteBuddy to generate classes from the JPA Persistence Unit and Spring Data, an older version already works with the persistence unit, spring data jpa and spring webmvc and, now my objective it is to generalize in a more organized application using new Spring 6.0. The component serializes the classes (unil now) in a VFS (apache vfs) since was understood that the AutoConfiguration plays an important role in spring data, the old component was registering the BeanDefinition for the repository manually and in the new version of SpringBoot/SpringData isn`t working quite well the manual BeanDefinitiion in the ApplicationContext.

Executing an unit test to verify the problem with AutoConfiguration was noticed that getResources (with wildcards) and getResource(without wildcard) have distinct behavior, getResources does not locate the DynamicTypes created by ByteBuddy while getResource has successfully located the DynamicType, is it an excected behavior (which means the methods does not behave the same with difference that one just pick one resource from the classpath while the other retrieves an array from the ClassPath).

I provide a screenshot from the debugger to assure that "getResource" method returns successfully the class. This behavior impacts the @EnablbleJpaRepositories annotation with basePackages filled.

DefaultResourceLoader getResourceMethod

2
  • I understood that the ClassLoader VFSClassLoader that I extends from the URLClassLoader (not the apache vfsclassloader) it`s not returning the directory (virtual) as an URL. will try to figure out how to fix this. Commented Mar 3 at 12:50
  • I solved the problem with jim(from google) attached in the classloader, then the getResource and getResourceAsStream methods worked well. Commented Mar 31 at 15:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.