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

Comments

Projects
None yet
4 participants
@gsine

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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 Dec 2, 2015

@decebals

This comment has been minimized.

Member

decebals commented Dec 3, 2015

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

@Mukarr

This comment has been minimized.

Mukarr commented Jun 18, 2016

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

@decebals

This comment has been minimized.

Member

decebals commented Jun 18, 2016

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