Why it wasn’t blowing up when it should have been

I’m preparing to commit a change that will switch our code over from datasource beans defined within the .war project to datasources that are looked up via JNDI from the app server.  I have to make this change carefully, placing the datasource configuration file on the app servers and setting up the properties files beforehand so that my commit doesn’t break the build.

As part of my testing, I made the changes to my local JBoss.  Everything seemed to work.  Then I removed the no-longer-used properties that had been needed when we defined the bean locally.  Everything still worked.  Then, to make sure I wasn’t getting false positives, I removed the JNDI-name property that should be relied on by the new code…

Everything still worked.

The deployment failed when I deleted the properties file altogether, but it was satisfied even with a completely empty file.  What was going on?

What was going on

I had forgotten about some logic in our code that is responsible for loading the bean files — we don’t load the persistence beans file if the project doesn’t need them.  And currently all the persistence stuff is mocked out, so it doesn’t need them.  Since the beans file is not loaded, the project doesn’t care about those properties in the properties file.

Mystery solved.  Thanks to Detective Keith for his help!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s