You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Abraham Washington <ab...@yahoo.com> on 2008/10/01 00:55:18 UTC

Re: sca namespace in spring

hi everyone (especially Ramkumar)...i tested the patch that Ramkumar and it works great.  I'm able to grab a bean instance after getting the spring context.  if there's something i need to do for the bug, let me know.
 
thx abe
 



----- Original Message ----
From: Ramkumar R <ra...@gmail.com>
To: user@tuscany.apache.org
Cc: abewashton@yahoo.com
Sent: Thursday, September 25, 2008 6:16:37 AM
Subject: Re: sca namespace in spring


Hi Abraham,
I would always recommend to pick the latest release for any changes OR fixes for the issue reported. As the latest changes are not yet part of any relases, in this case I can suggest you a temporary workaround to incorporate the latest changes (from trunk) of Spring module with 1.3 distribution.

Steps to follow: (A simple workaround, that I can think off)
1. Please download the source distribution of 1.3 release (apache-tuscany-sca-1.3-src.zip).
2. Unzip them into your local folder, say C:\Tuscany\release\1.3. The unzipped items should be available in C:\Tuscany\releases\1.3\tuscany-sca-1.3-src folder.
3. Download the latest source for Spring module from the trunk http://svn.apache.org/repos/asf/tuscany/java/sca/modules/implementation-spring/src/ (the main and test folders)
4. Copy the downloaded main and test folders into the local folder C:\Tuscany\releases\1.3\tuscany-sca-1.3-src\modules\implementation-spring\src.
5. From C:\Tuscany\releases\1.3\tuscany-sca-1.3-src\modules\implementation-spring folder use "mvn clean install" to build the module, this would create a tuscany-implementation-spring-1.3.jar file inside the target directory of the module.
6. Now use "mvn clean install" to build the tuscany-bundle-1.3.jar from C:\Tuscany\releases\1.3\tuscany-sca-1.3-src\distribution\bundle folder. Rename the tuscany-bundle-1.3.jar to tuscany-bundle-all-1.3.jar.
7. Copy the tuscany-implementation-spring-1.3.jar and tuscany-bundle-all-1.3.jar to the appropriate folders in your binary distributions you already have. Now we have the latest changes with us.

NOTE: As per the latest changes some of the spring samples in your binary distribution would fail as they use the old spring namespace (http://www.springframework.org/schema/sca).

As mentioned in the steps above, I have created this 2 jars for you with the changes and have attached them with this mail. Since I have marked a CC to your personal mail id... you should be able to get this attachment to download.

You can use the above mentioned steps to create your own, if this attached jar does not work for you.



On Wed, Sep 24, 2008 at 6:03 PM, Abraham Washington <ab...@yahoo.com> wrote:

hi Ramkumar..i'm using the 1.3 binary distribution.  not sure what you mean by "details of the configuration you are using with these distribution for your application" ?
 
not using das, using java sca, spring, hibernate.  ant for building.  let me know if you need more information.  thx abe
 



----- Original Message ----
From: Ramkumar R <ra...@gmail.com>
To: user@tuscany.apache.org

Sent: Wednesday, September 24, 2008 4:52:40 AM
Subject: Re: sca namespace in spring


Hi Abraham,
Well 1.3 will throw this issue, the latest changes have gone into the trunk and not as part of any release yet.

I like to know what distribution you are using for your application. Are you using the source distribution? OR do you use the binary distribution? This would help me to propose a workaround.

Also If you can eloborate on the details of the configuration you are using with these distribution for your application would help.


On Wed, Sep 24, 2008 at 8:26 AM, Abraham Washington <ab...@yahoo.com> wrote:

hi Ramkumar...do you have a link to the jar?  I'm using 1.3 right now.
 
thx abe



----- Original Message ----
From: Ramkumar R <ra...@gmail.com>
To: user@tuscany.apache.org

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 <ab...@yahoo.com> 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 <mi...@gmail.com>
To: user@tuscany.apache.org

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




-- 
Thanks & Regards,
Ramkumar Ramalingam




-- 
Thanks & Regards,
Ramkumar Ramalingam