Skip to content
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

Unable to detect Extensions #82

Closed
gsine opened this issue Dec 2, 2015 · 6 comments
Closed

Unable to detect Extensions #82

gsine opened this issue Dec 2, 2015 · 6 comments

Comments

@gsine
Copy link

gsine commented Dec 2, 2015

I have followed the procedure outlined in the home page.

  1. I have one plugin that is dropped into the plugins folder as a ZIP file.
    When the EAR is deployed and starts up in Wildfly, I can see that the ZIP file is unzipped. The manifest seems to be correct, and the extensions.idx has the class name.
  2. PF4J is able to read the plugin, and records that one possible extension is found.
  3. However, when I try to getExtensions(), the error is that the type is not assignable from the extension Class.

Please let me know if you require any additional information to help me with this issue.

Thanks and Best Regards,
GPN

@decebals
Copy link
Member

decebals commented Dec 2, 2015

The log of pf4j is very detailed on debug and you can see where is the problem (you can see what classes are loaded by each plugin class loader).
I think that you have a class in many jars loaded with different class loaders.

@gitblit
Copy link
Contributor

gitblit commented Dec 2, 2015

I think @decebals has the right of it here. If you have a type Foo referenced by two classloaders, Foo is not instance-compatible between the two classloaders - leading to your not assignable error. The only time this works is when the second classloader is a child of the first one AND it inherits/shares the parent classloader.

@gsine
Copy link
Author

gsine commented Dec 2, 2015

Sorry my bad.
This is a duplicate of the discussion here #64.
I should have searched earlier before posting.
Thanks.

@gsine gsine closed this as completed Dec 2, 2015
@decebals
Copy link
Member

decebals commented Dec 3, 2015

No problem. Maybe it's the time to add o possibility in code to detect these situations.

@Mukarr
Copy link

Mukarr commented Jun 18, 2016

I am facing similar problem. @decebals How can access the logs for pf4j?

@decebals
Copy link
Member

PF4J uses SLF4J for logging but you must add a concrete implementation in your project (pom.xml if you use Maven). For example PF4J Demo uses Log4J as implementation.

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

No branches or pull requests

4 participants