This article is about a new servlet base class I have created to simplify serving up javascript frontends from the OSGi web whiteboard.
Continue reading Simplified delivery of react.js from apache karaf
All posts by steinarbang
My OSGi story
OSGi is a Java plugin framework and module system that were initially created for supporting embdedded applications in the automotive industry. OSGi also forms the foundations for the Eclipse IDE plugin model. The plugin model of OSGi consists of components waiting for services and starting and exposing services when all of the dependencies are satsified. A “service” in OSGi terminology, is a Java interface.
I first encountered OSGi in 2006. The company I worked from used OSGi as the basis for an ETL processing system implementing various processing elements as OSGi plugins plugging into the processing framework. Since writing OSGi activators (which was the state of the art for OSGi plugins back in the day) is kind of boring, we created a Dependency Injection system on top of OSGi.
Rewriting applications to use pax-jdbc-config and liquibase
After creating the post Pluggable databases for apache karaf applications I posted a link to the blog post in the karaf user mailing list, and the immediate response was, “why didn’t I just pax-jdbc-config instead?“.
The answer to that is that I didn’t know about pax-jdbc-config. I started using pax-jdbc in the summer of 2016, and started using apache karaf in the autumn of 2016 and pax-jdbc-config didn’t exist then (or at least: not as complete and usable as it became in 2017), and any announcement that has gone past since then, has not registered.
Continue reading Rewriting applications to use pax-jdbc-config and liquibase
How I learned about linux’ “OOM Killer”
This blog post describes how I discovered a linux feature called “OOM Killer” that can have strange effects if it interrupts a program at a place where it really shouldn’t be interrupted.
Continue reading How I learned about linux’ “OOM Killer”
Pluggable databases for apache karaf applications
Edit: I no longer use this approach. I use pax-jdbc-config instead. See the article Rewriting applications to use pax-jdbc-config and liquibase for details
Continue reading Pluggable databases for apache karaf applications
A Java programmer’s guide to delivering webapp frontends
When I started investigating (googling) web frontends, I found tutorials for various frameworks and I found tutorials using node.js to deliver frontends to web browsers on localhost.
What I did not find, was something telling me how I should pack up and deliver the webapp frontend from my production system, so that comes here:
- A web application frontend is a piece of javascript code, that builds its user interface by rebuilding the DOM tree of the webpage that loaded it
- The javascript needed for a webapp is packaged up as a big javascript file, typically named bundle.js,
- The initial HTML file references bundle.js
- The initial HTML file also contains an element that matches what the javascript code expects to be its start element (i.e. the point in the DOM of the parsed HTML file, where the javascript program starts rebuilding its own DOM)
Continue reading A Java programmer’s guide to delivering webapp frontends
Use Jersey to provide REST APIs from karaf applications
Edit: creating a REST API using jersey has been made simpler, see Simplified REST APIs from karaf using Jersey for details.
Continue reading Use Jersey to provide REST APIs from karaf applications
Deliver react.js from apache karaf
Edit: delivering react.js has been made simpler, see Simplified delivery of react.js from apache karaf for details.
Continue reading Deliver react.js from apache karaf
Faking a debian repository for package development
I use aptly to deliver my unofficial debian packages both to myself and others that might be interested.
However I’ve found that using aptly to do package development is a bad idea, because you can’t (by design, probably) overwrite packages in an aptly archive. You can only create new versions.
For some installation tests it’s OK to use “dpkg –install”. But if your package needs to pull in depdencies, or if you wish to test a package upgrade, you need to use APT.
This article explains how to create a fake debian repository for use in package development. Continue reading Faking a debian repository for package development
Develop OSGi applications using karaf
Apache Karaf is a good platform for deploying OSGi based applications. Karaf is also a good platform for testing and debugging these applications. This article describes how to test and debug OSGi bundles and OSGi applications with karaf and eclipse.
Continue reading Develop OSGi applications using karaf