[ https://issues.apache.org/jira/browse/TUSCANY-1312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520760 ]
Jean-Sebastien Delfino commented on TUSCANY-1312: ------------------------------------------------- Using implementation classes instead of interfaces is allowed by the SCA spec. This is actually a very important scenario to support in SCA, where you start with existing Java classes which did not implement an interface, and want to use them as SCA component implementations without having to change them or create another wrapper class around them. This is now working in Tuscany thanks to the contribution of a new CGLib based proxy factory. I just verified that it works and am therefore marking the issue resolved. > Can not expose Java Implementation class as a service > ----------------------------------------------------- > > Key: TUSCANY-1312 > URL: https://issues.apache.org/jira/browse/TUSCANY-1312 > Project: Tuscany > Issue Type: Bug > Components: Java SCA Java Implementation Extension > Affects Versions: Java-SCA-Next > Environment: Ubuntu7.04+IBM JDK5+Eclipse3.2.2 > Reporter: Zhenghui Lee > Fix For: Java-SCA-Next > > > In SCA_javaComponentImplementation_v100 spec, It is saying that a service's > interface can be defined by a java class(as opposed to a java interface), I > gave try on it, run into following exception, seems that current runtime > behavior only allow service defined by interface now. > org.osoa.sca.ServiceRuntimeException: org.osoa.sca.ServiceRuntimeException: > org.apache.tuscany.sca.contribution.service.ContributionResolveException: > org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidServiceType: > Service must be an interface > at > org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:263) > at > org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.java:68) > at > tuscany.sample.sync.customer.CustomerImplTest.setUp(CustomerImplTest.java:17) > at junit.framework.TestCase.runBare(TestCase.java:132) > at junit.framework.TestResult$1.protect(TestResult.java:110) > at junit.framework.TestResult.runProtected(TestResult.java:128) > at junit.framework.TestResult.run(TestResult.java:113) > at junit.framework.TestCase.run(TestCase.java:124) > at junit.framework.TestSuite.runTest(TestSuite.java:232) > at junit.framework.TestSuite.run(TestSuite.java:227) > at > org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35) > at > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) > at > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) > Caused by: org.osoa.sca.ServiceRuntimeException: > org.apache.tuscany.sca.contribution.service.ContributionResolveException: > org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidServiceType: > Service must be an interface > at > org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(DefaultSCADomain.java:106) > at > org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:230) > ... 16 more > Caused by: > org.apache.tuscany.sca.contribution.service.ContributionResolveException: > org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidServiceType: > Service must be an interface > at > org.apache.tuscany.sca.implementation.java.xml.JavaImplementationProcessor.resolve(JavaImplementationProcessor.java:121) > at > org.apache.tuscany.sca.implementation.java.xml.JavaImplementationProcessor.resolve(JavaImplementationProcessor.java:1) > at > org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.resolve(ExtensibleStAXArtifactProcessor.java:102) > at > org.apache.tuscany.sca.assembly.xml.BaseArtifactProcessor.resolveImplementation(BaseArtifactProcessor.java:387) > at > org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(CompositeProcessor.java:466) > at > org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(CompositeProcessor.java:1) > at > org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.resolve(ExtensibleStAXArtifactProcessor.java:102) > at > org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolve(CompositeDocumentProcessor.java:83) > at > org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolve(CompositeDocumentProcessor.java:1) > at > org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.resolve(ExtensibleURLArtifactProcessor.java:73) > at > org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processResolvePhase(ContributionServiceImpl.java:317) > at > org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution(ContributionServiceImpl.java:254) > at > org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute(ContributionServiceImpl.java:119) > at > org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(DefaultSCADomain.java:104) > ... 17 more > Caused by: > org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidServiceType: > Service must be an interface > at > org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceProcessor.visitClass(ServiceProcessor.java:87) > at > org.apache.tuscany.sca.implementation.java.introspect.ExtensibleJavaClassIntrospector.introspect(ExtensibleJavaClassIntrospector.java:72) > at > org.apache.tuscany.sca.implementation.java.xml.JavaImplementationProcessor.resolve(JavaImplementationProcessor.java:119) > ... 30 more -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]