Note that there are some explanatory texts on larger screens.

plurals
  1. POPropertyPlaceholderConfigurer break my hibernate session
    text
    copied!<p>I have an issue in my Spring project when, after create my hibernateSession and TransactionManager I initilize a bean that extends <strong>PropertyPlaceholderConfigurer</strong> I dont know why but in that moment my hibermnate session is ruin to be used for the rest of my DAO´s. The error that is throwing is this one.</p> <pre><code>Caused by: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here </code></pre> <p>Any suggestions?</p> <p>I´m trying to extract from database some data to create a properties class and set to a class that I´ve create that extends <strong>PropertyPlaceholderConfigurer</strong></p> <p>This is the class</p> <pre><code> public class PropertiesSourceImpl extends PropertyPlaceholderConfigurer{ public ConfigurationSource configurationSource; public Properties properties; public void init() { for (ConfigurationProperty prop : configurationSource.getEnabledConfigurationPropertiesByType(ConfigurationProperty.PropertyType.MAIL)) { System.out.println(prop); // properties.setProperty(prop.getPropertyKey(), prop.getPropertyValue()); } } public Properties getProperties() { return properties; } @Required public void setConfigurationSource(final ConfigurationSource configurationSource) { this.configurationSource = configurationSource; } </code></pre> <p>}</p> <p>and here my bean definition</p> <pre><code>&lt;bean id="propertiesSource" class="nl.greenvalley.digipolis.config.PropertiesSourceImpl" init-method="init"&gt; &lt;property name="configurationSource" ref="configurationSource"/&gt; &lt;/bean&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload