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 recei

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 f

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 wit

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: 6.93

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: https://g

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 = getOsgiService(SampleLiquibas

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 = getOsgiService(SampleLi

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 exam

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 log4j2-test.properti

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 detail

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 enti

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 > correctl

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 priv

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 Fowle

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 ServletConte

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't

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 inje

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 w

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 cas

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 Ser

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 unsubscribe

Re: Problems running pax exam with openjdk-11

2019-06-17 Thread Steinar Bang
>>>>> Steinar Bang : >> 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-ma

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-15 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 wil

Re: Problems running pax exam with openjdk-11

2019-06-15 Thread Steinar Bang
I've pushed my current jdk11/pax exam experiments to this branch https://github.com/steinarb/scratch/tree/authservice/use-java-11 Freeman Fang's changes are in https://github.com/steinarb/scratch/tree/authservice/fix-jdk-11-pax-exam One thing I noticed with "mvn dependency:tree" was that the JD

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 wr

Re: Problems running pax exam with openjdk-11

2019-06-08 Thread Steinar Bang
>>>>> Steinar Bang : > I noticed that the osgi.core version 6.0.0 artifact I have been using, was > pretty old (July 2014): > https://mvnrepository.com/artifact/org.osgi/org.osgi.core > So I looked for OSGi 7 and found this: > https://mvnrepository.com/arti

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 : > 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 needed to make a reference to the pax jdbc karaf >

Re: Problems running pax exam with openjdk-11

2019-06-07 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, > 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/authservice.git cd authservice git checkout work/use-java-11 mvn clean install If your Java is java-11, then t

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 wit

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. >> From

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

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 app

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 revisi

Re: Problems running pax exam with openjdk-11

2019-06-02 Thread Steinar Bang
>>>>> Steinar Bang : >>>>> 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. >> [1]https://github.com/apa

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

2019-06-01 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. > [1

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 wit

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 b

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 D

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-14 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 provid

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 oderin

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 - ops4j@googlegroups.

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 Googl

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 em

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 - ops4j@googlegr

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 - ops4j@googlegroups.co

Re: web whiteboard construction order?

2019-01-08 Thread Steinar Bang
> Nhut Thai Le : > I had some REST api hosted by jersey running on a stand alone version of > jetty but when we moved to paxweb, i was not able to make it work anymore, > so i end up switching to aries-jax-rs-whiteboard. I have Jersey in Karaf working in two different places: https://github.

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 som

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 > ServletContextHe

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 us

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, without >>

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" depende

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" : > 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 somethin

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 and

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 WebApplicatio

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 ex

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

2018-04-01 Thread Steinar Bang
>>>>> Steinar Bang : >> 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 >> servle

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

2018-03-31 Thread Steinar Bang
>>>>> Steinar Bang : > 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, and (hopeful

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

2018-03-31 Thread Steinar Bang
>>>>> Steinar Bang : >> 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 "/*" >> pattern)

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

2018-03-31 Thread Steinar Bang
>>>>> Steinar Bang : > 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 "/*" pattern) and I > don&

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

2018-03-30 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 bot

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

2018-03-26 Thread Steinar Bang
>>>>> 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 D

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 actually I do not use

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

2018-03-21 Thread Steinar Bang
>>>>> Steinar Bang : > 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 its own thing.

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

2018-03-21 Thread Steinar Bang
>>>>> Steinar Bang : [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 : > 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. I've found this ht

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 : >>>>> Steinar Bang : >>> 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? [sni

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

2018-03-20 Thread Steinar Bang
>>>>> Steinar Bang : >> 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 now I did an ex

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

2018-03-20 Thread Steinar Bang
>>>>> Alexander Rotnov : > 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 from inside eclipse

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

2018-03-19 Thread Steinar Bang
>>>>> 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 Abstr

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 > FilterChainResolver. Thanks! I

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

2018-03-19 Thread Steinar Bang
> "'Achim Nierbeck' via OPS4J" : > Hi Steinar, > I thought that's what pax shiro is for. [1] > regards, Achim > [1] - https://github.com/ops4j/org.ops4j.pax.shiro Hm... I've looked at this before, and I can't remember what the conclusions were. I think I landed on there not being anything

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 compone

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 > properties with same key:

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

2018-03-16 Thread Steinar Bang
>>>>> Steinar Bang : >>>>> 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 replac

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

2018-03-16 Thread Steinar Bang
>>>>> 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: > > https://github.com/steinarb/ukelonn/blob/b369b

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: https://github.com/steinarb/ukelonn/blob/b369b5768c08a1c6bb6fb422e2f462ca797c253f/ukelonn.bundle/src/main/java/no/priv/bang/ukelon

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 are

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" dynamic? I haven't made up my mind ab

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? Thank

TIP: Minimal Pax Web Whiteboard Extender servlet service example

2017-11-25 Thread Steinar Bang
This may be of interest: This is a minimal example of a Declarative Services component that exposes a Servlet service, that plugs into the pax whiteboard extender[1]. What the servlet does is very simple: it accepts POST messages, and dumps each POST message body to a temp file, and writes the nam

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

2017-10-21 Thread Steinar Bang
>>>>> Steinar Bang : > 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 would pick it up and

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 : [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 karaf config. [snip!] &g

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

2017-10-14 Thread Steinar Bang
>>>>> Steinar Bang : > 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 > file from the comp

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

  1   2   >