@PostConstruct method is not invoked [message #634771] |
Sat, 23 October 2010 06:37  |
Eclipse User |
|
|
|
I am scratching my head over this since yesterday. I have a bean with the @PostConstruct annotation in a method, but it is not invoked:
public class DerbyManager implements IDerbyManager
{
private final Logger logger = LoggerFactory.getLogger(getClass());
@PostConstruct
protected void init()
{
logger.info("initializing");
loadEmbeddedDriver();
}
....
my module-context.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
">
<context:annotation-config/>
<bean id="derbyManager" class="com.rits.derby.impl.DerbyManager"/>
</beans>
The bean itself is initialized (if I add logging at the constructor, I see it in the log).
my manifest.mf:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Derby Manager
Bundle-SymbolicName: com.rits.derby
Bundle-Version: 1.0.0
Bundle-Vendor: RITS
Import-Library: org.springframework.spring
Import-Bundle: org.apache.commons.dbcp
,derbyclient
,com.rits.databases
Import-Package: org.slf4j
Export-Package: com.rits.derby
I used to have the same issue in the past and was resolved by Import-Library: org.springframework.spring . Any ideas?
I've uploaded the bundle.
Thanks
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04143 seconds