本地运行Tibco项目时,运行时引用模块属性还是应用属性?
Great question—this is a super common gotcha when you're working locally with Tibco BW6, so let's break it down clearly based on how you're running your project:
1. Running a single module directly in Tibco Studio
If you right-click a module and select "Run As > Tibco BusinessWorks 6 Application" (without wrapping it into an application first), the runtime will only reference the module's own Module Properties (the module.properties file under your module's src/main/resources folder). Application-level properties don't come into play here at all—your module runs in isolation, using its own configured values.
2. Running an Application that includes your module
If you've packaged your module into a Tibco Application (via the Application Project type) and run the entire application locally, the runtime follows a clear priority hierarchy:
- Application-level properties (from the application's
application.propertiesfile) take precedence over module-level properties for any keys that are shared between the two. - For properties that only exist in the module's
Module Propertiesand aren't defined in the application, the module's values will still be used.
Example to clarify
Suppose your module's module.properties has:
db.connection.url=jdbc:mysql://localhost:3306/module-db api.timeout=3000
And your application's application.properties has:
db.connection.url=jdbc:mysql://localhost:3306/app-db
When you run the entire application locally, the runtime will use:
db.connection.url=jdbc:mysql://localhost:3306/app-db(application-level value overrides module)api.timeout=3000(module-level value, since no application override exists)
Quick note on run configurations
If you want to customize this behavior (e.g., load a custom properties file instead of the default), you can tweak the Run Configuration in Tibco Studio. But the above is the out-of-the-box behavior for most local development workflows.
内容的提问来源于stack exchange,提问作者M. Man

