This is a fork of frontend-karaf-demo used to test the OSGi-fication of TwelveMonkeys.
Requirements:
- Java 17 JDK installed
- the apache maven build tool installed
Installation steps:
- Clone this project and build it with maven:
mkdir -p ~/git cd ~/git/ git clone https://github.com/steinarb/twelvemonkeys-karaf-demo.git cd ~/git/twelvemonkeys-karaf-demo/ mvn clean install
- Install apache karaf (e.g. according to the karaf quick start guide or by installing the .deb package on debian/ubuntu/raspbian), and start karaf using the command
./bin/karaf debug
(the debug argument makes karaf listen for remote debugging on port 5005)
- From the karaf console (either from the karaf started above, or from an SSH session into a running karaf), install the application with the following commands:
feature:repo-add mvn:no.priv.bang.demos/twelvemonkeys-karaf-demo/LATEST/xml/features feature:install twelvemonkeys-karaf-demo
- Open a web browser on http://localhost:8181/twelvemonkeys-karaf-demo/ and use the “+” and “-” buttons to increment and decrement the counter
- If using Chrome or Chromium it’s a good idea to press Ctrl-Shift-i to open the developer tools, where it is possible to watch error messages in the console, and set breakpoints and debug the JavaScript code
- It’s also a good idea to visit the Chrome Web Store and install:
- React Developer Tools from Facebook
- The “React” tab in chrome devtools gives a view of the react application tree, rather than the DOM, where it is possible to examine the react components’ props and state, it’s also possible to click on a part of the application and navigate to the corret place in the react application tree
- Redux DevTools from remotedevio
- The “Redux” tab in chrome devtools lets you examine the redux store of the application
- React Developer Tools from Facebook
Requires that you have an IDE like Eclipse or IntelliJ IDEA.
Do the following:
- Import the cloned twelvemonkeys-karaf-demo maven project into the IDE
- Create a remote debug config that uses port 5005 and uses source code from the twelvemonkeys-karaf-demo project
- Start debugging and set a breakpoint where the JPEG reader is found
- Try fetching metadata for a JPEG URL
- Check in the debugger what the type of the JPEG reader is, and if it is something other than com.sun.imageio.plugins.jpeg.JPEGImageReader then the chance is that you’ve got the SPI plugin injection working
This maven project is licensed under Apache v2.0.
See the file LICENSE for details.