I've Alfresco, Running on one docker container A and exposes rmi on say 33333. Another normal java service runs on container B. Both are connected to same custom bridge network.
When container B tries to connects to alfresco via rmi using url rmi://alfresco:33333
it throws java.net.MalformedURLException: invalid authority: rmi://alfresco:33333/Abcdefghi
. But the same is able to ping
alfresco. I think the url format given in rmi is wrong. if so. What should it be substituted with? I already tried alfresco
,alfresco.abc
. but same error persists.
Or else am I missing something in docker-compose
file?
Here is the sample configuration of both compose files.
Alfresco (Container A):
version: '3'
services:
alfresco:
image : xxxxxxx:latest
container_name : alfresco
expose:
- "33333"
ports:
- xxxx:xxxx
networks:
default:
external:
name: test
Service (Container B):
version: '2.2'
services:
abc:
image: openjdk:8-jre-slim
working_dir: /home
entrypoint: java -jar ABC.jar
networks:
default:
external:
name: test
Found out the reason. RMI is expecting either IP address or a valid domain. Since alfresco
is available via service discovery and ping recogonises it, RMI assumes it to be an invalid URL. Hence I've to give an alias for alfresco host in a valid url format.
I gave an alias called alfresco.local
now it works fine.
Here is my modified Compose file for alfresco:
Alfresco (Container A)
version: '3'
services:
alfresco:
image : xxxxxxx:latest
container_name : alfresco
networks:
default:
aliases:
- alfresco.local #specify an alias in some valid DNS format
expose:
- "33333"
ports:
- xxxx:xxxx
networks:
default:
external:
name: test