>>>>> Jean-Baptiste Onofre <[email protected]>:

> I think that the problem is especially on the http.context version ;)
> I guess that if you put: org.osgi.service.http.context;version="[1,2)" in 
> Import-Package it works right ?

I saw nothing that used this package, so I went for suppression first
(just to see):
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        
<Import-Package>!org.osgi.service.http.context,*</Import-Package>
                    </instructions>
                </configuration>
            </plugin>

And that loaded fine in the pax exam test

The application also loaded fine from the karaf 4.3.2 console, but
didn't work unfortunately. From the karaf.log:
 https://gist.github.com/steinarb/f7b9120f5b4fafcaa099e582788bd7c1
(so I guess it was used after all)

But this worked, both for the pax exam test of the build, loading in
the karaf 4.3.2 console, and for the webapp actually working:
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        
<Import-Package>org.osgi.service.http.context;version="[1,2)",*</Import-Package>
                    </instructions>
                </configuration>
            </plugin>

(Lesson learned: always just listen to JB in the first place, instead of
trying something I think is simpler...)

> The difference is that the dependency used by the maven-bundle-plugin.

Yes, but what I was wondering, was: out of nearly tree identical maven
modules[1][2][3], why is this[3] one the only one that fails in this
manner?

 - Same contents: a ServletContextHelper and a ShiroFilter
 - Same maven-bundle-plugin version
 - Same maven-bundle-plugin config (both version and config set in the
   pluginManagment of the same parent)
 - Same JDK
 - Same maven
 - Same karaf version used in the build

Ah, well... I've gotten it working so I don't think I will spend more
time on it. :-)

Thanks again!

References:
[1] 
<https://github.com/steinarb/authservice/tree/master/authservice.web.security>
[2] <https://github.com/steinarb/handlereg/tree/master/handlereg.web.security>
[3] <https://github.com/steinarb/ukelonn/tree/master/ukelonn.web.security>



Reply via email to