hi Ramkumar...do you have a link to the jar? I'm using 1.3 right now. thx abe
----- Original Message ---- From: Ramkumar R <[EMAIL PROTECTED]> To: [email protected] Sent: Tuesday, September 23, 2008 3:39:27 AM Subject: Re: sca namespace in spring Hi Abraham, Can you just confirm if the implementation-spring module OR the tuscany-implementation-spring-1.4-SNAPSHOT.jar is available in your classpath? The Namespace Handlers are available from this module. On Tue, Sep 23, 2008 at 6:21 AM, Abraham Washington <[EMAIL PROTECTED]> wrote: different error, but I think it's not liking the sca definition: OrganizationServiceImpl.saveoOrganization...Exception in thread "main" java.lang.reflect.UndeclaredThrowableExceptionat $Proxy19.saveOrganization(Unknown Source) at org.soa.services.test.OrganizationServiceCompositeRunner.main( OrganizationServiceCompositeRunner.java:62) Caused by: java.lang.reflect.InvocationTargetExceptionat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.tuscany.sca.implementation.spring.SpringInvoker.doInvoke(SpringInvoker.java:100) at org.apache.tuscany.sca.implementation.spring.SpringInvoker.invoke(SpringInvoker.java:116) at org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112) at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61) at org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112) at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287) at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154) ... 2 more Caused by: org.springframework.beans.factory.access.BootstrapException: Unable to initialize group definition. Group resource name [classpath*:beanRefFactory.xml], factory key [beanRefFactory]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beanRefFactory' defined in URL [file:/C:/work/development/Organization-Service-Composite/src/main/resources/beanRefFactory.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.springframework.org/schema/sca] Offending resource: class path resource [Organization-spring-context.xml] at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:383) at org.dcri.soa.services.util.Utils.getApplicationContext(Utils.java:24) at org.dcri.soa.services.OrganizationServiceImpl.saveOrganization(OrganizationServiceImpl.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0( Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:280) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154) at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:104) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210) at $Proxy20.saveOrganization(Unknown Source) ... 13 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beanRefFactory' defined in URL [file:/C:/work/development/Organization-Service-Composite/src/main/resources/beanRefFactory.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.springframework.org/schema/sca] Offending resource: class path resource [Organization-spring-context.xml] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:443) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:140) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346) at org.springframework.context.access.ContextSingletonBeanFactoryLocator.initializeDefinition(ContextSingletonBeanFactoryLocator.java:136) at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:380) ... 26 more Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.springframework.org/schema/sca] Offending resource: class path resource [Organization-spring-context.xml] at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:99) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:78) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:156) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:684) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:622) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:381) ... 34 more Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.springframework.org/schema/sca] Offending resource: class path resource [Organization-spring-context.xml] at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:59) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:64) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:55) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1144) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1137) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:143) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:88) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:499) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:407) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:357) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:168) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:94) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:292) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:84) here's my composite def: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sca="http://www.springframework.org/schema/sca" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> let me know if i did something wrong...thx abe ----- Original Message ---- From: Mike Edwards <[EMAIL PROTECTED]> To: [email protected] Sent: Monday, September 22, 2008 4:58:58 PM Subject: Re: sca namespace in spring Abe, If that listing of your composite is what you are using now, then you should change the schema location of http://www.springframework.org/schema/sca to be: http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd ie, your schemaLocation should look something like this: xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd" ...the schema is at that location so it should get found. In the longer run we are getting the namespace changed to an OASIS one, but it will take a few weeks to achieve that as formal OASIS votes are required. Best wishes, Yours, Mike. Abraham Washington wrote: > hi Mike...I tried running my composite, but no luck. I changed the > composite to be: > > > > <beans xmlns="http://www.springframework.org/schema/beans" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xmlns:sca="http://www.springframework.org/schema/sca" > > xmlns:tx="http://www.springframework.org/schema/tx" > > xsi:schemaLocation=" > > http://www.springframework.org/schema/beans > > http://www.springframework.org/schema/beans/spring-beans.xsd > > http://www.springframework.org/schema/sca > > http://www.springframework.org/schema/sca/spring-sca.xsd > > http://www.springframework.org/schema/tx > > http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> > > ...... > > > > > > And that's all I changed. Is there a fix in a branch I'm supposed to > get somewhere ?? > > > > Here's the error an how I'm trying to get the bean: > > > > org.soa.services.util.Utils./getApplicationContext/().getBean("dataSource"); > > > > > > * * > > *public* *static* org.springframework.context.ApplicationContext > getApplicationContext() > > { > > org.springframework.context.ApplicationContext applicationContext = > > (org.springframework.context.ApplicationContext) > org.springframework.context.access.ContextSingletonBeanFactoryLocator./getInstance/("beanRefFactory.xml").useBeanFactory("beanRefFactory").getFactory(); > > *return* applicationContext; > > } > > > And the error: > > > OrganizationServiceImpl.saveoOrganization... > > Exception in thread "main" _java.lang.reflect.UndeclaredThrowableException_ > > at $Proxy19.saveOrganization(Unknown Source) > > at > org.soa.services.test.DCRIOrganizationServiceCompositeRunner.main(_OrganizationServiceCompositeRunner.java:62_) > > Caused by: _java.lang.reflect.InvocationTargetException_ > > at sun.reflect.NativeMethodAccessorImpl.invoke0(_Native Method_) > > at > sun.reflect.NativeMethodAccessorImpl.invoke(_NativeMethodAccessorImpl.java:39_) > > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(_DelegatingMethodAccessorImpl.java:25_) > > at java.lang.reflect.Method.invoke(_Method.java:585_) > > at > org.apache.tuscany.sca.implementation.spring.SpringInvoker.doInvoke(_SpringInvoker.java:100_) > > at > org.apache.tuscany.sca.implementation.spring.SpringInvoker.invoke(_SpringInvoker.java:116_) > > at > org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(_PassByValueInterceptor.java:112_) > > at > org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(_SCABindingInvoker.java:61_) > > at > org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(_PassByValueInterceptor.java:112_) > > at > org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(_JDKInvocationHandler.java:287_) > > at > org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(_JDKInvocationHandler.java:154_) > > ... 2 more > > Caused by: > _org.springframework.beans.factory.access.BootstrapException_: Unable to > initialize group definition. Group resource name > [classpath*:beanRefFactory.xml], factory key [beanRefFactory]; nested > exception is _org.springframework.beans.factory.BeanCreationException_: > Error creating bean with name 'beanRefFactory' defined in URL > [file:/C:/work/development/Organization-Service-Composite/src/main/resources/beanRefFactory.xml]: > > Instantiation of bean failed; nested exception is > _org.springframework.beans.BeanInstantiationException_: Could not > instantiate bean class > [org.springframework.context.support.ClassPathXmlApplicationContext]: > Constructor threw exception; nested exception is > _org.springframework.beans.factory.parsing.BeanDefinitionParsingException_: > Configuration problem: Unable to locate NamespaceHandler for namespace > [http://www.springframework.org/schema/sca] > > Offending resource: class path resource [Organization-spring-context.xml] > > at > org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(_SingletonBeanFactoryLocator.java:383_) > > at org.soa.services.util.Utils.getApplicationContext(_Utils.java:24_) > > > thx abe > > h -- Thanks & Regards, Ramkumar Ramalingam
