Skip to content

Instantly share code, notes, and snippets.

@steinarb
steinarb / Console output
Created October 7, 2017 09:38
Console output and stack trace of pax-exam test failing to start
[main] INFO org.ops4j.pax.exam.spi.DefaultExamSystem - Pax Exam System (Version: 4.11.0) created.
[main] INFO org.ops4j.pax.exam.junit.impl.ProbeRunner - creating PaxExam runner for class no.priv.bang.fildele.tests.FildeleIntegrationTest
[main] INFO org.ops4j.pax.exam.junit.impl.ProbeRunner - running test class no.priv.bang.fildele.tests.FildeleIntegrationTest
[main] INFO org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer - Creating RMI registry server on 127.0.0.1:21000
[main] INFO org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer - Found 0 options when requesting OverrideJUnitBundlesOption.class
[main] INFO org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer - Wait for test container to finish its initialization [ RelativeTimeout value = 240000 ]
[main] INFO org.ops4j.pax.exam.rbc.client.RemoteBundleContextClient - Waiting for remote bundle context.. on 21000 name: 2cf797f6-ef39-4745-ba2a-fd52b47f1d68 timout: [ RelativeTimeout value = 240000 ]
okt 07, 2017 11:31:08 AM org
@steinarb
steinarb / FildeleIntegrationTest.java
Created October 7, 2017 19:35
mockito karaf feature
package no.priv.bang.fildele.tests;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import static org.ops4j.pax.exam.CoreOptions.*;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.*;
import java.io.File;
import java.io.IOException;
import java.net.ServerSocket;
@steinarb
steinarb / rules
Created January 19, 2018 22:44
karaf debian rules file
#!/usr/bin/make -f
DISTRIBUTION = $(shell lsb_release -sr)
VERSION = 4.1.4
PACKAGEVERSION = $(VERSION)-0~$(DISTRIBUTION)0
TARBALL = apache-karaf-$(VERSION)-src.tar.gz
URL = http://apache.uib.no/karaf/$(VERSION)/$(TARBALL)
SRC=unpacked-src
%:
@steinarb
steinarb / rules
Created January 20, 2018 17:53
rules file with correct placement of the build commands
#!/usr/bin/make -f
DISTRIBUTION = $(shell lsb_release -sr)
VERSION = 4.1.4
PACKAGEVERSION = $(VERSION)-0~$(DISTRIBUTION)0
TARBALL = apache-karaf-$(VERSION)-src.tar.gz
URL = http://apache.uib.no/karaf/$(VERSION)/$(TARBALL)
SRC=unpacked-src
%:
@steinarb
steinarb / Initial auth check
Created January 25, 2019 18:22
Network captures of nginx with auth calls to shiro webapp running in karaf
GET /authservice/check HTTP/1.0
Host: localhost:8181
Connection: close
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: nb-NO,nb;q=0.9,no;q=0.8,nn;q=0.7,en-US;q=0.6,en;q=0.5
Cookie: NSREDIRECT=http://lorenzo.hjemme.lan/
@steinarb
steinarb / gist:d33ff99c19d929da4543bdd46d019ecf
Created April 26, 2019 21:10
Stack trace from PostgreSQL driver failing after reload in an OSGi context
java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost:5432/authservice?prepareThreshold=5&preparedStatementCacheQueries=256&preparedStatementCacheSizeMiB=5&databaseMetadataCacheFields=65536&databaseMetadataCacheFieldsMiB=5&defaultRowFetchSize=0&binaryTransfer=true&readOnly=false&binaryTransferEnable=&binaryTransferDisable=&unknownLength=2147483647&logUnclosedConnections=false&disableColumnSanitiser=false&tcpKeepAlive=false&loginTimeout=0&connectTimeout=10&socketTimeout=0&cancelSignalTimeout=10&receiveBufferSize=-1&sendBufferSize=-1&ApplicationName=PostgreSQL+JDBC+Driver&jaasLogin=true&useSpnego=false&gsslib=auto&sspiServiceClass=POSTGRES&allowEncodingChanges=false&targetServerType=any&loadBalanceHosts=false&hostRecheckSeconds=10&preferQueryMode=extended&autosave=never&reWriteBatchedInserts=false
at java.sql.DriverManager.getConnection(DriverManager.java:689)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at org.postgresql.ds.common.BaseDataSource.getConnection(Bas
@steinarb
steinarb / pgjdbc-trace.log
Created April 28, 2019 11:12
Logs for PostgreSQL JDBC driver OSGi reload issue
Apr 28, 2019 12:42:01 PM org.postgresql.Driver connect
FINE: Connecting with URL: jdbc:postgresql://:5432/authservice?loggerLevel=TRACE&loggerFile=pgjdbc-trace.log&prepareThreshold=5&preparedStatementCacheQueries=256&preparedStatementCacheSizeMiB=5&databaseMetadataCacheFields=65536&databaseMetadataCacheFieldsMiB=5&defaultRowFetchSize=0&binaryTransfer=true&readOnly=false&binaryTransferEnable=&binaryTransferDisable=&unknownLength=2147483647&logUnclosedConnections=false&disableColumnSanitiser=false&tcpKeepAlive=false&loginTimeout=0&connectTimeout=10&socketTimeout=0&cancelSignalTimeout=10&receiveBufferSize=-1&sendBufferSize=-1&ApplicationName=PostgreSQL+JDBC+Driver&jaasLogin=true&useSpnego=false&gsslib=auto&sspiServiceClass=POSTGRES&allowEncodingChanges=false&targetServerType=any&loadBalanceHosts=false&hostRecheckSeconds=10&preferQueryMode=extended&autosave=never&reWriteBatchedInserts=false
Apr 28, 2019 12:42:01 PM org.postgresql.jdbc.PgConnection <init>
FINE: PostgreSQL JDBC Driver 42.2.5
Apr 28, 2019 12:42:01 P
2019-06-30T22:36:54,281 | INFO | FelixStartLevel | ContextHandler | 101 - org.eclipse.jetty.util - 9.4.18.v20190429 | Stopped HttpServiceContext{httpContext=org.ops4j.pax.web.extender.whiteboard.internal.WebApplication$1@402cf7eb}
2019-06-30T22:36:54,284 | ERROR | FelixStartLevel | Felix | - - | Bundle org.ops4j.pax.web.pax-web-extender-whiteboard [139] EventDispatcher: Error during dispatch. (java.lang.IllegalArgumentException: Servlet [no.priv.bang.handlereg.web.api.HandleregWebApi@74fef0ff is not currently registered in any context)
java.lang.IllegalArgumentException: Servlet [no.priv.bang.handlereg.web.api.HandleregWebApi@74fef0ff is not currently registered in any context
at org.ops4j.pax.web.service.spi.model.ServiceModel.removeServlet(ServiceModel.java:95) ~[?:?]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.unregisterServlet(HttpServiceStarted.java:421) ~[?:?]
at org.ops4j.pax.web.service.internal.HttpServiceProxy.unregisterServlet(HttpS
2019-06-30T22:36:54,539 | ERROR | FelixStartLevel | HttpServiceStarted | 142 - org.ops4j.pax.web.pax-web-runtime - 7.2.10 | Could not start the servlet context for context path [authservice]
java.lang.NullPointerException: null
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.startContext(HttpServiceContext.java:394) ~[?:?]
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:852) ~[?:?]
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278) ~[?:?]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:267) ~[?:?]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[?:?]
at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:329) ~[?:?]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerFilter(HttpServiceStarted.java:628) [142:org.ops4j.pax.web.pax-web-runtime:7.2.10]
at org.ops4j.pax.web.s
!SESSION 2019-08-22 21:05:16.288 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.4
java.vendor=Debian
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -application org.eclipse.tycho.surefire.osgibooter.uitest -testproperties /home/sb/workspaces/ws01/modeler/tests/modeler.test/target/surefire.properties
Command-line arguments: -data /home/sb/workspaces/ws01/modeler/tests/modeler.test/target/work/data -application org.eclipse.tycho.surefire.osgibooter.uitest -testproperties /home/sb/workspaces/ws01/modeler/tests/modeler.test/target/surefire.properties
!ENTRY org.eclipse.osgi 4 0 2019-08-22 21:05:17.138
!MESSAGE An error occurred while automatically activating bundle org.eclipse.ui.workbench (88).