Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

get_type from currentThread.getContextClassLoader().loadClass() #169

Open
zokrezyl opened this issue Jul 16, 2019 · 0 comments
Open

get_type from currentThread.getContextClassLoader().loadClass() #169

zokrezyl opened this issue Jul 16, 2019 · 0 comments

Comments

@zokrezyl
Copy link

get_type uses FindClass for finding/loading classes. This will not find however classes loaded by frameworks like spring. Something like below works, but I have to rewrite part of the decoration that is part of jpy I understand:

  Thread = jpy.get_type("java.lang.Thread")                                            
  current_thread = Thread.currentThread()                                              
  class_loader = current_thread.getContextClassLoader() 
class_loader.loadClass("com.some.spring.class")

Would be interesting to have an argument for get_type that would force get_type to try to load classes from the threads class loader, or simply pass the classloader.

Opinion?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant