<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Kommentare zu: Spring configuration properties: Defaults and Reloading</title>
	<atom:link href="http://www.wuenschenswert.net/wunschdenken/archives/107/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wuenschenswert.net/wunschdenken/archives/107</link>
	<description></description>
	<pubDate>Tue, 07 Feb 2012 16:17:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>Von: Jean-Marie Galliot</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/107#comment-4279</link>
		<dc:creator>Jean-Marie Galliot</dc:creator>
		<pubDate>Fri, 11 Sep 2009 19:58:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/107#comment-4279</guid>
		<description>Hi,

I found that your solution to the problem of default values for properties with DefaultPropertyPlaceholderConfigurer is the best I have seen. Both simple and efficient.

Bravo !

I use it now, I hope don't mind !

Thanks for your creativity

Jean-Marie Galliot
System Architect</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I found that your solution to the problem of default values for properties with DefaultPropertyPlaceholderConfigurer is the best I have seen. Both simple and efficient.</p>
<p>Bravo !</p>
<p>I use it now, I hope don&#8217;t mind !</p>
<p>Thanks for your creativity</p>
<p>Jean-Marie Galliot<br />
System Architect</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: axel</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/107#comment-4162</link>
		<dc:creator>axel</dc:creator>
		<pubDate>Sat, 16 Feb 2008 19:32:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/107#comment-4162</guid>
		<description>You might also be interested in the "reloading" ticket:
http://jira.springframework.org/browse/SPR-3439

Turn-around times for spring-based apps are currently quite bad - my IDE knows how to update and reload a class file, but not how to reload a spring bean definition, which ought to be much simpler. It may take a different shape in the end, but if Spring is not supposed to go down as another Java Dinosaur Framework, there has to be some more dynamicity.</description>
		<content:encoded><![CDATA[<p>You might also be interested in the &#8220;reloading&#8221; ticket:<br />
<a href="http://jira.springframework.org/browse/SPR-3439" rel="nofollow">http://jira.springframework.org/browse/SPR-3439</a></p>
<p>Turn-around times for spring-based apps are currently quite bad - my IDE knows how to update and reload a class file, but not how to reload a spring bean definition, which ought to be much simpler. It may take a different shape in the end, but if Spring is not supposed to go down as another Java Dinosaur Framework, there has to be some more dynamicity.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: laurent</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/107#comment-4159</link>
		<dc:creator>laurent</dc:creator>
		<pubDate>Tue, 12 Feb 2008 12:46:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/107#comment-4159</guid>
		<description>Hey People,
To get this really good Idea into Spring, we must get more votes!
So add you vote here:
http://jira.springframework.org/browse/SPR-3001

I don't understand why there's no comment there from any Spring people. Don't they see the value of this??</description>
		<content:encoded><![CDATA[<p>Hey People,<br />
To get this really good Idea into Spring, we must get more votes!<br />
So add you vote here:<br />
<a href="http://jira.springframework.org/browse/SPR-3001" rel="nofollow">http://jira.springframework.org/browse/SPR-3001</a></p>
<p>I don&#8217;t understand why there&#8217;s no comment there from any Spring people. Don&#8217;t they see the value of this??</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: axel</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/107#comment-4137</link>
		<dc:creator>axel</dc:creator>
		<pubDate>Fri, 31 Aug 2007 06:51:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/107#comment-4137</guid>
		<description>Thanks for the patch! I have posted an &lt;a href="http://www.wuenschenswert.net/wunschdenken/archives/153" rel="nofollow"&gt;update&lt;/a&gt;.

The demon flag should not be necessary if the application context is
closed when the webapp context is destroyed. This should happen
automatically if you use a
&lt;a href="http://www.springframework.org/docs/api/org/springframework/web/context/ContextLoaderListener.html" rel="nofollow"&gt;ContextLoaderListener&lt;/a&gt; or a servlet-specific application context.</description>
		<content:encoded><![CDATA[<p>Thanks for the patch! I have posted an <a href="http://www.wuenschenswert.net/wunschdenken/archives/153" rel="nofollow">update</a>.</p>
<p>The demon flag should not be necessary if the application context is<br />
closed when the webapp context is destroyed. This should happen<br />
automatically if you use a<br />
<a href="http://www.springframework.org/docs/api/org/springframework/web/context/ContextLoaderListener.html" rel="nofollow">ContextLoaderListener</a> or a servlet-specific application context.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Glenn</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/107#comment-4133</link>
		<dc:creator>Glenn</dc:creator>
		<pubDate>Mon, 27 Aug 2007 14:13:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/107#comment-4133</guid>
		<description>It seems that your solutions has a problem in Tomcat 5.x. However, overriding loadProperties in ReloadablePropertiesFactoryBean with this code will correct the problem :
&lt;pre&gt;
/**
* Load properties into the given instance.
* 
* @param props
*            the Properties instance to load into
* @throws java.io.IOException
*             in case of I/O errors
* @see #setLocations
*/
@Override
protected void loadProperties(Properties props) throws IOException {
	if (this.locations != null) {
		for (int i = 0; i &#60; this.locations.length; i++) {
				Resource location = this.locations[i];
				if (logger.isInfoEnabled()) {
					logger.info("Loading properties file from " + location);
				}
				InputStream is = null;
				try {
					&lt;b&gt;is = new FileInputStream(location.getFile().getAbsolutePath());&lt;/b&gt;
					if (location.getFilename().endsWith(XML_FILE_EXTENSION)) {
						this.propertiesPersister.loadFromXml(props, is);
					} else {
						if (this.fileEncoding != null) {
							this.propertiesPersister
									.load(props, new InputStreamReader(is,
											this.fileEncoding));
						} else {
							this.propertiesPersister.load(props, is);
						}
					}
				} catch (IOException ex) {
					if (this.ignoreResourceNotFound) {
						if (logger.isWarnEnabled()) {
							logger.warn("Could not load properties from "
									+ location + ": " + ex.getMessage());
						}
					} else {
						throw ex;
					}
				} finally {
					if (is != null) {
						is.close();
					}
				}
			}
		}
	}
&lt;/pre&gt;

Also, we must put the attribute &#60;property name="daemon" value="true"&gt;&#60;/property&gt; of the timer in the dynamic.xml example so Tomcat shuts down properly.
</description>
		<content:encoded><![CDATA[<p>It seems that your solutions has a problem in Tomcat 5.x. However, overriding loadProperties in ReloadablePropertiesFactoryBean with this code will correct the problem :</p>
<pre>
/**
* Load properties into the given instance.
*
* @param props
*            the Properties instance to load into
* @throws java.io.IOException
*             in case of I/O errors
* @see #setLocations
*/
@Override
protected void loadProperties(Properties props) throws IOException {
	if (this.locations != null) {
		for (int i = 0; i &lt; this.locations.length; i++) {
				Resource location = this.locations[i];
				if (logger.isInfoEnabled()) {
					logger.info(&#8221;Loading properties file from &#8221; + location);
				}
				InputStream is = null;
				try {
					<b>is = new FileInputStream(location.getFile().getAbsolutePath());</b>
					if (location.getFilename().endsWith(XML_FILE_EXTENSION)) {
						this.propertiesPersister.loadFromXml(props, is);
					} else {
						if (this.fileEncoding != null) {
							this.propertiesPersister
									.load(props, new InputStreamReader(is,
											this.fileEncoding));
						} else {
							this.propertiesPersister.load(props, is);
						}
					}
				} catch (IOException ex) {
					if (this.ignoreResourceNotFound) {
						if (logger.isWarnEnabled()) {
							logger.warn(&#8221;Could not load properties from &#8221;
									+ location + &#8220;: &#8221; + ex.getMessage());
						}
					} else {
						throw ex;
					}
				} finally {
					if (is != null) {
						is.close();
					}
				}
			}
		}
	}
</pre>
<p>Also, we must put the attribute &lt;property name=&#8221;daemon&#8221; value=&#8221;true&#8221;>&lt;/property> of the timer in the dynamic.xml example so Tomcat shuts down properly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Wunschdenken &#187; Blog Archiv &#187; Spring Properties Reloaded</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/107#comment-693</link>
		<dc:creator>Wunschdenken &#187; Blog Archiv &#187; Spring Properties Reloaded</dc:creator>
		<pubDate>Wed, 11 Apr 2007 21:23:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/107#comment-693</guid>
		<description>[...] Some time ago, I promised I would describe how to make spring configuration properties reloadable. [...]</description>
		<content:encoded><![CDATA[<p>[...] Some time ago, I promised I would describe how to make spring configuration properties reloadable. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: axel</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/107#comment-690</link>
		<dc:creator>axel</dc:creator>
		<pubDate>Wed, 11 Apr 2007 06:23:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/107#comment-690</guid>
		<description>Definitely. Publishing it fell off the list somehow. Thanks for your interest! It'll be the next thing on this blog.</description>
		<content:encoded><![CDATA[<p>Definitely. Publishing it fell off the list somehow. Thanks for your interest! It&#8217;ll be the next thing on this blog.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Prakash</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/107#comment-687</link>
		<dc:creator>Prakash</dc:creator>
		<pubDate>Tue, 10 Apr 2007 14:43:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/107#comment-687</guid>
		<description>Hi,
Can you send how Reloading properties works and the Classes you written?


Thanks,
Prakash</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Can you send how Reloading properties works and the Classes you written?</p>
<p>Thanks,<br />
Prakash</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: axel</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/107#comment-53</link>
		<dc:creator>axel</dc:creator>
		<pubDate>Tue, 26 Dec 2006 22:22:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/107#comment-53</guid>
		<description>Having this in the standard spring distribution would certainly be great. Thanks for the encouragement! I'll go about it... after christmas.

Note I've added a link to the source code of &lt;a href="/files/DefaultPropertyPlaceholderConfigurer.java" rel="nofollow"&gt;DefaultPropertyPlaceholderConfigurer&lt;/a&gt;.  I'll have to check with my employer about the copyright of the Reloading... source code.

Cheers,
Axel
</description>
		<content:encoded><![CDATA[<p>Having this in the standard spring distribution would certainly be great. Thanks for the encouragement! I&#8217;ll go about it&#8230; after christmas.</p>
<p>Note I&#8217;ve added a link to the source code of <a href="/files/DefaultPropertyPlaceholderConfigurer.java" rel="nofollow">DefaultPropertyPlaceholderConfigurer</a>.  I&#8217;ll have to check with my employer about the copyright of the Reloading&#8230; source code.</p>
<p>Cheers,<br />
Axel</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Stefan Kleineikenscheidt</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/107#comment-49</link>
		<dc:creator>Stefan Kleineikenscheidt</dc:creator>
		<pubDate>Sun, 24 Dec 2006 23:56:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/107#comment-49</guid>
		<description>Maybe the wrong time to write about Java, but I think the DefaultPropertyPlaceholderConfigurer.  Have you posted the spring mailing list about this? IMHO this should be part of spring.

Merry X-MAS,
-Stefan</description>
		<content:encoded><![CDATA[<p>Maybe the wrong time to write about Java, but I think the DefaultPropertyPlaceholderConfigurer.  Have you posted the spring mailing list about this? IMHO this should be part of spring.</p>
<p>Merry X-MAS,<br />
-Stefan</p>
]]></content:encoded>
	</item>
</channel>
</rss>

