# Spring Dynamic Modules (OSGi) und AspectJ



## Thomas Darimont (4. Februar 2008)

Hallo,

hier mal ein kleines Beispiel wie man die transparente Spring Konfiguration via @Configurable
auch mit Spring Dynamic Modules ( http://www.springframework.org/osgi ) bekommen kann. 
Wir berichteten:
http://www.tutorials.de/forum/java/...-eclipse-rcp-view-mit-aspectj-und-spring.html
wie in dem gezeigten Beispiel werden wir auch wieder Compile Time Weaving verwenden.

Nach einigem herumspielen mit Spring Dynamic Modules hatte ich wiederholt
(wie viele andere schon vor mir: http://groups.google.com/group/spri...bd07b74ae7/20a4c485f320b9f7?#20a4c485f320b9f7) 
mit ClassLoading Problemen zu kämpfen. Jedoch konnte ich diese nach Studium der entsprechenden Docs:
(
http://static.springframework.org/osgi/docs/current/reference/html-single/
http://static.springframework.org/osgi/docs/current/reference/html/spring-osgi-faq.html
) nach einer weile relativ sicher beheben.

Folgende jars/bundles ins Plugin verzeichnis der Eclipse Installation kopieren.

```
24.01.2008  11:31           331.707 org.springframework.osgi.backport.util.concurrent_3.0.0.jar
24.01.2008  11:31           236.182 org.springframework.osgi.bundle.core_1.0.0.rc2_v200712112043.jar
24.01.2008  11:31            61.864 org.springframework.osgi.bundle.extender_1.0.0.rc2_v200712112043.jar
24.01.2008  11:31            13.040 org.springframework.osgi.bundle.io_1.0.0.rc2_v200712112043.jar
19.11.2007  21:40             5.406 spring-agent.jar
19.11.2007  21:40            16.419 spring-aspects.jar
// 19.11.2007  21:40             8.880 spring-tomcat-weaver.jar
19.11.2007  21:39         2.838.649 spring.jar
```

Die "normalen" Spring-jars stammen aus der 2.5.0er Spring Distribution

RCP Mail template anlegen.
Siehe: http://www.eclipse.org/articles/Article-RCP-3/tutorial3.html

IService Interface:

```
/**
 * 
 */
package de.tutorials.spring.rcp.mail.services;

/**
 * @author Thomas.Darimont
 *
 */
public interface IService {

}
```

Service Implementierung:

```
/**
 * 
 */
package de.tutorials.spring.rcp.mail.services.internal;

import de.tutorials.spring.rcp.mail.services.IService;

/**
 * @author Thomas.Darimont
 *
 */
public class Service implements IService {

}
```

Klasse Navigation view um das Property Service erweitern:

```
...
@Configurable
public class NavigationView extends ViewPart {
    public static final String ID = "de.tutorials.spring.rcp.mail.navigationView";
    private TreeViewer viewer;

    IService service;
    

    public IService getService() {
        return service;
    }

    public void setService(IService service) {
        this.service = service;
    }

    class TreeObject {

...

// damit wir sehen, dass unser Service auch Injected ?ern wir die getChildren(Object parent) Methode des
genestedten ViewContentProviders wie folgt ab:
...
        public Object[] getChildren(Object parent) {
            System.out.println("###"+getService());
            if (parent instanceof TreeParent) {
                return ((TreeParent) parent).getChildren();
            }
            return new Object[0];
        }
..
```

Im Verzeichnis "META-INF" ein Unterverzeichnis namens "spring" anlegen.
Unter "META-INF/spring" dann die ApplicationContext Konfiguration ablegen: "config.xml"


```
<?xml version="1.0" encoding="UTF-8"?>

<!--
  - Application context definition for JPetStore's business layer.
  - Contains bean references to the transaction manager and to the DAOs in
  - dataAccessContext-local/jta.xml (see web.xml's "contextConfigLocation").
  -->
<beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:aop="http://www.springframework.org/schema/aop"
         xmlns:tx="http://www.springframework.org/schema/tx"
         xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">


     <aop:spring-configured/>

    <bean id="service" class="de.tutorials.spring.rcp.mail.services.internal.Service"/>
    
    <bean class="de.tutorials.spring.rcp.mail.NavigationView">
        <property name="service" ref="service"/>
    </bean>
    
</beans>
```

Im Plugin Root ein Verzeichnis "lib" erzeugen.
Dort "spring-aspects.jar" ablegen.




Plugin.xml folgende Abhängigkeiten deklarieren: (In dieser Reihenfolge!)

```
org.eclipse.ui
org.eclipse.core.runtime
org.apache.commons.logging
org.springframework.osgi.bundle.extender
org.springframework.bundle.spring
```

Anschlie?nd das Projekt als Spring Projekt deklarieren:
Spring Tools -> Add Spring Project Nature

Anschlie?nd das Projekt als AspectJ Projekt deklarieren:
AspectJ Tools -> Convert to AspectJ Project

(Gegebenenfalls in den Project Properties / Java Compiler Optionen das Compiler compliance level auf 5.0 stellen.)

In Project Properties/AspectJ Build unter Aspect Path -> Add jars -> lib/spring-aspects.jar angeben.

Fragement für log4J libs erzeugen welches das commons.logging Bundle als Host-Bundle verwendet.
New -> fragment project -> Name: log4jToJCL -> Host-Bundle / Plugin-ID -> org.apache.commons.logging
Im Fragment Root ein Verzeichnis namens "lib" anlegen. Entsprechendes log4j-xxxx(1.2.14).jar nach lib
kopieren. Anschlie?nd -> im Fragment Manifest.mf -> Runtime -> bei Classpath lib/log4j-xxxx.jar angeben.

Im Fragment Root Log4j Properties erzeugen:

```
log4j.rootLogger=TRACE, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
```

Run Configuration anlegen:
Unter Arguments:   -console bei den Programm Arguments am Ende hinzufügen -> damit bekommen wir die OSGi Konsole.
Bei Plugins:
de.tutorials.spring.rcp.mail
und ()
log4jToJCL angeben anschlie?nd auf Add Required Plugi-Ins klicken.

nun sollte alles soweit konfiguriewrt sein, dass man das ganze laufen lassen kann.

Ausgabe sieht bei mir wie folgt aus:

```
osgi> 2008-02-04 17:52:14,952 DEBUG [org.springframework.core.CollectionFactory] - Creating [java.util.concurrent.ConcurrentHashMap]
2008-02-04 17:52:14,952 INFO [org.springframework.osgi.extender.internal.ContextLoaderListener] - Starting org.springframework.osgi.extender bundle v.[1.0.0.rc2_v200712112043]
2008-02-04 17:52:14,968 DEBUG [org.springframework.core.CollectionFactory] - Creating [java.util.concurrent.ConcurrentHashMap]
2008-02-04 17:52:15,031 DEBUG [org.springframework.osgi.extender.internal.support.NamespaceManager] - Adding namespace handler resolver for spring (org.springframework.bundle.spring)
2008-02-04 17:52:15,031 DEBUG [org.springframework.osgi.extender.internal.support.NamespacePlugins] - adding as handler spring (org.springframework.bundle.spring)
2008-02-04 17:52:15,046 DEBUG [org.springframework.osgi.extender.internal.support.NamespaceManager] - Adding namespace handler resolver for spring-osgi-core (org.springframework.osgi.bundle.core)
2008-02-04 17:52:15,046 DEBUG [org.springframework.osgi.extender.internal.support.NamespacePlugins] - adding as handler spring-osgi-core (org.springframework.osgi.bundle.core)
2008-02-04 17:52:15,046 DEBUG [org.springframework.osgi.extender.internal.support.NamespaceManager] - Registering Spring NamespaceHandlerResolver and EntityResolver...
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.support.ApplicationContextConfiguration] - configuration: AppCtxCfg [Bundle=org.eclipse.osgi]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - created config AppCtxCfg [Bundle=org.eclipse.osgi]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.support.ApplicationContextConfiguration] - configuration: AppCtxCfg [Bundle=org.eclipse.equinox.common]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - created config AppCtxCfg [Bundle=org.eclipse.equinox.common]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.support.ApplicationContextConfiguration] - configuration: AppCtxCfg [Bundle=org.eclipse.core.runtime]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - created config AppCtxCfg [Bundle=org.eclipse.core.runtime]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.support.ApplicationContextConfiguration] - configuration: AppCtxCfg [Bundle=org.eclipse.core.jobs]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - created config AppCtxCfg [Bundle=org.eclipse.core.jobs]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.support.ApplicationContextConfiguration] - configuration: AppCtxCfg [Bundle=org.eclipse.core.runtime.compatibility.auth]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - created config AppCtxCfg [Bundle=org.eclipse.core.runtime.compatibility.auth]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.support.ApplicationContextConfiguration] - configuration: AppCtxCfg [Bundle=org.eclipse.equinox.app]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - created config AppCtxCfg [Bundle=org.eclipse.equinox.app]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.support.ApplicationContextConfiguration] - configuration: AppCtxCfg [Bundle=org.eclipse.equinox.preferences]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - created config AppCtxCfg [Bundle=org.eclipse.equinox.preferences]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.support.ApplicationContextConfiguration] - configuration: AppCtxCfg [Bundle=org.eclipse.equinox.registry]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,062 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - created config AppCtxCfg [Bundle=org.eclipse.equinox.registry]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,077 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTED] for bundle [org.springframework.osgi.bundle.extender]
2008-02-04 17:52:15,077 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTED] for bundle [org.springframework.osgi.bundle.extender]
2008-02-04 17:52:15,077 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [LAZY_ACTIVATION] for bundle [de.tutorials.spring.rcp.mail]
2008-02-04 17:52:15,077 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [LAZY_ACTIVATION] for bundle [de.tutorials.spring.rcp.mail]
2008-02-04 17:52:15,077 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTING] for bundle [de.tutorials.spring.rcp.mail]
2008-02-04 17:52:15,077 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTING] for bundle [de.tutorials.spring.rcp.mail]
2008-02-04 17:52:15,077 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTING] for bundle [org.eclipse.ui.workbench]
2008-02-04 17:52:15,077 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTING] for bundle [org.eclipse.ui.workbench]
2008-02-04 17:52:15,077 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTING] for bundle [org.eclipse.jface]
2008-02-04 17:52:15,077 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTING] for bundle [org.eclipse.jface]
2008-02-04 17:52:15,077 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTED] for bundle [org.eclipse.jface]
2008-02-04 17:52:15,077 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTED] for bundle [org.eclipse.jface]
2008-02-04 17:52:15,077 DEBUG [org.springframework.osgi.extender.internal.support.ApplicationContextConfiguration] - configuration: AppCtxCfg [Bundle=org.eclipse.jface]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,077 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - created config AppCtxCfg [Bundle=org.eclipse.jface]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,124 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTING] for bundle [org.eclipse.ui]
2008-02-04 17:52:15,124 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTING] for bundle [org.eclipse.ui]
2008-02-04 17:52:15,124 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTED] for bundle [org.eclipse.ui]
2008-02-04 17:52:15,124 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTED] for bundle [org.eclipse.ui]
2008-02-04 17:52:15,124 DEBUG [org.springframework.osgi.extender.internal.support.ApplicationContextConfiguration] - configuration: AppCtxCfg [Bundle=org.eclipse.ui]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,124 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - created config AppCtxCfg [Bundle=org.eclipse.ui]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,124 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTED] for bundle [org.eclipse.ui.workbench]
2008-02-04 17:52:15,124 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTED] for bundle [org.eclipse.ui.workbench]
2008-02-04 17:52:15,124 DEBUG [org.springframework.osgi.extender.internal.support.ApplicationContextConfiguration] - configuration: AppCtxCfg [Bundle=org.eclipse.ui.workbench]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,124 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - created config AppCtxCfg [Bundle=org.eclipse.ui.workbench]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,124 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTED] for bundle [de.tutorials.spring.rcp.mail]
2008-02-04 17:52:15,124 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTED] for bundle [de.tutorials.spring.rcp.mail]
2008-02-04 17:52:15,140 DEBUG [org.springframework.osgi.extender.internal.support.ApplicationContextConfiguration] - configuration: AppCtxCfg [Bundle=de.tutorials.spring.rcp.mail]isSpringBundle=true|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,140 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - created config AppCtxCfg [Bundle=de.tutorials.spring.rcp.mail]isSpringBundle=true|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,156 INFO [org.springframework.osgi.extender.internal.ContextLoaderListener] - disabled automatic Spring-DM annotation processing; [ org.springframework.osgi.extender.annotation.auto.processing=null]
2008-02-04 17:52:15,156 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Asynchronous context creation for bundle Mail Plug-in (de.tutorials.spring.rcp.mail; singleton:=true)
2008-02-04 17:52:15,187 DEBUG [org.springframework.osgi.extender.internal.util.concurrent.Counter] - counter [contextsStarted] incremented to 1
2008-02-04 17:52:15,202 DEBUG [org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor] - starting first stage of refresh for OsgiBundleXmlApplicationContext(bundle=de.tutorials.spring.rcp.mail, config=osgibundlejar:/META-INF/spring/*.xml)
2008-02-04 17:52:15,202 DEBUG [org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor] - calling preRefresh on OsgiBundleXmlApplicationContext(bundle=de.tutorials.spring.rcp.mail, config=osgibundlejar:/META-INF/spring/*.xml)
2008-02-04 17:52:15,202 INFO [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext] - Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@b9b538: display name [OsgiBundleXmlApplicationContext(bundle=de.tutorials.spring.rcp.mail, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Mon Feb 04 17:52:15 CET 2008]; root of context hierarchy
2008-02-04 17:52:15,234 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - looking for resource commons-logging.properties
2008-02-04 17:52:15,234 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - looking for resource META-INF/services/org.apache.commons.logging.LogFactory
2008-02-04 17:52:15,234 DEBUG [org.springframework.core.CollectionFactory] - Creating [java.util.concurrent.ConcurrentHashMap]
2008-02-04 17:52:15,234 DEBUG [org.springframework.core.CollectionFactory] - Creating [java.util.concurrent.ConcurrentHashMap]
2008-02-04 17:52:15,234 DEBUG [org.springframework.core.CollectionFactory] - Creating [java.util.concurrent.ConcurrentHashMap]
2008-02-04 17:52:15,234 DEBUG [org.springframework.core.CollectionFactory] - Creating [java.util.concurrent.ConcurrentHashMap]
2008-02-04 17:52:15,234 DEBUG [org.springframework.core.CollectionFactory] - Creating [java.util.concurrent.ConcurrentHashMap]
2008-02-04 17:52:15,249 DEBUG [org.springframework.core.CollectionFactory] - Creating [java.util.concurrent.ConcurrentHashMap]
2008-02-04 17:52:15,281 DEBUG [org.springframework.core.CollectionFactory] - Creating [java.util.concurrent.ConcurrentHashMap]
```


----------



## Thomas Darimont (4. Februar 2008)

```
2008-02-04 17:52:15,281 DEBUG [org.springframework.util.ClassUtils] - Class [net.sf.cglib.proxy.Enhancer] or one of its dependencies is not present: java.lang.ClassNotFoundException: net.sf.cglib.proxy.Enhancer
2008-02-04 17:52:15,296 DEBUG [org.springframework.aop.framework.JdkDynamicAopProxy] - Creating JDK dynamic proxy: target source is EmptyTargetSource: no target class, static
2008-02-04 17:52:15,312 DEBUG [org.springframework.core.CollectionFactory] - Creating [java.util.concurrent.ConcurrentHashMap]
2008-02-04 17:52:15,312 DEBUG [org.springframework.aop.framework.JdkDynamicAopProxy] - Creating JDK dynamic proxy: target source is EmptyTargetSource: no target class, static
2008-02-04 17:52:15,327 DEBUG [org.springframework.osgi.io.OsgiBundleResourcePatternResolver] - Resolved location pattern [osgibundlejar:/META-INF/spring/*.xml] to resources [OSGi res[/META-INF/spring/config.xml|97|symName=de.tutorials.spring.rcp.mail]]
2008-02-04 17:52:15,343 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from OSGi res[/META-INF/spring/config.xml|97|symName=de.tutorials.spring.rcp.mail]
2008-02-04 17:52:15,343 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - looking for resource META-INF/services/javax.xml.parsers.DocumentBuilderFactory
2008-02-04 17:52:15,390 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - looking for resource META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration
2008-02-04 17:52:15,484 DEBUG [org.springframework.beans.factory.xml.DefaultDocumentLoader] - Using JAXP provider [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl]
2008-02-04 17:52:15,484 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - looking for resource META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration
2008-02-04 17:52:15,515 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTING] for bundle [org.eclipse.core.expressions]
2008-02-04 17:52:15,515 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTING] for bundle [org.eclipse.core.expressions]
2008-02-04 17:52:15,531 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTED] for bundle [org.eclipse.core.expressions]
2008-02-04 17:52:15,531 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTED] for bundle [org.eclipse.core.expressions]
2008-02-04 17:52:15,531 DEBUG [org.springframework.osgi.extender.internal.support.ApplicationContextConfiguration] - configuration: AppCtxCfg [Bundle=org.eclipse.core.expressions]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,531 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - created config AppCtxCfg [Bundle=org.eclipse.core.expressions]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:15,781 DEBUG [org.springframework.osgi.extender.internal.support.NamespacePlugins] - trying to resolving entity for null|http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
2008-02-04 17:52:15,781 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/beans/spring-beans-2.0.xsd]
2008-02-04 17:52:15,781 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Loading schema mappings from [META-INF/spring.schemas]
2008-02-04 17:52:15,781 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - looking for resources META-INF/spring.schemas
2008-02-04 17:52:15,781 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - found resource META-INF/spring.schemas at initial@reference:file:../../extension-location-3.3.1.1/eclipse/plugins/org.springframework.osgi.bundle.core_1.0.0.rc2_v200712112043.jar/
2008-02-04 17:52:15,781 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Loaded schema mappings: {http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd=org/springframework/osgi/compendium/config/spring-osgi-compendium-1.0-rc2.xsd, http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium-1.0-rc2.xsd=org/springframework/osgi/compendium/config/spring-osgi-compendium-1.0-rc2.xsd, http://www.springframework.org/schema/osgi/spring-osgi.xsd=org/springframework/osgi/config/spring-osgi-1.0-rc2.xsd, http://www.springframework.org/schema/osgi/spring-osgi-1.0-rc2.xsd=org/springframework/osgi/config/spring-osgi-1.0-rc2.xsd}
2008-02-04 17:52:15,781 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/beans/spring-beans-2.0.xsd]
2008-02-04 17:52:15,781 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Loading schema mappings from [META-INF/spring.schemas]
2008-02-04 17:52:15,781 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - looking for resources META-INF/spring.schemas
2008-02-04 17:52:15,781 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - found resource META-INF/spring.schemas at initial@reference:file:../../extension-location-3.3.1.1/eclipse/plugins/spring.jar/
2008-02-04 17:52:15,781 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Loaded schema mappings: {http://www.springframework.org/schema/lang/spring-lang-2.5.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd, http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd, http://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd, http://www.springframework.org/schema/jms/spring-jms-2.5.xsd=org/springframework/jms/config/spring-jms-2.5.xsd, http://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-2.5.xsd, http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-2.5.xsd, http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd, http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd, http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd, http://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd, http://www.springframework.org/schema/jms/spring-jms.xsd=org/springframework/jms/config/spring-jms-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd, http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd, http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd, http://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee-2.5.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd, http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd}
2008-02-04 17:52:15,781 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - looking for resource org/springframework/beans/factory/xml/spring-beans-2.0.xsd
2008-02-04 17:52:15,781 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - found resource org/springframework/beans/factory/xml/spring-beans-2.0.xsd at bundleresource://89/org/springframework/beans/factory/xml/spring-beans-2.0.xsd
2008-02-04 17:52:15,781 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Found XML schema [http://www.springframework.org/schema/beans/spring-beans-2.0.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-2.0.xsd
2008-02-04 17:52:15,781 DEBUG [org.springframework.osgi.extender.internal.support.NamespacePlugins] - XML schema for null|http://www.springframework.org/schema/beans/spring-beans-2.0.xsd found inside spring (org.springframework.bundle.spring)
2008-02-04 17:52:15,921 DEBUG [org.springframework.osgi.extender.internal.support.NamespacePlugins] - trying to resolving entity for null|http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
2008-02-04 17:52:15,921 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/aop/spring-aop-2.0.xsd]
2008-02-04 17:52:15,921 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/aop/spring-aop-2.0.xsd]
2008-02-04 17:52:15,921 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - looking for resource org/springframework/aop/config/spring-aop-2.0.xsd
2008-02-04 17:52:15,937 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - found resource org/springframework/aop/config/spring-aop-2.0.xsd at bundleresource://89/org/springframework/aop/config/spring-aop-2.0.xsd
2008-02-04 17:52:15,937 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Found XML schema [http://www.springframework.org/schema/aop/spring-aop-2.0.xsd] in classpath: org/springframework/aop/config/spring-aop-2.0.xsd
2008-02-04 17:52:15,937 DEBUG [org.springframework.osgi.extender.internal.support.NamespacePlugins] - XML schema for null|http://www.springframework.org/schema/aop/spring-aop-2.0.xsd found inside spring (org.springframework.bundle.spring)
2008-02-04 17:52:15,952 DEBUG [org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader] - Loading bean definitions
2008-02-04 17:52:15,984 DEBUG [org.springframework.osgi.extender.internal.support.NamespacePlugins] - trying to resolving namespace handler for http://www.springframework.org/schema/aop
2008-02-04 17:52:15,984 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - looking for resources META-INF/spring.handlers
2008-02-04 17:52:15,984 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - found resource META-INF/spring.handlers at initial@reference:file:../../extension-location-3.3.1.1/eclipse/plugins/org.springframework.osgi.bundle.core_1.0.0.rc2_v200712112043.jar/
2008-02-04 17:52:15,984 DEBUG [org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver] - Loaded mappings [{http://www.springframework.org/schema/osgi-compendium=org.springframework.osgi.config.CompendiumNamespaceHandler, http://www.springframework.org/schema/osgi=org.springframework.osgi.config.OsgiNamespaceHandler}]
2008-02-04 17:52:15,984 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - looking for resources META-INF/spring.handlers
2008-02-04 17:52:15,984 DEBUG [org.springframework.osgi.util.BundleDelegatingClassLoader] - found resource META-INF/spring.handlers at initial@reference:file:../../extension-location-3.3.1.1/eclipse/plugins/spring.jar/
2008-02-04 17:52:15,984 DEBUG [org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver] - Loaded mappings [{http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler, http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler, http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler, http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler, http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler, http://www.springframework.org/schema/jms=org.springframework.jms.config.JmsNamespaceHandler, http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler, http://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler}]
2008-02-04 17:52:15,999 DEBUG [org.springframework.osgi.extender.internal.support.NamespacePlugins] - namespace handler for http://www.springframework.org/schema/aop found inside spring (org.springframework.bundle.spring)
2008-02-04 17:52:15,999 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Registering alias 'de.tutorials.spring.rcp.mail.NavigationView' for bean with name 'de.tutorials.spring.rcp.mail.NavigationView#0'
2008-02-04 17:52:15,999 DEBUG [org.springframework.beans.factory.xml.BeanDefinitionParserDelegate] - Neither XML 'id' nor 'name' specified - using generated bean name [de.tutorials.spring.rcp.mail.NavigationView#0]
2008-02-04 17:52:15,999 DEBUG [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loaded 3 bean definitions from location pattern [osgibundlejar:/META-INF/spring/*.xml]
2008-02-04 17:52:15,999 INFO [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext] - Bean factory for application context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@b9b538]: org.springframework.beans.factory.support.DefaultListableBeanFactory@4eeaaf
2008-02-04 17:52:15,999 DEBUG [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext] - 3 beans defined in org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@b9b538: display name [OsgiBundleXmlApplicationContext(bundle=de.tutorials.spring.rcp.mail, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Mon Feb 04 17:52:15 CET 2008]; root of context hierarchy
2008-02-04 17:52:16,015 DEBUG [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext] - registering BundleContext as a bean named bundleContext
2008-02-04 17:52:16,015 DEBUG [org.springframework.osgi.context.support.OsgiPropertyEditorRegistrar] - loaded property editors configuration {org.osgi.framework.ServiceReference=org.springframework.osgi.service.importer.support.ServiceReferenceEditor, java.util.Dictionary=org.springframework.beans.propertyeditors.PropertiesEditor}
2008-02-04 17:52:16,015 DEBUG [org.springframework.osgi.context.support.OsgiPropertyEditorRegistrar] - adding property editor[class org.springframework.osgi.service.importer.support.ServiceReferenceEditor] for type[interface org.osgi.framework.ServiceReference]
2008-02-04 17:52:16,015 DEBUG [org.springframework.osgi.context.support.OsgiPropertyEditorRegistrar] - adding property editor[class org.springframework.beans.propertyeditors.PropertiesEditor] for type[class java.util.Dictionary]
2008-02-04 17:52:16,031 DEBUG [org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor] - prerefresh completed; determining dependencies...
2008-02-04 17:52:16,046 DEBUG [org.springframework.osgi.extender.internal.dependencies.startup.DependencyServiceManager] - 0 dependencies, 0 unsatisfied for OsgiBundleXmlApplicationContext(bundle=de.tutorials.spring.rcp.mail, config=osgibundlejar:/META-INF/spring/*.xml)
2008-02-04 17:52:16,046 DEBUG [org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor] - No outstanding dependencies, completing initialization for OsgiBundleXmlApplicationContext(bundle=de.tutorials.spring.rcp.mail, config=osgibundlejar:/META-INF/spring/*.xml)
2008-02-04 17:52:16,046 DEBUG [org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor] - starting stage two for OsgiBundleXmlApplicationContext(bundle=de.tutorials.spring.rcp.mail, config=osgibundlejar:/META-INF/spring/*.xml)
2008-02-04 17:52:16,046 DEBUG [org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor] - completing refresh for OsgiBundleXmlApplicationContext(bundle=de.tutorials.spring.rcp.mail, config=osgibundlejar:/META-INF/spring/*.xml)
2008-02-04 17:52:16,046 DEBUG [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext] - Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@107bd0d]
2008-02-04 17:52:16,046 DEBUG [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext] - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@ca3783]
2008-02-04 17:52:16,046 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@4eeaaf: defining beans [org.springframework.context.config.internalBeanConfigurerAspect,service,de.tutorials.spring.rcp.mail.NavigationView#0]; root of factory hierarchy
2008-02-04 17:52:16,046 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'org.springframework.context.config.internalBeanConfigurerAspect'
2008-02-04 17:52:16,046 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'org.springframework.context.config.internalBeanConfigurerAspect' with merged definition [Root bean: class [org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=aspectOf; initMethodName=null; destroyMethodName=null]
2008-02-04 17:52:16,093 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'org.springframework.context.config.internalBeanConfigurerAspect' to allow for resolving potential circular references
2008-02-04 17:52:16,093 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'service'
2008-02-04 17:52:16,093 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'service' with merged definition [Root bean: class [de.tutorials.spring.rcp.mail.services.internal.Service]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in OSGi res[/META-INF/spring/config.xml|97|symName=de.tutorials.spring.rcp.mail]]
2008-02-04 17:52:16,093 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'service' to allow for resolving potential circular references
2008-02-04 17:52:16,093 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'de.tutorials.spring.rcp.mail.NavigationView#0'
2008-02-04 17:52:16,093 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'de.tutorials.spring.rcp.mail.NavigationView#0' with merged definition [Root bean: class [de.tutorials.spring.rcp.mail.NavigationView]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in OSGi res[/META-INF/spring/config.xml|97|symName=de.tutorials.spring.rcp.mail]]
2008-02-04 17:52:16,109 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTING] for bundle [org.eclipse.help]
2008-02-04 17:52:16,109 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTING] for bundle [org.eclipse.help]
2008-02-04 17:52:16,109 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTED] for bundle [org.eclipse.help]
2008-02-04 17:52:16,109 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - Processing bundle event [STARTED] for bundle [org.eclipse.help]
2008-02-04 17:52:16,109 DEBUG [org.springframework.osgi.extender.internal.support.ApplicationContextConfiguration] - configuration: AppCtxCfg [Bundle=org.eclipse.help]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:16,109 DEBUG [org.springframework.osgi.extender.internal.ContextLoaderListener] - created config AppCtxCfg [Bundle=org.eclipse.help]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s
2008-02-04 17:52:16,109 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'service'
2008-02-04 17:52:16,109 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Getting BeanInfo for class [de.tutorials.spring.rcp.mail.NavigationView]
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Caching PropertyDescriptors for class [de.tutorials.spring.rcp.mail.NavigationView]
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Found bean property 'class' of type [java.lang.Class]
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Found bean property 'contentDescription' of type [java.lang.String]
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Found bean property 'orientation' of type [int]
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Found bean property 'partName' of type [java.lang.String]
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Found bean property 'partProperties' of type [java.util.Map]
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Found bean property 'service' of type [de.tutorials.spring.rcp.mail.services.IService]
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Found bean property 'site' of type [org.eclipse.ui.IWorkbenchPartSite]
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Found bean property 'title' of type [java.lang.String]
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Found bean property 'titleImage' of type [org.eclipse.swt.graphics.Image]
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Found bean property 'titleToolTip' of type [java.lang.String]
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Found bean property 'viewSite' of type [org.eclipse.ui.IViewSite]
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Not strongly caching class [de.tutorials.spring.rcp.mail.NavigationView] because it is not cache-safe
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'de.tutorials.spring.rcp.mail.NavigationView#0' to allow for resolving potential circular references
2008-02-04 17:52:16,124 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'service'
2008-02-04 17:52:16,124 DEBUG [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext] - Publishing event in context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@b9b538]: org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@b9b538: display name [OsgiBundleXmlApplicationContext(bundle=de.tutorials.spring.rcp.mail, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Mon Feb 04 17:52:15 CET 2008]; root of context hierarchy]
2008-02-04 17:52:16,124 INFO [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext] - Publishing application context with properties (org.springframework.context.service.name=de.tutorials.spring.rcp.mail)
2008-02-04 17:52:16,124 DEBUG [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext] - publishing service under classes {org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext, org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext, org.springframework.osgi.context.DelegatedExecutionOsgiBundleApplicationContext, org.springframework.osgi.context.ConfigurableOsgiBundleApplicationContext, org.springframework.context.ConfigurableApplicationContext, org.springframework.context.ApplicationContext, org.springframework.context.Lifecycle, org.springframework.beans.factory.ListableBeanFactory, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.context.MessageSource, org.springframework.context.ApplicationEventPublisher, org.springframework.core.io.support.ResourcePatternResolver, org.springframework.beans.factory.BeanFactory, org.springframework.core.io.ResourceLoader, org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext, org.springframework.context.support.AbstractRefreshableApplicationContext, org.springframework.context.support.AbstractApplicationContext, org.springframework.beans.factory.DisposableBean, org.springframework.core.io.DefaultResourceLoader}
2008-02-04 17:52:16,562 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'service'
###de.tutorials.spring.rcp.mail.services.internal.Service@1bbbafc
```

an der letzten Zeile 

```
###de.tutorials.spring.rcp.mail.services.internal.Service@1bbbafc
```
können wir sehen, dass unser Service wie zu erwarten richtig injected wurde 

Gruß Tom


----------



## IngoLeiking (8. März 2008)

Hi Thomas,

zunächst einmal danke für die vielen Tutorials hier...

Derzeit versuche ich mich just an diesem hier. Allerdings habe ich das Problem, dass ich es nicht zum Laufen bekomme. Ich verwende Spring DM Version 1.0.1. Da es anscheinend die Namen der Bundles geändert haben, habe ich versucht die jeweils entsprechenden auszuwählen. Hier die Required Liste:


```
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Mail Plug-in
Bundle-SymbolicName: de.tutorials.spring.rcp.mail; singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: de.tutorials.spring.rcp.mail.Activator
Require-Bundle: org.eclipse.ui,
 org.eclipse.core.runtime,
 org.apache.commons.logging,
 org.aspectj.runtime,
 org.springframework.bundle.osgi.core,
 org.springframework.bundle.osgi.extender,
 org.springframework.bundle.osgi.extensions.annotations,
 org.springframework.bundle.osgi.io,
 org.springframework.bundle.spring.aop,
 org.springframework.bundle.spring
Eclipse-LazyStart: true
Bundle-ClassPath: .,
 lib/spring-aspects.jar
```

Da in der Target-Runtime auch kein AspectJ installiert war, habe ich schlicht diese Bundles dorthin kopiert:


```
org.aspectj.weaver_1.5.4.20080111211120
org.aspectj.runtime_1.5.4.20080111211120
```

Ansonten habe ich deine Vorlage unverändert gelassen. 

Bei Start der Anwendung erhalte ich allerdings folgende Meldung:


```
[org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect] - BeanFactory has not been set on AnnotationBeanConfigurerAspect: Make sure this configurer runs in a Spring container. Proceeding without injection.
```

Woran kann das liegen? Benötige wie im Spring/AspectJ Beispiel wegen CompileTime Weaving auch eine aop.xml und die folgenden Libs im Classpath?


```
lib/cglib-nodep-2.1_3.jar,\
               lib/commons-logging.jar,\
               lib/dom4j-1.6.1.jar,\
               lib/spring.jar,\
               lib/spring-aspects.jar,\
               lib/aspectjrt.jar,\
               lib/aspectjweaver.jar
```

Natürlich habe ich auch das schon ausprobiert, wie du dir aber sicher denken kannst ohne Erfolg...


Ein Blick auf die gestarteten Bundles zeigt mir, dass Spring aber gar nicht aktiv geworden zu sein scheint.


```
ss

Framework is launched.

id	State       Bundle
0	ACTIVE      org.eclipse.osgi_3.3.1.R33x_v20070828
75	INSTALLED   org.eclipse.birt.core_2.2.1.r22x_v20070924
76	INSTALLED   org.eclipse.birt.report.engine_2.2.1.r22x_v20070924
77	INSTALLED   org.eclipse.birt.report.model_2.2.1.r22x_v20070927
282	RESOLVED    org.springframework.bundle.spring_2.5.2
452	RESOLVED    log4jToJTC_1.0.0
	            Master=1085
512	RESOLVED    org.aspectj.runtime_1.5.4.20080111211120
513	RESOLVED    org.aspectj.weaver_1.5.4.20080111211120
1078	ACTIVE      org.eclipse.equinox.common_3.3.0.v20070426
1079	ACTIVE      org.eclipse.core.runtime_3.3.100.v20070530
1080	<<LAZY>>    com.ibm.icu_3.6.1.v20070906
1081	ACTIVE      de.tutorials.spring.rcp.mail_1.0.0
1082	RESOLVED    javax.servlet_2.4.0.v200706111738
1083	RESOLVED    javax.servlet.jsp_2.0.0.v200706191603
1085	RESOLVED    org.apache.commons.logging_1.0.4.v200706111724
	            Fragments=452
1088	RESOLVED    org.eclipse.core.commands_3.3.0.I20070605-0010
1089	<<LAZY>>    org.eclipse.core.contenttype_3.2.100.v20070319
1090	RESOLVED    org.eclipse.core.databinding_1.0.1.M20070822-0800
1091	ACTIVE      org.eclipse.core.expressions_3.3.0.v20070606-0010
1092	ACTIVE      org.eclipse.core.jobs_3.3.1.R33x_v20070709
1093	<<LAZY>>    org.eclipse.core.net_1.0.1.r33x_20070709
1094	ACTIVE      org.eclipse.core.runtime.compatibility.auth_3.2.100.v20070502
1095	RESOLVED    org.eclipse.core.runtime.compatibility.registry_3.2.100.v20070316
	            Master=1098
1096	ACTIVE      org.eclipse.equinox.app_1.0.1.R33x_v20070828
1097	ACTIVE      org.eclipse.equinox.preferences_3.2.100.v20070522
1098	ACTIVE      org.eclipse.equinox.registry_3.3.1.R33x_v20070802
	            Fragments=1095
1099	ACTIVE      org.eclipse.help_3.3.1.v20070726_33x
1100	ACTIVE      org.eclipse.jface_3.3.1.M20070910-0800b
1101	RESOLVED    org.eclipse.jface.databinding_1.1.1.M20070910-0800b
1102	<<LAZY>>    org.eclipse.mylyn.web.core_2.1.0.v20070927-0900
1103	RESOLVED    org.eclipse.osgi.services_3.1.200.v20070605
1104	RESOLVED    org.eclipse.swt_3.3.1.v3346j
	            Fragments=1105
1105	RESOLVED    org.eclipse.swt.win32.win32.x86_3.3.1.v3346i
	            Master=1104
1106	ACTIVE      org.eclipse.ui_3.3.1.M20070910-0800b
1107	ACTIVE      org.eclipse.ui.workbench_3.3.1.M20070921-1200
1108	RESOLVED    org.springframework.bundle.osgi.core_1.0.1
1109	RESOLVED    org.springframework.bundle.osgi.extender_1.0.1
1110	RESOLVED    org.springframework.bundle.osgi.extensions.annotations_1.0.1
1111	RESOLVED    org.springframework.bundle.osgi.io_1.0.1
1113	RESOLVED    org.springframework.bundle.spring.aop_2.5.1
1114	RESOLVED    org.springframework.osgi.log4j.osgi_1.2.15.SNAPSHOT
1119	RESOLVED    org.springframework.osgi.backport-util-concurrent.osgi_3.1.0.SNAPSHOT
```

Seltsam...
Was ist zu tun?

Danke und Gruß,

Ingo


----------



## IngoLeiking (9. März 2008)

Hi,

okay, eigentlich scheint es doch zu laufen. Nach noch ein paar weiteren Versuchen hatte es geklappt, allerdings erst nachdem ich manuell das Extender Bundle gestartet hatte. Anschließend wurde bei einem neuen Window der Service injekted, oder auch der Neustart verlief problemlos. Anscheinend mekrt sich Eclipse auch hier welche Bundles beim letzten Mal gestartet waren. 
Die Frage nun: Wie kann ich erzwingen, dass das Extender Bundle auch beim ersten Start korrekt hochgefahren wird, und zwar vor der eigentlichen Anwendung? Gerade wenn nach dem Export als Applikation keine Console mehr vorhanden ist? Ein @start in der config.ini scheint nicht zu funktionieren, da auch hier wieder ein NULL zum Vorschein kommt. :-(

/Ingo


----------



## mthielen (8. April 2008)

Hallo,
Danke für deine wertvollen Tipps, ich habe es nun auch endlich hingekriegt einen Springcontext in Eclipse via SpringDM zu erzeugen.

Allerdings schaffe ich es nicht eine View mit Spring zu injecten.
Soweit ich ergoogelt habe, gibt es ja wohl 2 Möglichkeiten das hinzukriegen: Zum einen über AspectJ, wie Du es beschrieben hast, zum anderen mit einem zusätzlichen Eclipse-Contributor, wo man allerdings die Plugin.xml für umschreiben muss.

Mir gefällt die AspectJ Variante mehr, es ist bei mir aber so, dass die View von Eclipse aus erzeugt wird, *bevor* der Spring-Context geladen ist. (Somit kommt AspectJ gar nicht zum Zuge). Beim Debuggen ist mir aufgefallen, das das erzeugen der View von Eclipse aus auch in einem anderen Thread läuft als das laden des Contexts.

Ich verwende Eclipse 3.3.2, Spring 2.5.2. und SpringDM 1.0.2 , vielleicht gab es dort auch Änderungen gegenüber den von dir verwendeten Versionen. (zb verwende ich <context:spring-configured/> statt <aop:spring-configured/> und andere Libraries.)

Was mache ich falsch? Kannst du mir helfen?


----------

