Skip to content

Instantly share code, notes, and snippets.

@steinarb
steinarb / karaf_command_history
Created May 11, 2021
Delete the old ~/.karaf before testing the command history
View karaf_command_history
sb@lorenzo:/tmp/apache-karaf-4.3.2$ cd
sb@lorenzo:~$ mv .karaf/ .karaf_old
sb@lorenzo:~$ cd /tmp/apache-karaf-4.3.2/
sb@lorenzo:/tmp/apache-karaf-4.3.2$ bin/karaf
Exception in thread "JMX Connector Thread [service:jmx:rmi://127.0.0.1:44444/jndi/rmi://127.0.0.1:1099/karaf-root]" java.lang.RuntimeException: Could not start JMX connector server
at org.apache.karaf.management.ConnectorServerFactory.lambda$init$0(ConnectorServerFactory.java:438)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.rmi.NoSuchObjectException: object not exported
at java.rmi/sun.rmi.transport.ObjectTable.getStub(ObjectTable.java:122)
at java.rmi/java.rmi.server.RemoteObject.toStub(RemoteObject.java:107)
@steinarb
steinarb / karaf_command_history
Created May 11, 2021
Checking the command history on startup in karaf 4.3.2
View karaf_command_history
sb@lorenzo:/tmp/apache-karaf-4.3.2$ bin/karaf
__ __ ____
/ //_/____ __________ _/ __/
/ ,< / __ `/ ___/ __ `/ /_
/ /| |/ /_/ / / / /_/ / __/
/_/ |_|\__,_/_/ \__,_/_/
Apache Karaf (4.3.2)
Hit '<tab>' for a list of available commands
View no.priv.bang.authservice.db.liquibase.test.TestLiquibaseRunner.xml
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.3.0" name="no.priv.bang.authservice.db.liquibase.test.TestLiquibaseRunner" immediate="true" activate="activate">
<property name="name" type="String" value="authservicedb"/>
<service>
<provide interface="org.ops4j.pax.jdbc.hook.PreHook"/>
</service>
<reference name="Logservice" interface="org.osgi.service.log.LogService" bind="setLogservice"/>
<implementation class="no.priv.bang.authservice.db.liquibase.test.TestLiquibaseRunner"/>
</scr:component>
View xmlns-in-feature-repos
./ws03/jersey-demo/src/main/filtered-resources/feature.xml\02:<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="webapi">
./ws03/modelstore/modelstore.backend/src/main/feature/feature.xml\02:<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="authservice.bundle">
./ws03/osgi-service/src/main/filtered-resources/feature.xml\02:<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="handlereg">
./ws03/ukelonn/ukelonn.db.liquibase.test/src/main/feature/feature.xml\02:<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="ukelonn.bundle.test.db">
./ws03/ukelonn/ukelonn.db.liquibase/src/main/feature/feature.xml\02:<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="ukelonn.db.liquibase">
./ws03/ukelonn/ukelonn.db.liquibase.production/src/main/feature/feature.xml\02:<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="ukelonn.bundle.test.db">
./ws03/ukelonn/ukelonn.web.services/src/main/feature/feature.xml\02:<featur
View authservice-integration-test
[INFO] -------------< no.priv.bang.authservice:authservice.tests >-------------
[INFO] Building Authentication webapp integration tests 1.13.0-SNAPSHOT [13/14]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ authservice.tests ---
[INFO] Deleting /home/sb/workspaces/ws03/authservice/authservice.tests/target
[INFO] Deleting /home/sb/workspaces/ws03/authservice/authservice.tests (includes = [**/*.log], excludes = [])
[INFO]
[INFO] --- depends-maven-plugin:1.4.0:generate-depends-file (generate-depends-file) @ authservice.tests ---
[INFO] Created: /home/sb/workspaces/ws03/authservice/authservice.tests/target/classes/META-INF/maven/dependencies.properties
@steinarb
steinarb / org.apache.karaf.features.xml
Created Apr 5, 2021
File only found in the etc directory of the karaf debian package
View org.apache.karaf.features.xml
<?xml version="1.0" encoding="UTF-8"?>
<featuresProcessing xmlns="http://karaf.apache.org/xmlns/features-processing/v1.0.0">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
@steinarb
steinarb / diff-etc-tarball-vs-deb
Created Apr 5, 2021
Diff between the contents of the etc directory of the karaf binary tarball and the etc directory of the karaf debian package
View diff-etc-tarball-vs-deb
--- /tmp/etc-431-tarball 2021-04-05 18:08:26.364420100 +0200
+++ /tmp/etc-431-deb 2021-04-05 18:08:09.716632123 +0200
@@ -1,11 +1,12 @@
all.policy
config.properties
+config.properties.dpkg-old
custom.properties
distribution.info
equinox-debug.properties
host.key
@steinarb
steinarb / karaf.log
Created Apr 3, 2021
Messages in the log when installing karaf 4.3.1 from the debian package
View karaf.log
2021-04-03T17:25:30,226 | INFO | Karaf Shutdown Socket Thread | ShutdownSocketThread | 5 - org.ops4j.pax.logging.pax-logging-api - 2.0.8 | Karaf shutdown socket: received shutdown command. Stopping framework...
2021-04-03T17:25:45,773 | INFO | CM Configuration Updater (Update: pid=org.ops4j.pax.logging) | EventAdminConfigurationNotifier | 6 - org.ops4j.pax.logging.pax-logging-log4j2 - 2.0.8 | Sending Event Admin notification (configuration successful) to org&#x2F;ops4j&#x2F;pax&#x2F;logging&#x2F;Configuration
2021-04-03T17:25:46,056 | INFO | features-3-thread-1 | FeaturesServiceImpl | 18 - org.apache.karaf.features.core - 4.3.1 | No deployment change.
2021-04-03T17:25:46,059 | INFO | features-3-thread-1 | FeaturesServiceImpl | 18 - org.apache.karaf.features.core - 4.3.1 | Done.
@steinarb
steinarb / karaf.log
Created Mar 23, 2021
Attempt at loading karaf 4.2.0 web whiteboard applications in karaf 4.3.0
View karaf.log
Mar 23, 2021 7:40:18 PM org.apache.karaf.main.Main launch
INFO: Installing and starting initial bundles
Mar 23, 2021 7:40:18 PM org.apache.karaf.main.Main launch
INFO: All initial bundles installed and set to start
Mar 23, 2021 7:40:18 PM org.apache.karaf.main.lock.SimpleFileLock lock
INFO: Trying to lock /home/sb/skrot/apache-karaf-4.3.0/lock
Mar 23, 2021 7:40:18 PM org.apache.karaf.main.lock.SimpleFileLock lock
INFO: Lock acquired
Mar 23, 2021 7:40:18 PM org.apache.karaf.main.Main$KarafLockCallback lockAcquired
INFO: Lock acquired. Setting startlevel to 100
View karaf.log
2021-03-22T18:47:40,664 | ERROR | features-3-thread-1 | WebApplication | 203 - org.ops4j.pax.web.pax-web-extender-whiteboard - 7.2.23 | Registration skipped for [ServletWebElement{mapping=DefaultServletMapping{httpContextId=ukelonn,urlPatterns=[/api/*],initParams={jersey.config.server.provider.packages=no.priv.bang.ukelonn.api.resources},servlet=no.priv.bang.ukelonn.api.UkelonnRestApiServlet@5a0c24c9, alias=null, servletNameukelonnapi}}] due to error during registration
javax.servlet.ServletException: servlet already registered with a different alias
at org.ops4j.pax.web.service.spi.model.ServerModel.addServletModel(ServerModel.java:119) ~[?:?]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:246) ~[?:?]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:395) ~[?:?]
at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:504) ~[?:?]
at org.ops4j.pax.web.exte