axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Detelin Yordanov (JIRA)" <>
Subject [jira] Created: (AXIS2-3798) "Unbound namespace URI" Exception while serializing ADBBean
Date Wed, 14 May 2008 09:37:55 GMT
"Unbound namespace URI" Exception while serializing ADBBean

                 Key: AXIS2-3798
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: codegen
    Affects Versions: 1.3, 1.4
         Environment: Axis2 1.3/1.4, Tomcat 5.5.26
            Reporter: Detelin Yordanov

I have a simple POJO service with the following method:

package org.tempuri.test;

public class TypeTest {
    public ArrayOfstring retArrayOfstring(ArrayOfstring inString) {
        return inString;

The ArrayOfstringis declared like this:


public class ArrayOfstring {

    protected String[] string;

    public String[] getString() {
        if (string == null) {
            string = new String[0];
        return this.string;

    public void setString(String[] string) {
        this.string = string;

I deploy this POJO on an Axis2 1.3/1.4 (both have the issue) runtime running on Tomcat.
Then I generate a client stub using the following command:

wsdl2java -ap -o ./generated -s -u -uw -uri http://localhost:8080/axis2-1.4/services/TypeTest?wsdl

I use the stub to invoke the service passing an array of strings that contains a null element

(this is important since without it I do not get the exception):

ArrayOfstring input = new ArrayOfstring();
input.setString(new String[]{"Abracadabra", null, "abc"});

While serializing the ArrayOfstring ADBBean I get an "Unbound namespace URI ''"

Caused by: Unbound namespace URI ''
	at com.ctc.wstx.sw.SimpleNsStreamWriter.writeStartOrEmpty(
	at com.ctc.wstx.sw.BaseNsStreamWriter.writeStartElement(
	at org.apache.axis2.databinding.utils.writer.MTOMAwareXMLSerializer.writeStartElement(
	at org.tempuri.test.RetArrayOfstring.serialize(
	at org.tempuri.test.RetArrayOfstring.serialize(
	at org.tempuri.test.RetArrayOfstring$1.serialize(

As far as I could investigate this, the problem seems to be that the first non-null element
uses the "prefix2" variable when registering the namespace
leavin "prefix" uninitialized, the null element that follows uses just "prefix" generating
a new value for it and setting it on the current element.

The third non-null string element checks whether "prefix" is not null and since it is not
(because it has been initialized by the null element handling),
assumes that the prefix and its namespace have already been registered on this element while
they have not been.

This is just an assumption, I might be wrong about it, however I found out that this is fixed
easily by manually adding the following line:
in the serialize(..) method:
for (int i = 0;i < localString.length;i++){                                  
   if (localString[i] != null){                               
       if (!emptyNamespace) {
           prefix = xmlWriter.getPrefix(namespace); //MANUALLY ADDED LINE
               if (prefix == null) {

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:
For additional commands, e-mail:

View raw message