Re: Possible to use newer derby for pax jdbc-config?

2024-04-07 Thread Steinar Bang
>>>>> Steinar Bang : > Ref.: https://github.com/ops4j/org.ops4j.pax.jdbc/issues/364 > Is it possible to use pax jdbc-config for derby with a newer version of > derby than the one provided by pax-jdbc 1.5.7? Not loading the pax-jdbc-derby feature and loading something el

Possible to use newer derby for pax jdbc-config?

2024-04-07 Thread Steinar Bang
Ref.: https://github.com/ops4j/org.ops4j.pax.jdbc/issues/364 Is it possible to use pax jdbc-config for derby with a newer version of derby than the one provided by pax-jdbc 1.5.7? Thanks! - Steinar -- -- -- OPS4J - http://www.ops4j.org - ops4j@googlegroups.com --- You

Re: The pax exam lifecycle explained?

2024-01-02 Thread Steinar Bang
> 'Christoph Läubrich' via OPS4J > : > Just in case you don not need all the fancy magic of pax exam what is > really only rarely needed in most cases you can use osgi-test > framework as a lightweight alternative: > https://github.com/osgi/osgi-test/ Interesting! What I want, except

Re: The pax exam lifecycle explained?

2023-12-12 Thread Steinar Bang
> Grzegorz Grzybek : > I see your messages about Pax Exam problems and frustrations and while I > don't have answers for your questions about liquibase OSGi problems Well... heh! I worked my way around the liquibase problems yesterday by swapping derby in the pax exam test of the feature

The pax exam lifecycle explained?

2023-12-12 Thread Steinar Bang
Does an explanation of the pax exam lifecycle exist somewhere? Both the life cycle of the OSGi process under test and the life cycle of the test itself. I've been using pax exam tests since 2015 but the behaviour of the tests have often been a mystery for me... -- -- -- OPS4J

Re: Searching for bean gives classNotFoundException

2023-12-11 Thread Steinar Bang
>>>>> Steinar Bang : > So I guess it has something to do with function scopes? I am thinking the clue is in one word in the error message: > [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:

Is a failing Pax Exam test run twice?

2023-12-11 Thread Steinar Bang
(I have a feeling I've asked this before but google doesn't find it) Is a failing pax exam test run twice? The reason I'm asking is that I saw this earlier today: https://gist.github.com/steinarb/640801f57b4bbec3cfa6d2aaefa37b16 First I get an assertion error in line 67 of the test:

Re: Searching for bean gives classNotFoundException

2023-12-11 Thread Steinar Bang
This is clumsy, but it worked: @Test public void testLoadFeature() throws Exception { // NOSONAR this test has an assert, just not an assert sonar recognizes installAndAssertFeature("karaf-liquibase-sample-datasource-receiver"); var service =

Re: Searching for bean gives classNotFoundException

2023-12-11 Thread Steinar Bang
So I tried a simple for loop instead: @Test public void testLoadFeature() throws Exception { // NOSONAR this test has an assert, just not an assert sonar recognizes installAndAssertFeature("karaf-liquibase-sample-datasource-receiver"); var service =

Searching for bean gives classNotFoundException

2023-12-11 Thread Steinar Bang
I need some pax exam help. I get a ClassNotFoundException I don't know how to fix. I can access the bean Account for use in asserts without errors. But once I use stream, filter and findFirst to find a particular account I get ClassNotFoundException on the account. I have the following pax

Re: Wrong assert displayed as failing when having a failing assert

2023-06-27 Thread Steinar Bang
> Grzegorz Grzybek : >> Where does the log affected by this config end up? > It should be a test log from Pax Exam itself in target directory of Maven > module: target/logs/pax-exam-test.log I wasn't able to make it work, unfortunately. I did the following: 1. Added the

Re: Wrong assert displayed as failing when having a failing assert

2023-06-24 Thread Steinar Bang
> Grzegorz Grzybek : > Hello > Sorry, but I didn't have time to check/run your integration tests. > You've mentioned that the test may be run twice - that's possible depending > on the configuration of maven-surefire/failsafe-plugin. I don't know. > Usually in such cases I turn on quite

Re: Wrong assert displayed as failing when having a failing assert

2023-06-11 Thread Steinar Bang
>>>>> Steinar Bang : >> You seem to be testing everything including verification of database >> content. Getting assertion exceptions in your tests code _may_ lead to >> transaction rollback (I have no idea if this is true - I'd have to see >> your entire te

Re: How to fix ClassNotFoundExceptions for exceptions thrown in pax exam test?

2023-06-07 Thread Steinar Bang
> Grzegorz Grzybek : > `RemoteBundleContextClientImpl` in the stack trace means that it (the stack > trace) comes from client side of the test. > Pax Exam is not difficult if it comes about writing @Test-annotated > methods, but it is very difficult when trying to set everything up >

Re: Wrong assert displayed as failing when having a failing assert

2023-06-07 Thread Steinar Bang
> Grzegorz Grzybek : > Hello > I'd like to help, but seeing this in your shared test: > final MavenArtifactUrlReference sampleappFeatureRepo = maven() >> .groupId("no.priv.bang.karaf") >> .artifactId("karaf.liquibase.sample.datasource.receiver") >> > doesn't help - this is your

Wrong assert displayed as failing when having a failing assert

2023-06-04 Thread Steinar Bang
Platform: debian 11.7 "bullseye", amd64 openjdk-17-jdk:amd64 17.0.6+10-1~deb11u1 (ie. java 17) karaf 4.4.3 pax-exam 4.13.5 eclipse 2023-03 (4.27.0) What I usually do when creating JUnit tests is to run in a red-green-red-green... rythm, the way Martin

How to fix ClassNotFoundExceptions for exceptions thrown in pax exam test?

2023-06-03 Thread Steinar Bang
Platform: debian 11.7 "bullseye", amd64 openjdk-17-jdk:amd64 17.0.6+10-1~deb11u1 (ie. java 17) karaf 4.4.3 pax-exam 4.13.5 eclipse 2023-03 (4.27.0) I am trying to run a pax exam test that runs a liquibase changelist to set up a schema and then add a row to

Re: Will ServletContext OSGi service injections be available in the OSGi 7 compatible web whiteboard

2020-04-02 Thread Steinar Bang
Injection of ServletContext worked (as can be seen earlier in this thread). But it turns out it wasn't needed because the Shiro AbstractFilter class[1] extends ServletContextSupport[2], and saves the ServletContext when receiving the FilterConfig[3]. So shiro filters already have the

Re: Will ServletContext OSGi service injections be available in the OSGi 7 compatible web whiteboard

2020-03-23 Thread Steinar Bang
>>>>> Steinar Bang : >> [snip!] >>> objectClass = [javax.servlet.ServletContext] >>> osgi.web.contextname = authservice >>> osgi.web.contextpath = /authservice >>> osgi.web.symbolicname = no.priv.bang.authservice.web.security >>>

Re: Will ServletContext OSGi service injections be available in the OSGi 7 compatible web whiteboard

2020-03-23 Thread Steinar Bang
>>>>> Steinar Bang : > [snip!] >> objectClass = [javax.servlet.ServletContext] >> osgi.web.contextname = authservice >> osgi.web.contextpath = /authservice >> osgi.web.symbolicname = no.priv.bang.authservice.web.security >> Hm... so why don'

Re: Will ServletContext OSGi service injections be available in the OSGi 7 compatible web whiteboard

2020-03-23 Thread Steinar Bang
>>>>> Steinar Bang : [snip!] > objectClass = [javax.servlet.ServletContext] > osgi.web.contextname = authservice > osgi.web.contextpath = /authservice > osgi.web.symbolicname = no.priv.bang.authservice.web.security > Hm... so why don't I get service in

Re: Will ServletContext OSGi service injections be available in the OSGi 7 compatible web whiteboard

2020-03-23 Thread Steinar Bang
> Grzegorz Grzybek : > As you can see, the properties you're looking for are there. Please > check `bundle-services -p` command (or Karaf 4 equivalent) to check > what can you filter by. Thanks, Grzegorz! Yep, the properties are present: karaf@root()> bundle:services -p 63 Authentication

Re: Will ServletContext OSGi service injections be available in the OSGi 7 compatible web whiteboard

2020-03-22 Thread Steinar Bang
> Grzegorz Grzybek : >> Will it be possible to get a ServletContext OSGi service injected into a >> @Reference, when using the web whiteboard of OSGi 7? >> > Sure - it's described in 128.3.4 Publishing the Servlet Context chapter of > CMPN specification and I think it should already be a

Will ServletContext OSGi service injections be available in the OSGi 7 compatible web whiteboard

2020-02-11 Thread Steinar Bang
I'm currently using shiro 1.5.0 with web whiteboard in karaf 4.2.8. I'm using some deprecated Shiro classes to set up shiro, and I want to get rid of using the deprecated classes. The first snag I've encountered when replacing the deprecated classes is that the IniWebEnvironment class needs a

Re: Derby is looking for assistance with OSGi compatibility

2019-10-19 Thread Steinar Bang
> "'Mark Raynsford' via OPS4J" > : > Yes, I'm going to get the OSGi headers into the published Derby > artifacts (at a minimum) this weekend. Implementing the OSGi JDBC > service also looks pretty easy, so I'll be attempting that too. Another nice thing to have for us karaf users, is if

Re: Problems running pax exam with openjdk-11

2019-06-18 Thread Steinar Bang
> Freeman Fang : > You run into this error when building latest karaf master branch with JDK11? Yes. -- -- -- OPS4J - http://www.ops4j.org - ops4j@googlegroups.com --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To

Re: Problems running pax exam with openjdk-11

2019-06-17 Thread Steinar Bang
> Freeman Fang : > FYI, I’m using OpenJDK11, Karaf tests work for me with OpenJDK11 > Btw, my env is > Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; > 2018-10-24T14:41:47-04:00) > Maven home: /Users/ffang/kit/apache-maven-3.6.0 > Java version: 11, vendor: Oracle Corporation,

Re: Problems running pax exam with openjdk-11

2019-06-16 Thread Steinar Bang
> Jean-Baptiste Onofré > : > Did you try with a clean maven repo ? Yes. rm -rf ~/.m2/repository cd ~/workspaces/karaf/karaf git checkout master mvn clean install Fails in this integration test: ... [INFO] Running org.apache.karaf.itests.EquinoxTest 2019-06-16 19:20:40,563 | INFO

Re: Problems running pax exam with openjdk-11

2019-06-16 Thread Steinar Bang
> Jean-Baptiste Onofré > : > You can't use Felix framework 6 as it's OSGi R7. I switched to 5.6.12 which is the one that karaf master currently uses, but got the same failure as with 6.0.3 ("Error installing bundle listed in startup.properties..."). Stack trace included below. > I

Re: Problems running pax exam with openjdk-11

2019-06-14 Thread Steinar Bang
> Freeman Fang : > Hi, > Please see the attached patch file, with it, that test can pass with jdk11. Thanks! No luck on my side, unfortunately...:-( It still fails with the error messages below (However, I had to apply everything except the top pom manually, and I may have done something

Re: Problems running pax exam with openjdk-11

2019-06-08 Thread Steinar Bang
>>>>> Steinar Bang : >>>>> Steinar Bang : >> Side note: I did not intentionally use the eclipse OSGi framework for >> the pax exam test. >> I pulled in the pax-exam-container-karaf which does not pull in an OSGi >> framework, and then neede

Re: Problems running pax exam with openjdk-11

2019-06-08 Thread Steinar Bang
>>>>> Steinar Bang : >>>>> Freeman Fang >>>>> : >> Hi, >> If you can send a reproducer project which I can build and run to reproduce >> this problem, I will take a close look. > git clone https://github.com/steinarb/authservic

Re: Problems running pax exam with openjdk-11

2019-06-07 Thread Steinar Bang
> Freeman Fang : > Hi Steinar, > Good catch, and this is a known issue in > https://bugs.eclipse.org/bugs/show_bug.cgi?id=515286 > > And this issue has already been fixed. Thanks for the info! Good to hear! :-) > To run your test

Re: Problems running pax exam with openjdk-11

2019-06-06 Thread Steinar Bang
>>>>> Steinar Bang : >>>>> Steinar Bang : >>> And the reason it tries to throw an exception tin the first place, is >>> that ADD_FWK_URL_METHOD is because the "addUrl" method is missing from >>> the URL class. >>

Re: Problems running pax exam with openjdk-11

2019-06-02 Thread Steinar Bang
>>>>> Steinar Bang : >> And the reason it tries to throw an exception tin the first place, is >> that ADD_FWK_URL_METHOD is because the "addUrl" method is missing from >> the URL class. > From the google searches I've made addUrl() hasn't appear

Re: Problems running pax exam with openjdk-11

2019-06-02 Thread Steinar Bang
>>>>> Steinar Bang : > And the reason it tries to throw an exception tin the first place, is > that ADD_FWK_URL_METHOD is because the "addUrl" method is missing from > the URL class. >From the google searches I've made addUrl() hasn't appeared on t

Re: Problems running pax exam with openjdk-11

2019-06-02 Thread Steinar Bang
>>>>> Steinar Bang : >>>>> Steinar Bang : >> I've added the VMOptions to the startup but I still get the same stack >> trace, ie. a NullPointerException thrown from here: >> public class FrameworkExtensionInstaller { >> ... >

Re: Problems running pax exam with openjdk-11

2019-06-02 Thread Steinar Bang
>>>>> Steinar Bang : > I've added the VMOptions to the startup but I still get the same stack > trace, ie. a NullPointerException thrown from here: > public class FrameworkExtensionInstaller { > ... > void addExtensionContent0(Collection revisions,

Problems running pax exam with openjdk-11 (Was: Problems running pax exam with openjdk-8)

2019-06-02 Thread Steinar Bang
(hm... my mind crosswired and wrote the wrong subject, but it looks like the meaning got though anyway... subject corrected) > Freeman Fang : > You need to add some VMOption by yourself, something like [snip!] > You can take a look at [1] to get more details about how we do it in Karaf. >

Problems running pax exam with openjdk-8

2019-06-01 Thread Steinar Bang
This pax exam test, using the karaf runner, with karaf 4.2.5, runs with openjdk-8 but fails with openjdk-11: https://github.com/steinarb/scratch/blob/authservice/use-java-11/authservice.tests/src/test/java/no/priv/bang/authservice/tests/AuthserviceIntegrationTest.java#L25 Will pax exam work

Re: Question to pax-jdbc devs: how do you handle DataSourceFactory bundle restart?

2019-06-01 Thread Steinar Bang
> Grzegorz Grzybek : > Hello > I added a comment to > https://github.com/pgjdbc/pgjdbc/issues/1476#issuecomment-497635922 Thanks for working on this! (I've worked around this by using a karaf feature to load the PostgreSQL JDBC driver, because then I can avoid reloading the PostgreSQL JDBC

Re: Question to pax-jdbc devs: how do you handle DataSourceFactory bundle restart?

2019-05-01 Thread Steinar Bang
> 'Christoph Läubrich' via OPS4J > : > DriverManger.register/unregister can't work reliable in OSGi > (especially with static insitilizer), thus always the > DataSourceFactory should be used instead! PGDataSourceFactory is currently implemented using the regular PG JDBC driver, ie. the

Re: Question to pax-jdbc devs: how do you handle DataSourceFactory bundle restart?

2019-04-30 Thread Steinar Bang
> Christian Schneider > : > I see no calls to DriverManager in > https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/osgi/PGBundleActivator.java The DriverManager isn't called directly from the PGBundleActivator. 1. DriverManager.registerDriver() is called

Question to pax-jdbc devs: how do you handle DataSourceFactory bundle restart?

2019-04-29 Thread Steinar Bang
I ran into a problem with the PostgreSQL JDBC driver running as an OSGi bundle in karaf: https://github.com/pgjdbc/pgjdbc/issues/1476 In short: the bundle works before restart, but after restart DataSouce.getConnection() is unable to find the JDBC driver. I've debugged through what happens, and

[Announce] Shiro-based "poor man's SSO" for Apache Karaf applications

2019-04-15 Thread Steinar Bang
https://github.com/steinarb/authservice I wrote this to cover my own usecase, which was to have the same login for nginx itself, as well as a couple of web whiteboard webapps running in the same apache karaf, behind the nginx server through a reverse proxy setup. Cross-webapp SSO works by

Re: Web whiteboard: is the order of filter and servlet registration signifikant?

2019-02-18 Thread Steinar Bang
> "'Achim Nierbeck' via OPS4J" > : > afaik, at least I think I or someone else tried to implement it, the rank > of a service is taken into account when > registering a filter for a servlet. Servlets itself don't have a "Ordering" > so the rank of the servlet filter can be used for

Web whiteboard: is the order of filter and servlet registration signifikant?

2019-02-12 Thread Steinar Bang
(Here's another registration order question from me) The question this time is about filters and servlets: must filters be registered before the servlets they are filtering? Or doesn't the order of registration matter? -- -- -- OPS4J - http://www.ops4j.org -

Re: web whiteboard construction order?

2019-01-13 Thread Steinar Bang
> "'Achim Nierbeck' via OPS4J" > : > yes please open an issue for it ;) Here is the issue: https://ops4j1.jira.com/browse/PAXEXAM-925 -- -- -- OPS4J - http://www.ops4j.org - ops4j@googlegroups.com --- You received this message because you are subscribed to the

Re: Need ops4j JIRA user to report a bug

2019-01-13 Thread Steinar Bang
> "'Achim Nierbeck' via OPS4J" > : > Done, > welcome aboard ;) Thanks! :-) -- -- -- OPS4J - http://www.ops4j.org - ops4j@googlegroups.com --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and

Need ops4j JIRA user to report a bug

2019-01-11 Thread Steinar Bang
Hi, I need an ops4j JIRA user to report a bug. Thanks! - Steinar -- -- -- OPS4J - http://www.ops4j.org - ops4j@googlegroups.com --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and stop receiving

Re: web whiteboard construction order?

2019-01-09 Thread Steinar Bang
> "'Achim Nierbeck' via OPS4J" > : > Hi Steinar, > yes please open an issue for it ;) Will do! It looks like self service is switched off again. Could you create a user for me. This email address is fine. Thanks! -- -- -- OPS4J - http://www.ops4j.org -

Re: web whiteboard construction order?

2019-01-09 Thread Steinar Bang
> "'Achim Nierbeck' via OPS4J" : > Hi Steinar, > yes please open an issue for it ;) Will do! It looks like self service is switched off again. Could you create a user for me. This email address is fine. Thanks! -- -- -- OPS4J - http://www.ops4j.org -

Re: web whiteboard construction order?

2019-01-07 Thread Steinar Bang
> Nhut Thai Le : > I had this question a few months ago. You don't need to control the > registration order of ServletContextHelper and ServletFilter. Just use > osgi.http.whiteboard.context.select propery to wire the servlet, filter to > the context. Ok. Thanks! My problem is probably

Re: web whiteboard construction order?

2019-01-07 Thread Steinar Bang
>>>>> Steinar Bang : > When using pax web whiteboard, is it necessary for a > ServletContextHelper creating a webcontext to be created before any > servlets or filters using it? > If so: is there a way of enforcing construction order when the > ServletConte

web whiteboard construction order?

2019-01-07 Thread Steinar Bang
When using pax web whiteboard, is it necessary for a ServletContextHelper creating a webcontext to be created before any servlets or filters using it? If so: is there a way of enforcing construction order when the ServletContextHelper, a shiro filter using the context, and a jersey servlet both

Re: Adding provided dependencies makes pax exam tests fail

2019-01-04 Thread Steinar Bang
>>>>> Steinar Bang : >>>>> Steinar Bang : >> Platform: >> debian 9.6 "stretch", >> openjdk-8 8u181-b13-2~deb9u1, >> maven 3.3.9, >> pax exam 4.10.0 >> When I add some maven dependencies with provided, wi

Re: Adding provided dependencies makes pax exam tests fail

2018-12-29 Thread Steinar Bang
>>>>> Steinar Bang : > Platform: > debian 9.6 "stretch", > openjdk-8 8u181-b13-2~deb9u1, > maven 3.3.9, > pax exam 4.10.0 > When I add some maven dependencies with provided, without > changing anything else, my karaf-based pax exam test starts fa

Adding provided dependencies makes pax exam tests fail

2018-12-28 Thread Steinar Bang
Platform: debian 9.6 "stretch", openjdk-8 8u181-b13-2~deb9u1, maven 3.3.9, pax exam 4.10.0 When I add some maven dependencies with provided, without changing anything else, my karaf-based pax exam test starts failing. Is this expected? My initial feeling was that adding "provided"

Re: Is it possible to use servlet 3.0 api annotations with pax web whiteboard?

2018-10-30 Thread Steinar Bang
> "'Achim Nierbeck' via OPS4J" : > depends on who will pickup the task :) Ok. What's in OSGi 7 is just a spec, and is an extension to OSGi core (that's what "compendium" means?), so it will never be in the OSGi core of e.g. equinox or Apache Felix? It will need to be implemented by

Re: Is it possible to use servlet 3.0 api annotations with pax web whiteboard?

2018-10-29 Thread Steinar Bang
> "'Achim Nierbeck' via OPS4J" : > OSGi 7? Not yet. Ok. Any idea when? Thanks! -- -- -- OPS4J - http://www.ops4j.org - ops4j@googlegroups.com --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group

Re: Is it possible to use servlet 3.0 api annotations with pax web whiteboard?

2018-10-29 Thread Steinar Bang
> "'Achim Nierbeck' via OPS4J" : > you have to decide if you want to do the Whiteboard approach, or > Servlet 3 annotations. Ok. > If you want to use Whiteboard do as you alsready did. > If you want to use Servlet 3.0 annotations, make shure to define your > application to be a

Is it possible to use servlet 3.0 api annotations with pax web whiteboard?

2018-10-28 Thread Steinar Bang
Is it possible to use servlet 3.0 api annotations with pax web whiteboard? Is it possible to define the whiteboard context in a simple manner? I'm currently using pax web whiteboard in apache karaf 4.1.5 (pax web 6.0.3, I think). But the current annotations are a bit cumbersome and clumsy, and

Re: Pax Web Whiteboard with DS: problems with making context path work

2018-04-01 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: >> The handler for the ServletContextHelper service seems to do stuff with >> both HTTP_WHITEBOARD_CONTEXT_NAME and HTTP_WHITEBOARD_CONTEXT_PATH, but >> I havn't yet determined how it works and how to connect things to a &g

Re: Pax Web Whiteboard with DS: problems with making context path work

2018-03-31 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: > The handler for the ServletContextHelper service seems to do stuff with > both HTTP_WHITEBOARD_CONTEXT_NAME and HTTP_WHITEBOARD_CONTEXT_PATH, but > I havn't yet determined how it works and how to connect things to a > servlet, a

Re: Pax Web Whiteboard with DS: problems with making context path work

2018-03-31 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: >> I have now tried to add a context path to the property argument of >> the @Component annotation, but that doesn't seem to work: the Vaadin >> servlet now matches everything from the top (because of the "/*"

Pax Web Whiteboard with DS: problems with making context path work

2018-03-31 Thread Steinar Bang
I'm in the process of transitioning a Vaadin war web application with web.xml to the Pax Web Whiteboard extender. One thing that was lost in the transition, was the web application context path. The web.xml of the original webapp let the Vaadin servlet match everything from "/*" which matched

Re: Pax Whiteboard, ShiroFilter and error message: "No WebEnvironment found: no EnvironmentLoaderListener registered?"

2018-03-26 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: >>>>> Александр <pro...@gmail.com>: >> Thats right. >> My solution is to build shiro infrastructure (securitymanager, realms, >> filterchainresolver) by myself as a beans in blueprint, bec

Re: Pax Whiteboard, ShiroFilter and error message: "No WebEnvironment found: no EnvironmentLoaderListener registered?"

2018-03-24 Thread Steinar Bang
> Александр : > Thats right. > My solution is to build shiro infrastructure (securitymanager, realms, > filterchainresolver) by myself as a beans in blueprint, because I can > inject to them other services (like Datasource, or EntityManager). I do not > use ini file, and

Re: Code example for accessing the ServletContext in pax whiteboard?

2018-03-21 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: > I guess one way to do this would be to create a @Component that > implements the Filter interface and wraps a ShiroFilter. Ie. it creates > a ShiroFilter instance and calls init(FilterConfig) on the ShiroFilter > and then does

Re: Code example for accessing the ServletContext in pax whiteboard?

2018-03-21 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: [snip!] > Is there any guarantee that activate() won't be called until after > init(FilterConfig) has been called? Nope. When activate() was called, getFilterConfig() returned null: @Activate public void activate() {

Re: Code example for accessing the ServletContext in pax whiteboard?

2018-03-21 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: > Does anyone have a code example for how to get the ServletContext in a > filter? > I tried adding a @Reference for javax.servlet.ServletContext in a DS > component, but that @Reference never received a service

Code example for accessing the ServletContext in pax whiteboard?

2018-03-21 Thread Steinar Bang
Does anyone have a code example for how to get the ServletContext in a filter? I tried adding a @Reference for javax.servlet.ServletContext in a DS component, but that @Reference never received a service injection. -- -- -- OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

Re: Pax Whiteboard, ShiroFilter and error message: "No WebEnvironment found: no EnvironmentLoaderListener registered?"

2018-03-20 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: >>>>> Steinar Bang <s...@dod.no>: >>> Do you register WebSecurityManager and FilterChainResolver as a services? >> No I haven't. Should I? I thought Pax Whiteboard Extender handles >> creati

Re: Pax Whiteboard, ShiroFilter and error message: "No WebEnvironment found: no EnvironmentLoaderListener registered?"

2018-03-20 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: >> Do you register WebSecurityManager and FilterChainResolver as a services? > No I haven't. Should I? I thought Pax Whiteboard Extender handles > creating the appropriate services? Hm... it did seem to work earlier, but no

Re: Pax Whiteboard, ShiroFilter and error message: "No WebEnvironment found: no EnvironmentLoaderListener registered?"

2018-03-20 Thread Steinar Bang
>>>>> Alexander Rotnov <pro...@gmail.com>: > On Tuesday, March 20, 2018 at 1:17:29 AM UTC+3, Steinar Bang wrote: >> >> >> 3. The filter fails when the application is loaded into karaf 4.1.5 > What kind of fails? Well, now the pax exam tests works

Re: Pax Whiteboard, ShiroFilter and error message: "No WebEnvironment found: no EnvironmentLoaderListener registered?"

2018-03-19 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: >>>>> Alexander Rotnov <pro...@gmail.com>: >> I also faces this problem, while adopt Shiro to Karaf and Pax Web. My >> solution - do not try to initialize filter from WebEnvironment, as in >> S

Re: Pax Whiteboard, ShiroFilter and error message: "No WebEnvironment found: no EnvironmentLoaderListener registered?"

2018-03-19 Thread Steinar Bang
> Alexander Rotnov : > I also faces this problem, while adopt Shiro to Karaf and Pax Web. My > solution - do not try to initialize filter from WebEnvironment, as in > ShiroFilter. > Try to extend AbstractShiroFilter and inject to it WebSecurityManager and >

Pax Whiteboard, ShiroFilter and error message: "No WebEnvironment found: no EnvironmentLoaderListener registered?"

2018-03-18 Thread Steinar Bang
Has anyone else been using apache shiro with the pax web whiteboard extender? Has anyone else succeeded in making it work? Shiro uses a filter to handle authentication and authorization for a paths of a webapp. I'm trying to create a ShiroFilter DS component to front a servlet (also a DS

Re: DS Pax whiteboard example with multiple URL patterns anywhere?

2018-03-18 Thread Steinar Bang
> Александр : > Pax Web parses @WebServlet and @WebFilter annotations, but a little buggy > (ignore "name" property of @WebServlet, so if you need a filter on it, use > whiteboard constant for it). > In your case, to declare multiple values for property just add two >

Re: DS Pax whiteboard example with multiple URL patterns anywhere?

2018-03-16 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: >>>>> Steinar Bang <s...@dod.no>: >> I'm in the process of replacing my own home brewed "mini dependency >> injection"[1] with Declarative Services (DS). >> I'm wondering how to repl

DS Pax whiteboard example with multiple URL patterns anywhere?

2018-03-16 Thread Steinar Bang
I'm in the process of replacing my own home brewed "mini dependency injection"[1] with Declarative Services (DS). I'm wondering how to replace what I was doing here:

Pax web whiteboard extender: possible with multiple aliases? Possible with wildcards in alias?

2018-02-21 Thread Steinar Bang
Is it possible to have more than one alias for a servlet when using the pax web whiteboard extender? Is it possible to have a wildcard in an alias? Thanks! - Steinar -- -- -- OPS4J - http://www.ops4j.org - ops4j@googlegroups.com --- You received this message because you

Re: pax web and react.js?

2018-02-20 Thread Steinar Bang
> nino martinez wael : > I havent tried it with react, but done it with different things.. > I used the osgi HTTP Service to deliver my static content.. Why not use CXF > REST endpoints for the dynamic parts? OR does the frontend need to be > "totally"

pax web and react.js?

2018-02-18 Thread Steinar Bang
Has anyone on this mailing lists done any experiments in writing a react.js application and deliver it through pax web? Has anyone tried dynamic server side rendering on nashorn or rhino? Has anyone tried packing a react.js application up with webpack and serving it from a pax web servlet?

Re: Relationship between Pax web whiteboard extender and the OSGi R6 httpextender?

2017-10-21 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: > But I'm having a hard time figuring out how to use this stuff. The > documentation of Vaadin OSGi doesn't make sense to me... The ideal thing would have been if I could just expose eg. UIProvider as a service and Vaadin wo

Relationship between Pax web whiteboard extender and the OSGi R6 httpextender?

2017-10-18 Thread Steinar Bang
I've heard about, and have used, the pax web whiteboard extender[1]. I've tried using Vaadin 8.1.5 with the whiteboard extender, and have run into some problems[2]. Then I suddenly discovered that the vaadin bundles exposed servies and googled some more and found "Vaadin OSGi support"[3] Vaadin

Re: What scope for maven dependencies for code used in pax exam test?

2017-10-15 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: [snip!] >> What I would like to do, is to add the dependencies in >> compile and let karaf-maven-plugin generate a feature >> file from the compile dependencies, and then use that feature file in >> the pax exam kar

Re: What scope for maven dependencies for code used in pax exam test?

2017-10-14 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: > What happens if I put the dependencies in compile? > Will this mess up the pax exam OSGi runtime startup? > What I would like to do, is to add the dependencies in > compile and let karaf-maven-plugin generate a feature >

What scope for maven dependencies for code used in pax exam test?

2017-10-14 Thread Steinar Bang
What scope should be used for maven dependencies for code used in pax exam tests? Should the compilation dependencies be done by using test and the runtime dependencies be handled by adding a bundle to the pax exam config? What happens if I put the dependencies in compile? Will this mess up the

Re: Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-09 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: > The problem is similar to what was seen in this bug, 6 years ago > https://ops4j1.jira.com/browse/PAXEXAM-274 > But the bug was 6 years ago, and many versions of everything (OSGi, > pax-exam, mockito, Java) ago, so I'm not sur

Re: Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-08 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: > Is there something else I can try? Looking closer at the error message: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "$javax.servlet.http.HttpServletReques

Re: Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-08 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: >>>>> Steinar Bang <s...@dod.no>: >> This worked fine in getting karaf to start and the service to be >> produced, but actually using mockito mocks failed: >> java.lang.LinkageError: loader const

Re: Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-07 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: > This worked fine in getting karaf to start and the service to be > produced, but actually using mockito mocks failed: > java.lang.LinkageError: loader constraint violation in interface itable > init

Re: Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-07 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: > Plan going forward: > 1. Create a feature file in the test project (ie. a real artifact and > not a test scope thing), using karaf-maven-plugin and the above > three bundles as compile dependencies of the test p

Re: Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-07 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: > Can anyone spot what I've missed in the copy/paste...? I think I did. > [1] > <https://github.com/steinarb/ukelonn/blob/master/ukelonn.tests/src/test/java/no/priv/bang/ukelonn/tests/UkelonnServiceIntegrationTest.java#L45&g

Pax-exam karaf test fails to start up because it can't get a BundleContext

2017-10-07 Thread Steinar Bang
Karaf 4.1.2 Pax-exam 4.11.0 Java 1.8 Windows 10 I'm trying to copy-paste stuff from a working pax-exam karaf test[1], but the copy-pasted test[2] fails in startup, because it can't find the BundleContext{3]. Stack trace of the failing unit test is[4]. I have tried commenting out my own stuff in

Re: OPS4J Pax URL, find what maven repository has an artifact?

2017-09-04 Thread Steinar Bang
> Grzegorz Grzybek : > What you described is implemented in JBoss Fuse 6.x / Fabric8 v1. But it's > not that big problem to try to implement it. > 1b) "scan the configured repositories" - you have > org.ops4j.pax.url.mvn.repositories property in org.ops4j.pa.url.mvn PID

Re: OPS4J Pax URL, find what maven repository has an artifact?

2017-09-04 Thread Steinar Bang
> Jean-Baptiste Onofré : > it's already what I replied on the Karaf mailing list. > AFAIR, Steinar wants to avoid bundle:update: he wants an auto-update > (and bundle:watch can only update from the local repository). Yes, that is correct. It's the final

OPS4J Pax URL, find what maven repository has an artifact?

2017-09-04 Thread Steinar Bang
I'm thinking about writing an OSGi plugin for karaf that can be configured to watch a remote repository for snapshot updates. The idea is to do something like this 1. For each configured bundle, if the bundle has a snapshot version, intially do a. Get the maven coordinates b. Scan the

Re: java.lang.ClassCastException: org.apache.derby.jdbc.ClientDriver cannot be cast to org.apache.derby.jdbc.InternalDriver

2017-08-18 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>: > I am trying to write the derby database to a derby network server, and > that doesn't work well: > java.lang.ClassCastException: org.apache.derby.jdbc.ClientDriver cannot be > cast to org

  1   2   >