Spring DM

  • Themenstarter Themenstarter Gast2
  • Beginndatum Beginndatum
Die Instanz mit dem @Autowired muss auch durch Spring instanziert werden, sonst ist eigentlich nichts zu beachten.

[XML]
<bean id="kundenModel" class="model.KundenModel">
</bean>
<bean id="addKunde" class="controller.AddKunde" >
<!-- <property name="kundenModel" ref="kundenModel"/>-->
</bean>
[/XML]

Java:
public class AddKunde extends Action{	
	@Autowired
	private KundenModel kundenModel;

Ist immer null... mhm
 
Hast du denn auch die passenden Getter/Setter und hast du es mal aus Spaß zusätzlich mit nem Qualifier probiert?

He was für getter/setter, man benötigt doch keinen setter oder??? Und welchen Qualifier meinst du??

Also dass hier kommt beim Starten konnte nichts ausergewöhnliches finden...
Java:
eb 5, 2010 5:57:46 PM org.springframework.osgi.extender.internal.activator.ContextLoaderListener start
INFO: Starting [org.springframework.osgi.extender] bundle v.[1.1.2.B]
Feb 5, 2010 5:57:47 PM org.springframework.osgi.extender.internal.support.ExtenderConfiguration <init>
INFO: No custom extender configuration detected; using defaults...
Feb 5, 2010 5:57:47 PM org.springframework.scheduling.timer.TimerTaskExecutor afterPropertiesSet
INFO: Initializing Timer
Feb 5, 2010 5:57:47 PM org.springframework.osgi.extender.support.DefaultOsgiApplicationContextCreator createApplicationContext
INFO: Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [Impl (service.impl)]
Feb 5, 2010 5:57:47 PM org.springframework.osgi.extender.support.DefaultOsgiApplicationContextCreator createApplicationContext
INFO: Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [DbObject Impl (dbObject.impl)]
Feb 5, 2010 5:57:47 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@1b06041: display name [OsgiBundleXmlApplicationContext(bundle=service.impl, config=osgibundle:/META-INF/spring/*.xml)]; startup date [Fri Feb 05 17:57:47 CET 2010]; root of context hierarchy
Feb 5, 2010 5:57:47 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@56860b: display name [OsgiBundleXmlApplicationContext(bundle=dbObject.impl, config=osgibundle:/META-INF/spring/*.xml)]; startup date [Fri Feb 05 17:57:47 CET 2010]; root of context hierarchy
Feb 5, 2010 5:57:47 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from URL [bundleentry://325.fwk10039797/META-INF/spring/service-impl-context.xml]
Feb 5, 2010 5:57:47 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from URL [bundleentry://442.fwk10039797/META-INF/spring/db-context.xml]
Feb 5, 2010 5:57:47 PM org.springframework.osgi.extender.internal.activator.ContextLoaderListener start
INFO: Starting [org.springframework.bundle.osgi.extender] bundle v.[1.1.2]
Feb 5, 2010 5:57:47 PM org.springframework.osgi.extender.internal.support.ExtenderConfiguration <init>
INFO: No custom extender configuration detected; using defaults...
Feb 5, 2010 5:57:47 PM org.springframework.scheduling.timer.TimerTaskExecutor afterPropertiesSet
INFO: Initializing Timer
Feb 5, 2010 5:57:47 PM org.springframework.osgi.extender.support.DefaultOsgiApplicationContextCreator createApplicationContext
INFO: Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [Impl (service.impl)]
Feb 5, 2010 5:57:47 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@1b06041]: org.springframework.beans.factory.support.DefaultListableBeanFactory@cf710e
Feb 5, 2010 5:57:47 PM org.springframework.osgi.extender.support.DefaultOsgiApplicationContextCreator createApplicationContext
INFO: Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [DbObject Impl (dbObject.impl)]
Feb 5, 2010 5:57:47 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@56860b]: org.springframework.beans.factory.support.DefaultListableBeanFactory@10efd7c
Feb 5, 2010 5:57:48 PM org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor stageOne
INFO: No outstanding OSGi service dependencies, completing initialization for OsgiBundleXmlApplicationContext(bundle=dbObject.impl, config=osgibundle:/META-INF/spring/*.xml)
Feb 5, 2010 5:57:48 PM org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor stageOne
INFO: No outstanding OSGi service dependencies, completing initialization for OsgiBundleXmlApplicationContext(bundle=service.impl, config=osgibundle:/META-INF/spring/*.xml)
Feb 5, 2010 5:57:48 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@a23610: display name [OsgiBundleXmlApplicationContext(bundle=service.impl, config=osgibundle:/META-INF/spring/*.xml)]; startup date [Fri Feb 05 17:57:48 CET 2010]; root of context hierarchy
Feb 5, 2010 5:57:48 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from URL [bundleentry://325.fwk10039797/META-INF/spring/service-impl-context.xml]
Feb 5, 2010 5:57:48 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@a23610]: org.springframework.beans.factory.support.DefaultListableBeanFactory@e41bc3
Feb 5, 2010 5:57:48 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@cf710e: defining beans [kundenService,test]; root of factory hierarchy
Feb 5, 2010 5:57:48 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@10efd7c: defining beans [factory,kundenFactory]; root of factory hierarchy
start serviceFeb 5, 2010 5:57:48 PM org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor stageOne
INFO: No outstanding OSGi service dependencies, completing initialization for OsgiBundleXmlApplicationContext(bundle=service.impl, config=osgibundle:/META-INF/spring/*.xml)
Feb 5, 2010 5:57:48 PM org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean registerService
INFO: Publishing service under classes [{inter.KundenFactory}]
Feb 5, 2010 5:57:48 PM org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext publishContextAsOsgiServiceIfNecessary
INFO: Publishing application context as OSGi service with properties {org.springframework.context.service.name=dbObject.impl, Bundle-SymbolicName=dbObject.impl, Bundle-Version=1.0.0.qualifier}
Feb 5, 2010 5:57:48 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@e41bc3: defining beans [kundenService,test]; root of factory hierarchy
Feb 5, 2010 5:57:48 PM org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean registerService
INFO: Publishing service under classes [{inter.KundenService}]
Feb 5, 2010 5:57:48 PM org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext publishContextAsOsgiServiceIfNecessary
INFO: Publishing application context as OSGi service with properties {org.springframework.context.service.name=service.impl, Bundle-SymbolicName=service.impl, Bundle-Version=1.0.0.qualifier}
start serviceFeb 5, 2010 5:57:48 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@1684706: display name [OsgiBundleXmlApplicationContext(bundle=dbObject.impl, config=osgibundle:/META-INF/spring/*.xml)]; startup date [Fri Feb 05 17:57:48 CET 2010]; root of context hierarchy
Feb 5, 2010 5:57:48 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from URL [bundleentry://442.fwk10039797/META-INF/spring/db-context.xml]
Feb 5, 2010 5:57:48 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@1684706]: org.springframework.beans.factory.support.DefaultListableBeanFactory@b0095d
Feb 5, 2010 5:57:48 PM org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor stageOne
INFO: No outstanding OSGi service dependencies, completing initialization for OsgiBundleXmlApplicationContext(bundle=dbObject.impl, config=osgibundle:/META-INF/spring/*.xml)
Feb 5, 2010 5:57:48 PM org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean registerService
INFO: Publishing service under classes [{inter.KundenService}]
Feb 5, 2010 5:57:48 PM org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext publishContextAsOsgiServiceIfNecessary
INFO: Publishing application context as OSGi service with properties {org.springframework.context.service.name=service.impl, Bundle-SymbolicName=service.impl, Bundle-Version=1.0.0.qualifier}
Feb 5, 2010 5:57:48 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@b0095d: defining beans [factory,kundenFactory]; root of factory hierarchy
Feb 5, 2010 5:57:48 PM org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean registerService
INFO: Publishing service under classes [{inter.KundenFactory}]
Feb 5, 2010 5:57:48 PM org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext publishContextAsOsgiServiceIfNecessary
INFO: Publishing application context as OSGi service with properties {org.springframework.context.service.name=dbObject.impl, Bundle-SymbolicName=dbObject.impl, Bundle-Version=1.0.0.qualifier}
Feb 5, 2010 5:57:48 PM org.springframework.osgi.extender.support.DefaultOsgiApplicationContextCreator createApplicationContext
INFO: Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [Client (client; singleton:=true)]
Feb 5, 2010 5:57:48 PM org.springframework.osgi.extender.support.DefaultOsgiApplicationContextCreator createApplicationContext
INFO: Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [Client (client; singleton:=true)]
Feb 5, 2010 5:57:48 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@45378f: display name [OsgiBundleXmlApplicationContext(bundle=client, config=osgibundle:/META-INF/spring/*.xml)]; startup date [Fri Feb 05 17:57:48 CET 2010]; root of context hierarchy
Feb 5, 2010 5:57:48 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from URL [bundleentry://469.fwk10039797/META-INF/spring/client-context.xml]
Feb 5, 2010 5:57:48 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@45378f]: org.springframework.beans.factory.support.DefaultListableBeanFactory@f20434
Feb 5, 2010 5:57:48 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@127461b: display name [OsgiBundleXmlApplicationContext(bundle=client, config=osgibundle:/META-INF/spring/*.xml)]; startup date [Fri Feb 05 17:57:48 CET 2010]; root of context hierarchy
Feb 5, 2010 5:57:48 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from URL [bundleentry://469.fwk10039797/META-INF/spring/client-context.xml]
Feb 5, 2010 5:57:48 PM org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor stageOne
INFO: No outstanding OSGi service dependencies, completing initialization for OsgiBundleXmlApplicationContext(bundle=client, config=osgibundle:/META-INF/spring/*.xml)
Feb 5, 2010 5:57:48 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@127461b]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1a70b8
Feb 5, 2010 5:57:48 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@f20434: defining beans [kundenFactory,test,addKunde,createView,lastView,view,kundenModel]; root of factory hierarchy
Feb 5, 2010 5:57:49 PM org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor stageOne
INFO: No outstanding OSGi service dependencies, completing initialization for OsgiBundleXmlApplicationContext(bundle=client, config=osgibundle:/META-INF/spring/*.xml)
Feb 5, 2010 5:57:49 PM org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext publishContextAsOsgiServiceIfNecessary
INFO: Publishing application context as OSGi service with properties {org.springframework.context.service.name=client, Bundle-SymbolicName=client, Bundle-Version=1.0.0.qualifier}
Feb 5, 2010 5:57:49 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1a70b8: defining beans [kundenFactory,test,addKunde,createView,lastView,view,kundenModel]; root of factory hierarchy
Feb 5, 2010 5:57:49 PM org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext publishContextAsOsgiServiceIfNecessary
INFO: Publishing application context as OSGi service with properties {org.springframework.context.service.name=client, Bundle-SymbolicName=client, Bundle-Version=1.0.0.qualifier}


EDIT:
Also falls es das ist was du meinst =), hat auch nicht geklappt. Mhm...
Java:
	@Autowired
	private KundenModel kundenModel;
	
	public void setKundenModel(KundenModel kundenModel) {
		this.kundenModel = kundenModel;
	}

	public KundenModel getKundenModel() {
		return kundenModel;
	}
 
ahhhh ich depp zum 2ten mal den gleichen Fehler gemacht...
Das hat gefehlt -.-
[XML]
<context:annotation-config/>
[/XML]
 
Hallo,

ich mal wieder 😉...
Sagt jemand diese Fehlermeldung was? Die kommt sofort nachdem Start
Java:
Feb 15, 2010 8:29:57 PM org.springframework.osgi.extender.internal.support.DefaultOsgiBundleApplicationContextListener onOsgiApplicationEvent
SEVERE: Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=service.impl, config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [[url=http://www.springframework.org/schema/osgi]]SpringSource.org |[/url]
Offending resource: URL [bundleentry://325.fwk10039797/META-INF/spring/service-impl-context.xml]

	at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
	at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
	at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:284)
	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1332)
	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325)
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:136)
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:172)
	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)
	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:458)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:62)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:244)
	at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:87)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:222)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:225)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:178)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:159)
	at org.springframework.osgi.extender.internal.activator.LifecycleManager$1.run(LifecycleManager.java:223)
	at java.lang.Thread.run(Unknown Source)

[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😱sgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
Index of /schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">

<bean id="kundenService"
class="service.KundenServiceImpl"
init-method="start"
destroy-method="stop" />

<osgi:service id="test" ref="kundenService" interface="inter.KundenService"></osgi:service>
</beans>
[/XML]

EDIT: Mhm liegt wohl irgendwie an Spring DM 2.0 , weil sobald ich ich Spring DM 1.2.1 nehme geht wieder alles.
 
Zuletzt bearbeitet von einem Moderator:

Neue Themen


Zurück
Oben