You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "ant elder (JIRA)" <de...@tuscany.apache.org> on 2008/12/01 11:14:44 UTC

[jira] Commented: (TUSCANY-2681) When a Component class implements an interfaces that extends other interface and use generics occur the error

    [ https://issues.apache.org/jira/browse/TUSCANY-2681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651958#action_12651958 ] 

ant elder commented on TUSCANY-2681:
------------------------------------

Thanks for the updated fix Rodolfo, its its looking good but I've come across one more situation that needs to also be dealt with which is array types. Would you be interested in extending this fix to cover that situation?

There are some tests for these in the Tuscany itest\databindings\jaxb-bottom-up which with this fix applied are now failing in the JavaInterfaceUtil.getGenericType with an UnsupportedOperationException.

The testcase is at: https://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/itest/databindings/jaxb-bottom-up/  

The stack trace for one of the failures is:

  <testcase time="0" name="testSCATypeExplicit">
    <error type="java.lang.UnsupportedOperationException">java.lang.UnsupportedOperationException
	at org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil.getGenericType(JavaInterfaceUtil.java:126)
	at org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil.getPhysicalTypes(JavaInterfaceUtil.java:107)
	at org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil.findMethod(JavaInterfaceUtil.java:86)
	at org.apache.tuscany.sca.implementation.java.invocation.JavaComponentContextProvider.createInvoker(JavaComponentContextProvider.java:319)
	at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationProvider.createInvoker(JavaImplementationProvider.java:149)
	at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.addImplementationInterceptor(RuntimeWireImpl.java:400)
	at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationChains(RuntimeWireImpl.java:214)
	at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChains(RuntimeWireImpl.java:115)
	at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChain(RuntimeWireImpl.java:135)
	at org.apache.tuscany.sca.core.assembly.RuntimeComponentServiceImpl.getInvocationChain(RuntimeComponentServiceImpl.java:125)
	at org.apache.tuscany.sca.binding.sca.impl.RuntimeSCAReferenceBindingProvider.getInvoker(RuntimeSCAReferenceBindingProvider.java:184)
	at org.apache.tuscany.sca.binding.sca.impl.RuntimeSCAReferenceBindingProvider.createInvoker(RuntimeSCAReferenceBindingProvider.java:197)
	at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.addReferenceBindingInterceptor(RuntimeWireImpl.java:313)
	at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationChains(RuntimeWireImpl.java:191)
	at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChains(RuntimeWireImpl.java:115)
	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.getInvocationChain(JDKInvocationHandler.java:243)
	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:148)
	at $Proxy36.getTypeExplicitForward(Unknown Source)
	at org.apache.tuscany.sca.itest.databindings.jaxb.GenericsDatabindingTestCase.performTestTypeExplicit(GenericsDatabindingTestCase.java:305)
	at org.apache.tuscany.sca.itest.databindings.jaxb.GenericsDatabindingTestCase.testSCATypeExplicit(GenericsDatabindingTestCase.java:65)



> When a Component class implements an interfaces that extends other interface and use generics occur the error
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-2681
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2681
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Java Implementation Extension
>    Affects Versions: Java-SCA-1.3.2
>         Environment: SO: Ubuntu 8.04
> Java: BEA JRockit(R) JRE 5.0 Update 11 R27.3.1
>            Reporter: Rodolfo Dias
>            Priority: Critical
>             Fix For: Java-SCA-Next
>
>         Attachments: JavaInterfaceUtil.java, testcase.jar, tuscany-interface-java-1.3.2-JIRA-2681-src.zip, tuscany-interface-java-1.3.2-JIRA-2681.jar
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Hi,
>   When a Component class implements an interfaces that extends other interface and use generics occur the error:
> Nov 19, 2008 11:12:09 PM org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuilderImpl
> WARNING: Incompatible interfaces on wire source and target : source = GenericServiceComponent/fiscalYearBO target = FiscalYearBO
> Nov 19, 2008 11:12:10 PM org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuilderImpl
> WARNING: No targets for reference: Composite = {http://utrafe}GenericService Reference = fiscalYearBO
> And not inject de class implementation
> java.lang.NullPointerException
> 	at com.test.service.GenericService.print(GenericService.java:18)
> Java Interfaces:
> public interface IGenericBO<T, ID> {
> 	T persist(T any, List<ID> id); 
> }
> public interface IFiscalYearBO extends IGenericBO<String, Long> {
> }
> Implementation class:
> public abstract class GenericBOImpl<T, ID> implements IGenericBO<T, ID> {
> 	private T x;
> 	
> 	
> 	public T persist(T any, List<ID> id) {
> 		x = any;
> 		System.out.println(id);
> 		System.out.println("Brazil " + x);
> 		return x;
> 	}
> }
> public class FiscalYearBO extends
> 		GenericBOImpl<String, Long> implements
> 		IFiscalYearBO {
> }
> I fixed the problem alter the JavaInterfaceIntrospectorImpl, but i have other error and alter the JavaInterfaceUtil code too.
> I put the patch and testcase.
> Sorry my english :(.
>  	

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (TUSCANY-2681) When a Component class implements an interfaces that extends other interface and use generics occur the error

Posted by Rodolfo Dias <di...@gmail.com>.
Hi

  Yes, i can extend this fix to cover array types. I think in revised all
generics access in SCA API and posting my observation about this.

Rodolfo Dias.
dias.rodolfo@gmail.com
dias.sca@gmail.com (Tuscany Project only)

2008/12/1 ant elder (JIRA) <de...@tuscany.apache.org>

>
>    [
> https://issues.apache.org/jira/browse/TUSCANY-2681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651958#action_12651958]
>
> ant elder commented on TUSCANY-2681:
> ------------------------------------
>
> Thanks for the updated fix Rodolfo, its its looking good but I've come
> across one more situation that needs to also be dealt with which is array
> types. Would you be interested in extending this fix to cover that
> situation?
>
> There are some tests for these in the Tuscany
> itest\databindings\jaxb-bottom-up which with this fix applied are now
> failing in the JavaInterfaceUtil.getGenericType with an
> UnsupportedOperationException.
>
> The testcase is at:
> https://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/itest/databindings/jaxb-bottom-up/
>
> The stack trace for one of the failures is:
>
>  <testcase time="0" name="testSCATypeExplicit">
>    <error
> type="java.lang.UnsupportedOperationException">java.lang.UnsupportedOperationException
>        at
> org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil.getGenericType(JavaInterfaceUtil.java:126)
>        at
> org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil.getPhysicalTypes(JavaInterfaceUtil.java:107)
>        at
> org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil.findMethod(JavaInterfaceUtil.java:86)
>        at
> org.apache.tuscany.sca.implementation.java.invocation.JavaComponentContextProvider.createInvoker(JavaComponentContextProvider.java:319)
>        at
> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationProvider.createInvoker(JavaImplementationProvider.java:149)
>        at
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.addImplementationInterceptor(RuntimeWireImpl.java:400)
>        at
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationChains(RuntimeWireImpl.java:214)
>        at
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChains(RuntimeWireImpl.java:115)
>        at
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChain(RuntimeWireImpl.java:135)
>        at
> org.apache.tuscany.sca.core.assembly.RuntimeComponentServiceImpl.getInvocationChain(RuntimeComponentServiceImpl.java:125)
>        at
> org.apache.tuscany.sca.binding.sca.impl.RuntimeSCAReferenceBindingProvider.getInvoker(RuntimeSCAReferenceBindingProvider.java:184)
>        at
> org.apache.tuscany.sca.binding.sca.impl.RuntimeSCAReferenceBindingProvider.createInvoker(RuntimeSCAReferenceBindingProvider.java:197)
>        at
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.addReferenceBindingInterceptor(RuntimeWireImpl.java:313)
>        at
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationChains(RuntimeWireImpl.java:191)
>        at
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChains(RuntimeWireImpl.java:115)
>        at
> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.getInvocationChain(JDKInvocationHandler.java:243)
>        at
> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:148)
>        at $Proxy36.getTypeExplicitForward(Unknown Source)
>        at
> org.apache.tuscany.sca.itest.databindings.jaxb.GenericsDatabindingTestCase.performTestTypeExplicit(GenericsDatabindingTestCase.java:305)
>        at
> org.apache.tuscany.sca.itest.databindings.jaxb.GenericsDatabindingTestCase.testSCATypeExplicit(GenericsDatabindingTestCase.java:65)
>
>
>
> > When a Component class implements an interfaces that extends other
> interface and use generics occur the error
> >
> -------------------------------------------------------------------------------------------------------------
> >
> >                 Key: TUSCANY-2681
> >                 URL: https://issues.apache.org/jira/browse/TUSCANY-2681
> >             Project: Tuscany
> >          Issue Type: Bug
> >          Components: Java SCA Java Implementation Extension
> >    Affects Versions: Java-SCA-1.3.2
> >         Environment: SO: Ubuntu 8.04
> > Java: BEA JRockit(R) JRE 5.0 Update 11 R27.3.1
> >            Reporter: Rodolfo Dias
> >            Priority: Critical
> >             Fix For: Java-SCA-Next
> >
> >         Attachments: JavaInterfaceUtil.java, testcase.jar,
> tuscany-interface-java-1.3.2-JIRA-2681-src.zip,
> tuscany-interface-java-1.3.2-JIRA-2681.jar
> >
> >   Original Estimate: 4h
> >  Remaining Estimate: 4h
> >
> > Hi,
> >   When a Component class implements an interfaces that extends other
> interface and use generics occur the error:
> > Nov 19, 2008 11:12:09 PM
> org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuilderImpl
> > WARNING: Incompatible interfaces on wire source and target : source =
> GenericServiceComponent/fiscalYearBO target = FiscalYearBO
> > Nov 19, 2008 11:12:10 PM
> org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuilderImpl
> > WARNING: No targets for reference: Composite = {http://utrafe}GenericService
> Reference = fiscalYearBO
> > And not inject de class implementation
> > java.lang.NullPointerException
> >       at com.test.service.GenericService.print(GenericService.java:18)
> > Java Interfaces:
> > public interface IGenericBO<T, ID> {
> >       T persist(T any, List<ID> id);
> > }
> > public interface IFiscalYearBO extends IGenericBO<String, Long> {
> > }
> > Implementation class:
> > public abstract class GenericBOImpl<T, ID> implements IGenericBO<T, ID> {
> >       private T x;
> >
> >
> >       public T persist(T any, List<ID> id) {
> >               x = any;
> >               System.out.println(id);
> >               System.out.println("Brazil " + x);
> >               return x;
> >       }
> > }
> > public class FiscalYearBO extends
> >               GenericBOImpl<String, Long> implements
> >               IFiscalYearBO {
> > }
> > I fixed the problem alter the JavaInterfaceIntrospectorImpl, but i have
> other error and alter the JavaInterfaceUtil code too.
> > I put the patch and testcase.
> > Sorry my english :(.
> >
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>