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

Project fails to build in IntelliJ IDEA because cannot load OSGI plugin #54

Closed
purplefox opened this issue Jun 20, 2015 · 18 comments
Closed
Assignees

Comments

@purplefox
Copy link
Contributor

Project... rebuild all gives:

Error:osgi: [osgi-examples] Failed to load plugin org.apache.felix.ipojo.bnd.PojoizationPlugin;, error: org.apache.felix.ipojo.bnd.PojoizationPlugin not found, parent: java.net.URLClassLoader@45ee12a7 urls:[] exception:java.lang.ClassNotFoundException: org.apache.felix.ipojo.bnd.PojoizationPlugin

This means I can't run the examples in the IDE

@cescoffier
Copy link
Member

How do you import the project in your IDE ?

If I import it as a Maven projet I don't have any issue.

@purplefox
Copy link
Contributor Author

Yes, I originally imported as a Maven project.

If I try again from scratch as a new user would after cloning the project, I get a further issue:

Error:(26, 16) java: cannot find symbol
symbol: class ProcessorServiceVertxEBProxy
location: interface io.vertx.examples.service.ProcessorService

This I guess is because the service proxy classes need generating.

This is going to confuse users. I think it's important that users can get going with vertx-examples straight away without any extra steps, as this will be the first thing they see in Vert.x

@cescoffier
Copy link
Member

So, this issue is 'expected', we discussed it with @vietj.
We can replace the call by using the helper and mention it in the documentation. What do you think ?

@purplefox
Copy link
Contributor Author

As long as the user can get an example working like the following, I don't mind:

  1. git clone https://github.com/vert-x3/vertx-examples.git
  2. IntelliJ: import maven project
  3. Right click main class of example... run

There should be no other steps imho. If a user gets stuck with a cryptic error trying to run the simplest helloworld example they may just walk away from Vert.x and never come back again.

@cescoffier
Copy link
Member

I've changed the service proxy example in f41e5e6.

I've tried the process you mention and it works for me.

@purplefox
Copy link
Contributor Author

If I git clone, import, and rebuild project I still get: can't find ProcessorServiceVertxEBProxy

cescoffier added a commit that referenced this issue Jun 21, 2015
As the classes are generated at compile time when compiling with Maven, IDEs cannot find them.
@cescoffier
Copy link
Member

Oupsy, forgot this reference.
Should be better in 4f8cd95

@purplefox
Copy link
Contributor Author

Thanks, that solves the issue of the build failing for the service proxy example, but now I see the original issue again:

Error:osgi: [osgi-examples] Failed to load plugin org.apache.felix.ipojo.bnd.PojoizationPlugin;, error: org.apache.felix.ipojo.bnd.PojoizationPlugin not found, parent: java.net.URLClassLoader@45ee12a urls:[] exception:java.lang.ClassNotFoundException: org.apache.felix.ipojo.bnd.PojoizationPlugin

@cescoffier
Copy link
Member

I'm going to install a new instance of intellij as I cannot reproduce that one.

@purplefox
Copy link
Contributor Author

I am using 14.0.3 btw

@purplefox
Copy link
Contributor Author

Just a guess - maybe you have manually installed some kind of OSGI plugin in your IDE, that I don't have, and is required for this example?

@cescoffier
Copy link
Member

No, I'm a purist ;-)

OSGi does not require any IDE plugin. However, Intellij enables one by default that generally messes up things...

I'm downloading community and ultimate. It needs to work out of the box on both.

@purplefox
Copy link
Contributor Author

Clement - I have license keys for ultimate that you're entitled too, just sent you a private email.

@cescoffier
Copy link
Member

Ok, I've reproduced the issue, it's the intellij OSGi support (osmorc) that is unable to load BND plugins. I'm looking into it.

@cescoffier
Copy link
Member

I've moved the osgi-examples to their own profile (not enabled by default). This fixed the Intellij issue.
(879bf72)

So, the issue is in Osmorc the OSGi plugin of intellij unable to read the configuration (as it is intended to do). The main issue is that it does not support the plugin's dependencies and fails to create the right classloader to execute BND. So the commit is just a work around this issue.

@purplefox
Copy link
Contributor Author

Ok, I guess this should just be closed then.

@cescoffier
Copy link
Member

Ok :-) Wanted to add the link to the osmorc bug once opened.

@cescoffier
Copy link
Member

Here is the Osmorc bug ticket:
https://youtrack.jetbrains.com/issue/IDEA-141732

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

No branches or pull requests

2 participants