>>>>> Steinar Bang <[email protected]>:

> But I had a thought waking up today:

> The reason it works when running locally is probably that the
> troublesome jar file in the stack trace is already in my
> $HOME/.m2/repository/ before I and the reason it fails in docker, is
> probably that it starts with an empty $HOME/.m2/repository/

> So somewhere in the dependency graph there are two versions of a feature
> that at one point in time pulled in the troublesome jar and no longer
> does (in the newest version) and that this is the loop hinted to in the
> stack trace...?

I found this article for how to examine the file system of a docker
image:
 https://www.baeldung.com/ops/docker-container-filesystem

I wanted to examine /root/.m2/repository/ which meant I had to use the
approach to start a shell in a running container:
sb@lorenzo:~$ docker run -p 8101:8101 -p 8181:8181  -e 
"DATABASE_CONTENT_URL=https://gist.githubusercontent.com/steinarb/8a1de4e37f82d4d5eeb97778b0c8d459/raw/6cddf18f12e98d704e85af6264d81867f68a097c/dumproutes.sql";
 -d steinarb/oldalbum:latest
8c9cf448ba6e84a087964288b5ba1fd698322c61a2af9d9f94f9d78b23ed3d03
sb@lorenzo:~$ docker ps
CONTAINER ID        IMAGE                      COMMAND             CREATED      
       STATUS              PORTS                                                
                 NAMES
8c9cf448ba6e        steinarb/oldalbum:latest   "karaf run"         8 seconds 
ago       Up 6 seconds        0.0.0.0:8101->8101/tcp, 1099/tcp, 44444/tcp, 
0.0.0.0:8181->8181/tcp   elegant_murdock
sb@lorenzo:~$ docker exec -it 8c9cf448ba6e /bin/bash
root@8c9cf448ba6e:/# ls -al /root/
total 20
drwx------ 1 root root 4096 Feb 20 08:52 .
drwxr-xr-x 1 root root 4096 Feb 20 08:52 ..
-rw-r--r-- 1 root root 3106 Apr  9  2018 .bashrc
drwxr-xr-x 3 root root 4096 Feb 20 08:52 .m2
-rw-r--r-- 1 root root  148 Aug 17  2015 .profile
root@8c9cf448ba6e:/# cd /root/.m2/repository
root@8c9cf448ba6e:~/.m2/repository# grep -r encoder
org/apache/shiro/shiro-features/1.7.0/shiro-features-1.7.0-features.xml:        
<bundle>wrap:mvn:org.owasp.encoder/encoder/1.2.2</bundle>
Binary file org/owasp/encoder/encoder/1.2.2/encoder-1.2.2.jar matches
root@8c9cf448ba6e:~/.m2/repository#

So, the only reference to the encoder jar, is from shiro.  Could it be
that I'm pulling in multiple versions of shiro?

root@8c9cf448ba6e:~/.m2/repository# grep -r "shiro-features"
no/priv/bang/oldalbum/oldalbum.web.security/1.6.4/oldalbum.web.security-1.6.4-features.xml:
    
<repository>mvn:org.apache.shiro/shiro-features/1.7.0/xml/features</repository>
no/priv/bang/oldalbum/oldalbum.web.api/1.6.4/oldalbum.web.api-1.6.4-features.xml:
    
<repository>mvn:org.apache.shiro/shiro-features/1.7.0/xml/features</repository>
no/priv/bang/authservice/authservice.web.security.memorysession/1.12.1/authservice.web.security.memorysession-1.12.1-features.xml:
    
<repository>mvn:org.apache.shiro/shiro-features/1.7.0/xml/features</repository>
no/priv/bang/authservice/authservice.users/1.12.1/authservice.users-1.12.1-features.xml:
    
<repository>mvn:org.apache.shiro/shiro-features/1.7.0/xml/features</repository>
no/priv/bang/authservice/authservice.web.security/1.12.1/authservice.web.security-1.12.1-features.xml:
    
<repository>mvn:org.apache.shiro/shiro-features/1.7.0/xml/features</repository>
no/priv/bang/authservice/authservice.web.security.dbrealm/1.12.1/authservice.web.security.dbrealm-1.12.1-features.xml:
    
<repository>mvn:org.apache.shiro/shiro-features/1.7.0/xml/features</repository>
root@8c9cf448ba6e:~/.m2/repository#


No, it looks like I have 1.7.0 for all of them... hm...

Reply via email to