I've had a quick look, the problem is the wiring between the JSP page reference and the composite - the JSP reference name needs to match the name of the component/service defined in your composite. It should work but doesn't due to a bug if you changed the JSP reference to be named BudgetSCAService which is the name of the <service> in your .composite file, please raise a JIRA for that. To work around that for now you can use the component name, so in the JSP have the reference be:
<sca:reference name="BudgetSpringComponent" type="com.tcc.budget.BudgetDataService" /> That gets it working for me. ...ant On Tue, Mar 24, 2009 at 12:35 PM, Rupesh M G <[email protected]> wrote: > > Hello Ramkumar, > > Thank you very much for the reply. > We continued further with the sample, and got that error away by putting the > composite in the WEB-INF folder, and the spring xml file in the classpath. > > Now we are stuck at another point. > > The JSP is not able to find the service exposed by the composite. > > Our eclipse workspace excluding the lib is attached. (web-sca-sample.zip). > > The error stack is also attached (error.txt). > > Kindly look at it, and provide your valuable comments. > > > > > > Regards, > Rupesh > > > > Ramkumar R <[email protected]> > > 03/23/2009 07:45 PM > > Please respond to > [email protected] > To > [email protected] > cc > Subject > Re: tuscany + spring + webapp > > > > > Hi Rupesh, > > Welcome to Tuscany ! > > Your approach seem to be right, I agree that we don't have any sample > application demonstrating the usage of SCA and Spring within java web > application as there were no requirement stating this functionality. Its > good that you have come up with this requirement. > > Please open a JIRA for your requirement: > http://tuscany.apache.org/issue-tracking.html > > I will take a look as what is missing here, it would he helpful if you can > share a sample application that can replicate this usecase. > > On Mon, Mar 23, 2009 at 6:29 PM, Rupesh M G <[email protected]> > wrote: > > Hello Friend, > > I'm new to Tuscany and SCA. I have gone through the available > samples. I'm not able to get the following scenario working. > Please reply if there is any limitation, or if my approach is wrong. > > > My requirement is to use tuscany 1.4 & spring inside a java web application. > I did the following. > > composite file > -------------------------- > has a service entry, and it is promoted to a component > (implementation.spring). > The component points to the spring application context. > > spring application context file > ------------------------------------------------ > has an sca:service entry, and it is targeting a spring bean. > > domain configuration > ------------------------------ > the sca-contributions.xml is put in the META-INF folder of the web archive. > It indicates the deployable composite. > > my requirement > ----------------------- > invoke a method of the spring bean from a jsp page. > > what i did > -------------- > added an sca reference in the jsp page > it should invoke the service of the composite. That in turn passes the call > to component inside the composite. > > The service exposed by the component (which is a sca spring implementation) > gets called. > And it is transferred to the spring bean. > > > Result / Problem > ------------------------- > I'm not able to locate the spring context file. Still the file is there in > the same folder as the composite. > The error stack is listed below this email. > > Question > -------------- > I got the spring sample applications running in tuscany standalone > environment. > Any limitations for tuscany 1.4 & spring inside a java ee server like > tomcat? > > > Regards, > Rupesh > > > > Mar 23, 2009 6:26:21 PM org.apache.tuscany.sca.host.webapp.WebAppServletHost > initContextPath > INFO: ContextPath: /WebScaTest > Mar 23, 2009 6:26:21 PM org.apache.tuscany.sca.node.impl.NodeImpl <init> > INFO: Creating node: null > Mar 23, 2009 6:26:23 PM org.apache.tuscany.sca.node.impl.NodeImpl > configureNode > INFO: Loading contribution: > file:/D:/WORKSPACES/harish-sca/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/WebScaTest/ > Mar 23, 2009 6:26:24 PM > org.apache.tuscany.sca.implementation.spring.SpringImplementationProcessor > SEVERE: ContributionResolveException occured due to: > Mar 23, 2009 6:26:24 PM org.apache.catalina.core.StandardWrapperValve invoke > SEVERE: Servlet.service() for servlet jsp threw exception > org.apache.tuscany.sca.contribution.service.ContributionReadException: > SpringXMLLoader getApplicationContextResource: unable to find resource file > budget-spring-context.xml > at > org.apache.tuscany.sca.implementation.spring.xml.SpringXMLComponentTypeLoader.getApplicationContextResource(SpringXMLComponentTypeLoader.java:523) > at > org.apache.tuscany.sca.implementation.spring.xml.SpringXMLComponentTypeLoader.loadFromXML(SpringXMLComponentTypeLoader.java:133) > at > org.apache.tuscany.sca.implementation.spring.xml.SpringXMLComponentTypeLoader.load(SpringXMLComponentTypeLoader.java:104) > at > org.apache.tuscany.sca.implementation.spring.SpringImplementationProcessor.resolve(SpringImplementationProcessor.java:199) > at > org.apache.tuscany.sca.implementation.spring.SpringImplementationProcessor.resolve(SpringImplementationProcessor.java:53) > at > org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint$LazyStAXArtifactProcessor.resolve(DefaultStAXArtifactProcessorExtensionPoint.java:384) > at > org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.resolve(ExtensibleStAXArtifactProcessor.java:183) > at > org.apache.tuscany.sca.assembly.xml.BaseAssemblyProcessor.resolveImplementation(BaseAssemblyProcessor.java:325) > at > org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(CompositeProcessor.java:1018) > at > org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(CompositeProcessor.java:88) > at > org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint$LazyStAXArtifactProcessor.resolve(DefaultStAXArtifactProcessorExtensionPoint.java:384) > at > org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.resolve(ExtensibleStAXArtifactProcessor.java:183) > at > org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolve(CompositeDocumentProcessor.java:194) > at > org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolve(CompositeDocumentProcessor.java:57) > at > org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.resolve(ExtensibleURLArtifactProcessor.java:106) > at > org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processResolvePhase(ContributionServiceImpl.java:569) > at > org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution(ContributionServiceImpl.java:396) > at > org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute(ContributionServiceImpl.java:189) > at > org.apache.tuscany.sca.node.impl.NodeImpl.configureNode(NodeImpl.java:496) > at > org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:344) > at > org.apache.tuscany.sca.node.impl.NodeFactoryImpl.createSCANode(NodeFactoryImpl.java:47) > at > org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.init(DefaultSCADomain.java:172) > at > org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(DefaultSCADomain.java:97) > at > org.apache.tuscany.sca.host.webapp.WebSCADomain.<init>(WebSCADomain.java:41) > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown > Source) > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown > Source) > at java.lang.reflect.Constructor.newInstance(Unknown Source) > at > org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:199) > at > org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.java:76) > at > org.apache.tuscany.sca.host.webapp.WebAppServletHost.init(WebAppServletHost.java:220) > at > org.apache.tuscany.sca.host.webapp.jsp.ReferenceTag.doEndTag(ReferenceTag.java:54) > at org.apache.jsp.budget_jsp._jspService(budget_jsp.java:70) > at > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > at > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393) > at > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584) > at > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) > at java.lang.Thread.run(Unknown Source) > > > > > DISCLAIMER: > > "The information in this e-mail and any attachment is intended only for the > person to whom it is addressed and may contain confidential and/or > privileged material. If you have received this e-mail in error, kindly > contact the sender and destroy all copies of the original communication. IBS > makes no warranty, express or implied, nor guarantees the accuracy, adequacy > or completeness of the information contained in this email or any attachment > and is not liable for any errors, defects, omissions, viruses or for > resultant loss or damage, if any, direct or indirect." > > > > > > > > -- > Thanks & Regards, > Ramkumar Ramalingam > > > > > > DISCLAIMER: > > "The information in this e-mail and any attachment is intended only for the > person to whom it is addressed and may contain confidential and/or > privileged material. If you have received this e-mail in error, kindly > contact the sender and destroy all copies of the original communication. IBS > makes no warranty, express or implied, nor guarantees the accuracy, adequacy > or completeness of the information contained in this email or any attachment > and is not liable for any errors, defects, omissions, viruses or for > resultant loss or damage, if any, direct or indirect." > > > > >
