Skip to content

This is a fork of frontend-karaf-demo used to test the OSGi-fication of TwelveMonkeys

License

Notifications You must be signed in to change notification settings

steinarb/twelvemonkeys-karaf-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testing OSGi-fication of TwelveMonkeys

This is a fork of frontend-karaf-demo used to test the OSGi-fication of TwelveMonkeys.

Status

https://github.com/steinarb/twelvemonkeys-karaf-demo/actions/workflows/twelvemonkeys-karaf-demo-maven-ci-build.yml/badge.svg https://coveralls.io/repos/github/steinarb/twelvemonkeys-karaf-demo/badge.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_twelvemonkeys-karaf-demo&metric=alert_status#.svg https://maven-badges.herokuapp.com/maven-central/no.priv.bang.demos/twelvemonkeys-karaf-demo/badge.svg

https://sonarcloud.io/images/project_badges/sonarcloud-white.svg

https://sonarcloud.io/api/project_badges/measure?project=steinarb_twelvemonkeys-karaf-demo&metric=sqale_index#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_twelvemonkeys-karaf-demo&metric=coverage#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_twelvemonkeys-karaf-demo&metric=ncloc#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_twelvemonkeys-karaf-demo&metric=code_smells#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_twelvemonkeys-karaf-demo&metric=sqale_rating#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_twelvemonkeys-karaf-demo&metric=security_rating#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_twelvemonkeys-karaf-demo&metric=bugs#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_twelvemonkeys-karaf-demo&metric=vulnerabilities#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_twelvemonkeys-karaf-demo&metric=duplicated_lines_density#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_twelvemonkeys-karaf-demo&metric=reliability_rating#.svg

Installation on apache karaf

Requirements:

  1. Java 17 JDK installed
  2. the apache maven build tool installed

Installation steps:

  1. 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
        
  2. 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)

  3. 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
        
  4. 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:
      1. 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
      2. Redux DevTools from remotedevio
        • The “Redux” tab in chrome devtools lets you examine the redux store of the application

Remote debugging of the application

Requires that you have an IDE like Eclipse or IntelliJ IDEA.

Do the following:

  1. Import the cloned twelvemonkeys-karaf-demo maven project into the IDE
  2. Create a remote debug config that uses port 5005 and uses source code from the twelvemonkeys-karaf-demo project
  3. Start debugging and set a breakpoint where the JPEG reader is found
  4. Try fetching metadata for a JPEG URL
  5. 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

LICENSE

This maven project is licensed under Apache v2.0.

See the file LICENSE for details.

About

This is a fork of frontend-karaf-demo used to test the OSGi-fication of TwelveMonkeys

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages