You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Carlos Martins (JIRA)" <ji...@apache.org> on 2011/01/25 18:52:44 UTC

[jira] Created: (AXIS2-4940) java.util.List is not known to this context

java.util.List is not known to this context
-------------------------------------------

                 Key: AXIS2-4940
                 URL: https://issues.apache.org/jira/browse/AXIS2-4940
             Project: Axis2
          Issue Type: Bug
          Components: adb, Addressing, codegen, jaxws, kernel
    Affects Versions: 1.5.4
         Environment: IBM AIX; Java-1.6; Tomcat 6; Axis2 1.5.4
            Reporter: Carlos Martins


Calling a simple method which returns java.util.List<String> causes the server to throw the exception
javax.xml.bind.JAXBException: java.util.List is not known to this context.
I followed the issue [AXIS2-3736] and in fact created a small maven application with a simple webservice and axis2 1.5.4

package com.audaxys.lease.model.generic;

import java.util.ArrayList;
import java.util.List;

import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.ws.ResponseWrapper;

@WebService(name="AppleFinderService", serviceName="AppleFinderService", portName="Rpc", targetNamespace="http://com.audaxys.lease/")
public class AppleFinderImpl implements AppleFinder {

    @WebResult(name = "appleListReturn", targetNamespace = "http://com.audaxys.lease/")
    @ResponseWrapper(className = "com.audaxys.lease.model.generic.AppleListResponse" , localName="appleListResponse", targetNamespace="http://com.audaxys.lease/")
	public List<Apple> getAppleList(String appType) {
        List<Apple> apples = new ArrayList<Apple>();
        Apple a = new Apple();
        a.setAppleType("Red");
        apples.add(a);
        a = new Apple();
        a.setAppleType("Green");
        apples.add(a);
        return apples;
	}

    public Apple[] getAppleArray(String appType) {
        List<Apple> apples = new ArrayList<Apple>();
        Apple a = new Apple();
        a.setAppleType("Red");
        apples.add(a);
        a = new Apple();
        a.setAppleType("Green");
        apples.add(a);
        Apple[] appleArray = new Apple[apples.size()];
        int i=0; 
        for(Apple app : apples) {
        	appleArray[i++] = app;
        }
        return appleArray;
	}
    
    public String obtemUmaString() {
    	return "uma string";
    }

    public Apple loadApple(String appType) {
        Apple a = new Apple();
        a.setAppleType(appType);
        return a;
    }
    
    public List<String> getStringList(String str) {
    	List<String> l = new ArrayList<String>();
    	for(int i=0; i< 10; i++) {
    		l.add(str);
    	}
    	return l;
    }

    public String[] getStringArray(String str) {
    	String[] l = new String[10];
    	for(int i=0; i< 10; i++) {
    		l[i] = "Red";
    	}
    	return l;
    }

}


-- 
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: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4940) java.util.List is not known to this context

Posted by "Carlos Martins (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4940?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carlos Martins updated AXIS2-4940:
----------------------------------

    Attachment: wstest.zip

I attached a tiny file (wstest.zip) which is an eclipse maven project to demo this exception.
Just import to your eclipse workspace and enable maven dependency management.
There is a README file included to explain how to run and test.

> java.util.List is not known to this context
> -------------------------------------------
>
>                 Key: AXIS2-4940
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4940
>             Project: Axis2
>          Issue Type: Bug
>          Components: adb, Addressing, codegen, jaxws, kernel
>    Affects Versions: 1.5.4
>         Environment: IBM AIX; Java-1.6; Tomcat 6; Axis2 1.5.4
>            Reporter: Carlos Martins
>         Attachments: wstest.zip
>
>
> Calling a simple method which returns java.util.List<String> causes the server to throw the exception
> javax.xml.bind.JAXBException: java.util.List is not known to this context.
> I followed the issue *bold*[AXIS2-3736]*bold* and in fact created a small maven application with a simple webservice and axis2 1.5.4
> {code}
> package com.audaxys.lease.model.generic;
> import java.util.ArrayList;
> import java.util.List;
> import javax.jws.WebResult;
> import javax.jws.WebService;
> import javax.xml.ws.ResponseWrapper;
> @WebService(name="AppleFinderService", serviceName="AppleFinderService", portName="Rpc", targetNamespace="http://com.audaxys.lease/")
> public class AppleFinderImpl implements AppleFinder {
>     @WebResult(name = "appleListReturn", targetNamespace = "http://com.audaxys.lease/")
>     @ResponseWrapper(className = "com.audaxys.lease.model.generic.AppleListResponse" , localName="appleListResponse", targetNamespace="http://com.audaxys.lease/")
> 	public List<Apple> getAppleList(String appType) {
>         List<Apple> apples = new ArrayList<Apple>();
>         Apple a = new Apple();
>         a.setAppleType("Red");
>         apples.add(a);
>         a = new Apple();
>         a.setAppleType("Green");
>         apples.add(a);
>         return apples;
> 	}
>     public Apple[] getAppleArray(String appType) {
>         List<Apple> apples = new ArrayList<Apple>();
>         Apple a = new Apple();
>         a.setAppleType("Red");
>         apples.add(a);
>         a = new Apple();
>         a.setAppleType("Green");
>         apples.add(a);
>         Apple[] appleArray = new Apple[apples.size()];
>         int i=0; 
>         for(Apple app : apples) {
>         	appleArray[i++] = app;
>         }
>         return appleArray;
> 	}
>     
>     public String obtemUmaString() {
>     	return "uma string";
>     }
>     public Apple loadApple(String appType) {
>         Apple a = new Apple();
>         a.setAppleType(appType);
>         return a;
>     }
>     
>     public List<String> getStringList(String str) {
>     	List<String> l = new ArrayList<String>();
>     	for(int i=0; i< 10; i++) {
>     		l.add(str);
>     	}
>     	return l;
>     }
>     public String[] getStringArray(String str) {
>     	String[] l = new String[10];
>     	for(int i=0; i< 10; i++) {
>     		l[i] = "Red";
>     	}
>     	return l;
>     }
> }
> {code}

-- 
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: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4940) java.util.List is not known to this context

Posted by "Carlos Martins (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4940?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carlos Martins updated AXIS2-4940:
----------------------------------

    Description: 
Calling a simple method which returns java.util.List<String> causes the server to throw the exception
javax.xml.bind.JAXBException: java.util.List is not known to this context.
I followed the issue *bold*[AXIS2-3736]*bold* and in fact created a small maven application with a simple webservice and axis2 1.5.4

{code}
package com.audaxys.lease.model.generic;

import java.util.ArrayList;
import java.util.List;

import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.ws.ResponseWrapper;

@WebService(name="AppleFinderService", serviceName="AppleFinderService", portName="Rpc", targetNamespace="http://com.audaxys.lease/")
public class AppleFinderImpl implements AppleFinder {

    @WebResult(name = "appleListReturn", targetNamespace = "http://com.audaxys.lease/")
    @ResponseWrapper(className = "com.audaxys.lease.model.generic.AppleListResponse" , localName="appleListResponse", targetNamespace="http://com.audaxys.lease/")
	public List<Apple> getAppleList(String appType) {
        List<Apple> apples = new ArrayList<Apple>();
        Apple a = new Apple();
        a.setAppleType("Red");
        apples.add(a);
        a = new Apple();
        a.setAppleType("Green");
        apples.add(a);
        return apples;
	}

    public Apple[] getAppleArray(String appType) {
        List<Apple> apples = new ArrayList<Apple>();
        Apple a = new Apple();
        a.setAppleType("Red");
        apples.add(a);
        a = new Apple();
        a.setAppleType("Green");
        apples.add(a);
        Apple[] appleArray = new Apple[apples.size()];
        int i=0; 
        for(Apple app : apples) {
        	appleArray[i++] = app;
        }
        return appleArray;
	}
    
    public String obtemUmaString() {
    	return "uma string";
    }

    public Apple loadApple(String appType) {
        Apple a = new Apple();
        a.setAppleType(appType);
        return a;
    }
    
    public List<String> getStringList(String str) {
    	List<String> l = new ArrayList<String>();
    	for(int i=0; i< 10; i++) {
    		l.add(str);
    	}
    	return l;
    }

    public String[] getStringArray(String str) {
    	String[] l = new String[10];
    	for(int i=0; i< 10; i++) {
    		l[i] = "Red";
    	}
    	return l;
    }

}
{code}

  was:
Calling a simple method which returns java.util.List<String> causes the server to throw the exception
javax.xml.bind.JAXBException: java.util.List is not known to this context.
I followed the issue [AXIS2-3736] and in fact created a small maven application with a simple webservice and axis2 1.5.4

package com.audaxys.lease.model.generic;

import java.util.ArrayList;
import java.util.List;

import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.ws.ResponseWrapper;

@WebService(name="AppleFinderService", serviceName="AppleFinderService", portName="Rpc", targetNamespace="http://com.audaxys.lease/")
public class AppleFinderImpl implements AppleFinder {

    @WebResult(name = "appleListReturn", targetNamespace = "http://com.audaxys.lease/")
    @ResponseWrapper(className = "com.audaxys.lease.model.generic.AppleListResponse" , localName="appleListResponse", targetNamespace="http://com.audaxys.lease/")
	public List<Apple> getAppleList(String appType) {
        List<Apple> apples = new ArrayList<Apple>();
        Apple a = new Apple();
        a.setAppleType("Red");
        apples.add(a);
        a = new Apple();
        a.setAppleType("Green");
        apples.add(a);
        return apples;
	}

    public Apple[] getAppleArray(String appType) {
        List<Apple> apples = new ArrayList<Apple>();
        Apple a = new Apple();
        a.setAppleType("Red");
        apples.add(a);
        a = new Apple();
        a.setAppleType("Green");
        apples.add(a);
        Apple[] appleArray = new Apple[apples.size()];
        int i=0; 
        for(Apple app : apples) {
        	appleArray[i++] = app;
        }
        return appleArray;
	}
    
    public String obtemUmaString() {
    	return "uma string";
    }

    public Apple loadApple(String appType) {
        Apple a = new Apple();
        a.setAppleType(appType);
        return a;
    }
    
    public List<String> getStringList(String str) {
    	List<String> l = new ArrayList<String>();
    	for(int i=0; i< 10; i++) {
    		l.add(str);
    	}
    	return l;
    }

    public String[] getStringArray(String str) {
    	String[] l = new String[10];
    	for(int i=0; i< 10; i++) {
    		l[i] = "Red";
    	}
    	return l;
    }

}



> java.util.List is not known to this context
> -------------------------------------------
>
>                 Key: AXIS2-4940
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4940
>             Project: Axis2
>          Issue Type: Bug
>          Components: adb, Addressing, codegen, jaxws, kernel
>    Affects Versions: 1.5.4
>         Environment: IBM AIX; Java-1.6; Tomcat 6; Axis2 1.5.4
>            Reporter: Carlos Martins
>
> Calling a simple method which returns java.util.List<String> causes the server to throw the exception
> javax.xml.bind.JAXBException: java.util.List is not known to this context.
> I followed the issue *bold*[AXIS2-3736]*bold* and in fact created a small maven application with a simple webservice and axis2 1.5.4
> {code}
> package com.audaxys.lease.model.generic;
> import java.util.ArrayList;
> import java.util.List;
> import javax.jws.WebResult;
> import javax.jws.WebService;
> import javax.xml.ws.ResponseWrapper;
> @WebService(name="AppleFinderService", serviceName="AppleFinderService", portName="Rpc", targetNamespace="http://com.audaxys.lease/")
> public class AppleFinderImpl implements AppleFinder {
>     @WebResult(name = "appleListReturn", targetNamespace = "http://com.audaxys.lease/")
>     @ResponseWrapper(className = "com.audaxys.lease.model.generic.AppleListResponse" , localName="appleListResponse", targetNamespace="http://com.audaxys.lease/")
> 	public List<Apple> getAppleList(String appType) {
>         List<Apple> apples = new ArrayList<Apple>();
>         Apple a = new Apple();
>         a.setAppleType("Red");
>         apples.add(a);
>         a = new Apple();
>         a.setAppleType("Green");
>         apples.add(a);
>         return apples;
> 	}
>     public Apple[] getAppleArray(String appType) {
>         List<Apple> apples = new ArrayList<Apple>();
>         Apple a = new Apple();
>         a.setAppleType("Red");
>         apples.add(a);
>         a = new Apple();
>         a.setAppleType("Green");
>         apples.add(a);
>         Apple[] appleArray = new Apple[apples.size()];
>         int i=0; 
>         for(Apple app : apples) {
>         	appleArray[i++] = app;
>         }
>         return appleArray;
> 	}
>     
>     public String obtemUmaString() {
>     	return "uma string";
>     }
>     public Apple loadApple(String appType) {
>         Apple a = new Apple();
>         a.setAppleType(appType);
>         return a;
>     }
>     
>     public List<String> getStringList(String str) {
>     	List<String> l = new ArrayList<String>();
>     	for(int i=0; i< 10; i++) {
>     		l.add(str);
>     	}
>     	return l;
>     }
>     public String[] getStringArray(String str) {
>     	String[] l = new String[10];
>     	for(int i=0; i< 10; i++) {
>     		l[i] = "Red";
>     	}
>     	return l;
>     }
> }
> {code}

-- 
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: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org