[BUG] Configuration Map keys containing dots silently fail to expand in connector fields (Velocity property navigation
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
Direzione di ricerca
Start at TemplateValueReplacer.getDefaultContext() and loadContextFromMap, which put the Configuration Map into the Velocity context as a flat map. Connector fields (e.g. Database Reader/Writer URL) are expanded with Velocity, so ${a.b.c} is property navigation, not a dotted key. Decide among docs, a UI warning on dotted keys, or a deploy-time log when ${...} is left unresolved; there is no linked PR and no comments yet.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
A Configuration Map key that contains dots — for example db.warehouse.url — is not
expanded when referenced as ${db.warehouse.url} in a connector field such as a Database
Reader/Writer URL, username or password. The raw ${...} text is passed through to the
connector, which then fails with an error that points at the connector rather than at the
key name.
Keys with no dots expand correctly in the same fields.
Consistently reproducible: yes, on every deploy, on both Database Reader and Database
Writer, in url, username and password.
The underlying cause is that connector fields are resolved with Velocity, where ${a.b.c}
means "object a, property b, property c" rather than a lookup of a flat key named
a.b.c. The Configuration Map is loaded into the Velocity context as a flat map
(TemplateValueReplacer.getDefaultContext() calls
loadContextFromMap(context, ConfigurationController.getInstance().getConfigurationMap())),
so a dotted key exists in the map but is unreachable through dotted reference syntax.
Velocity leaves an unresolvable reference untouched, which is why the literal is passed on.
I am not arguing Velocity should behave differently. The problem is that this fails with
no warning anywhere, and the resulting error misdirects.
To Reproduce
- Settings -> Configuration Map, add a key with dots:
test.cfgmap.url = jdbc:postgresql://host.example.org:5432/db - Create a channel with a Database Reader source.
- Set the Reader's URL to
${test.cfgmap.url}, driverorg.postgresql.Driver,
select statementSELECT 1.
Steps to reproduce the behavior:
- Deploy the channel.
- Look at the server log.
- See the deploy fail with the unexpanded literal.
Expected behavior
${test.cfgmap.url} resolves to the Configuration Map value, the same way a key without
dots does — or, failing that, some indication that the reference could not be resolved.
Actual behavior
The literal ${test.cfgmap.url} is handed to the connector:
Caused by: com.mirth.connect.donkey.server.ConnectorTaskException: Failed to initialize database connection
at com.mirth.connect.connectors.jdbc.DatabaseReceiverQuery.initConnection(DatabaseReceiverQuery.java:124)
at com.mirth.connect.connectors.jdbc.DatabaseReceiverQuery.start(DatabaseReceiverQuery.java:87)
at com.mirth.connect.connectors.jdbc.DatabaseReceiver.onStart(DatabaseReceiver.java:115)
Caused by: java.sql.SQLException: No suitable driver found for ${test.cfgmap.url}
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:706)
at com.mirth.connect.connectors.jdbc.DatabaseReceiverQuery.initSelectConnection(DatabaseReceiverQuery.java:340)
With a dot-free key (stedi_mode, whose value is P) the same channel produces:
java.sql.SQLException: No suitable driver found for P
which is the expected substitution — P is not a valid JDBC URL, so it fails, but the
value was clearly resolved.
With dot-free keys used for url, username and password throughout, the Database Reader
connects successfully, emits a row, and the Database Writer connects and sends
successfully. So both connectors do expand these fields; only the dots break it.
There is no WARN or ERROR anywhere saying a reference was left unresolved.
Screenshots
N/A — log output above.
Environment (please complete the following information):
- OS: Windows Server 2025
- Java Distribution/Version: OpenJDK 17.0.19 (bundled with the OIE installer)
- Connect Version: Open Integration Engine 4.6.0
- Database backend: PostgreSQL 17
Behaviour should be platform-independent — Velocity's grammar and Java .properties key
handling are the same everywhere.
Workaround(s)
Yes, and it is easy once you know: do not use dots in Configuration Map keys that will be
referenced from connector fields. Rename db.warehouse.url to db_warehouse_url and
${db_warehouse_url} resolves correctly.
Note that dotted keys still work fine from JavaScript, because
configurationMap.get('db.warehouse.url') is a literal string lookup rather than a Velocity
template. So the same key works in one place and silently fails in another, which is what
makes this easy to trip over.
Additional context
Dots are a natural convention for namespacing configuration keys and the Configuration Map
UI accepts them without complaint, so this is easy to walk into. I suspect it is the origin
of the fairly widespread belief that Configuration Map values "don't work in connector
URLs" — they do, as long as the key has no dots.
Possible resolutions, cheapest first:
- Documentation — note that keys referenced from connector fields must not contain
dots, and that dotted keys remain usable from JavaScript viaconfigurationMap.get().
This alone would have saved me the investigation. - UI warning when a key containing a dot is added to the Configuration Map.
- Log a warning at deploy time when a connector field still contains an unresolved
${...}after replacement. This is the one I would find most valuable — it would
surface the whole class of unresolved-reference mistakes (typos, deleted keys, wrong
scope), not just dotted keys.
Happy to open a PR for the documentation change, or for option 3 if that is of interest.
- Lingua principale
- Java
- Stelle
- 227
- Fork
- 81
- Merge medio
- 3g 15h
- PR unite (30g)
- 13
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OpenIntegrationEngine/engine
-
Unrecognized database schema version is treated as a pre-2.0 databaseForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
OpenIntegrationEngine/engine#496 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
OpenIntegrationEngine/engine#485 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
OpenIntegrationEngine/engine#478 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
OpenIntegrationEngine/engine#355 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
OpenIntegrationEngine/engine#347 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di OpenIntegrationEngine/engine
Issue simili
-
False Negative: InnerTypeLastCheck does not report members declared after inner enums or annotationsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
checkstyle/checkstyle#22027 ·
I maintainer di solito rispondono entro 1 giorno
-
bug follow-up lane:auto
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Sanne/incus-spawn#1497 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG][RUST] chrono date-time path/query/header params are not serialized as RFC 3339Forse già presa @teovillanueva l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
OpenAPITools/openapi-generator#25297 ·
I maintainer di solito rispondono entro 1 giorno
-
[CI] NettyClientTest.testServerDisconnection may fail with DisconnectExceptionForse già presa @yangshangqing95 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno