We are developing a Netbeans RCP application that includes NB modules, and OSGi modules. Focus of the problem is within the OSGi bundles. So I will explain about the details with the OSGi bundles.
In this RCP application, OSGi bundles are formed as Netbeans clusters. And these clusters are included in Netbeans Platform application. Everything is okay until now. We can run OSGi bundles in Netbeans platform app with success.
But, when we try to untick a specific OSGi bundle in included cluster( in Netbeans Platform App project ), Netbeans platform application does not simply turns off the OSGi module. It still continues to load it with application.
When the same action is done with a Netbeans module(not an OSGi module), this problem does not occur, simply module is disabled and unloaded.
Netbeans version is 7.3.1, we have tried cleaning cache, suite build etc.. But no success. I have to mention also that OSGi declarative services are used( one of the possible suspects also )
Is there any way to specialize which OSGi modules in a cluster will be included in main Netbeans Platform Application ?
Thanks...
This sounds like a bug to me. You should report it here, a small test case should speed up the bug report.
Related
I have a bunch of java classes and a bundle activator class that I need to deploy to karaf.
I see that the karat-maven-plugin has kar packaging and karaf-assembly.
Also it generates features.xml
I can generate features.xml directly and it generates lines with wrap: for some of my dependent non-osgi jars.
But when I run karat-assembly, I run into the issue of the assembly goal not realizing that these jars are not osgi and end up with errors.
What it the recommended way to get a custom karaf with my application installed ?
Does the karat-assembly packaging need to have a features.xml generated and provided beforehand ? Or is it supposed to do the feature set generation by itself ? If it is the latter, then how do I get around the problem of the karat-assembly not recognizing non-osgi jars ?
I have spent a LOT of time with google and am stumped.
This is my procedure for creating a custom karaf distribution. It may not be "best practice" but it works for me. Maybe you can customize for your needs.
After developing my Camel routes and testing I generate my feature file based on a feature template found in /src/main/feature/feature.xml. The karaf-maven-plugin will generate the feature will in the feature folder inside /target.
I do a clean deploy to our maven artifactory.
I have a custom Karaf project do a clean install on that project. The project has dependencies to the initial project and I add all the features as boot level feature.
Once build I unzip the distribution and run the Karaf app. If everything looks ok its ready to be shipped.
I'm trying to build an application that uses an embedded OrientDB (currently "memory:") graph database.
I'm using OrientDB 2.2
I am using Eclipse bndtools for my development environment.
I have added orientdb-core and orientdb-graphdb osgi bundles as build dependencies to my bundle, but on its own that isn't enough, I need access to the tinkerpop blueprint classes as well. There doesn't seem to be a tinkerpop blueprints osgi bundle that I can see.
I can include the blueprints-core jar as a build dependency, and that gets rid of the compile errors, but I then get into all sorts of issues trying to resolve the bundles so I can run something. (the primary error there that I don't seem to be able to get rid of is a complain about not being able to resolve "com.carrotsearch.hppc" -- I include that in my bundle, and export it, but still no joy there)
Shouldn't orientdb-graphdb either depend on a suitable bundle, or include and export the classes?
It sounds like you're running into the classic problem of wrapping a third-party, non-OSGi library as an OSGi bundle.
The best tutorial for this is on the EnRoute site. Note that you don't need to be using EnRoute for this tutorial to be relevant.
We've got a product that is built on top of Spring Boot and deployed via an executable war via embedded Tomcat, but during development we've adopted the approach of developing on a hosted Tomcat so our IDEs (IntelliJ mostly) will have hot-swap / redeploy support (rather than cycling our entire app, which takes a while to boot).
We recently added spring-boot-starter-websocket to our project & have run into issues with the hosted Tomcat's classloader using the embedded Tomcat's resources and crapping out. We can get around it by using profiles and marking the embedded libs as provided so that only our CI builds include them, but it's error prone & hacky at best.
So, my question is this: is there a better way of doing things? Using the Maven plugin or the runnable class introduces problems, as the maven plugin won't hotswap and the runnable class has issues finding classpath things like JSPs (wish we had switched to Thymeleaf beforehand, but next time ;)
The requirements for a "better" development cycle would be:
Code hotswap - aka not having to restart the app / server while developing (outside of making changes to method signatures & whatnot)
Good tooling support
Easy, repeatable setup -- pretty much "checkout and run"
Thanks!
You don't need tomcat for class reloading anymore. With Spring-boot 1.2 you can just debug the maven target spring-boot:run and have class reloading.
This works for me in intellij.
Hi RCP developers,
I'm facing a problem with my product.
When I launch it, i got this :
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: org/springframework/web/client/RestClientException
Caused by: java.lang.NoClassDefFoundError: org/springframework/web/client/RestClientException
I'm using a REST templates from SPRINGFRAMEWORK to catch the results from a REST API, and i try to display that in a Treeview using JFACE.
All springframewok jar's are correctly added to the project.
Could anyone help please?
Thanks in advance !
Ismail
I think you're missing a core concept in Eclipse RCP, and that is OSGi. OSGi is a module system that requires each module (i.e., JAR) to import the dependencies it uses by package. Such entries are found in the JAR's MANIFEST.MF. While they can be manually edited to import these dependencies, usually a tool (such as bnd) makes this much easier to manage.
Eclipse PDE does much of this work for you (and so does adding the Spring project nature), but you need to add any dependencies as plugins (which are also OSGi modules) so that they're visible to the RCP product runner built within Eclipse. Simply adding them to your build classpath will not translate to them being included on a runtime classpath.
When you attempt to run your product / application within Eclipse, make sure you click on the "Validate plug-ins" button to ensure that they are all visible runtime to the target RCP app you're running.
A little back ground: We are using Apache Felix implementation of OSGI for our web development (Adobe CQ5 which inturn is built on apache felix). We have a few bundles of our own (around 10) and each of them are configured as a project.
Issue: During the development lifecycle, we make changes to a bundle and then use an ant script to create the bundle and deploy it in the felix. I am wondering if there is some way to enable hot deployment of the changes I make during development mode that would save developers time.
Based on my research, we can use the felix file install which will monitor a folder(s) for changes to any bundles and can deploy them automatically. But this again means I need to run ant script to build the jar file and move it to the auto deploy folder the file install is watching. Is there a better/fast way to achieve this? The script is currently taking a around 10 seconds (approx) to compile the classes, create osgi specific meta data files, bundle the classes+metadata in a new jar. Is there some way to do hot deployment, so that any change I make to a java file is automatically reflected in the bundle?
Many thanks
If you develop your project in Bndtools, and run from the built-in launcher, then Bndtools will handle immediately building any Java code that you change, and deploying the updated bundle into the runtime. This leads to an extremely quick code/test/debug/fix cycle.
Having said that, I'm amazed that it takes 10 seconds to compile and build your bundles currently! Are you building on an extremely ancient computer? Or is the bundle multiple gigabytes in size?
We tried DCEVM and it does almost everything we expected to reduce the develop+fix+test life cycle. I recommend this to all java developers using big web applications. Thanks for your suggestion on bndtools Neil.