users@jaxb.java.net

Strange problem with latest JAXB 2.0 release

From: Brian Pontarelli <brian_at_pontarelli.com>
Date: Wed, 29 Jun 2005 21:05:19 -0500

I'm getting this stack trace with the latest JAXB 2.0 release:

    [junit] java.lang.UnsupportedOperationException
    [junit] at
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.createTypeUnmarshaller(ClassBeanInfoImpl.java:199)
    [junit] at
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.link(ClassBeanInfoImpl.java:134)
    [junit] at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:240)
    [junit] at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:70)
    [junit] at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:50)
    [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
    [junit] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [junit] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [junit] at
javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
    [junit] at javax.xml.bind.ContextFinder.find(ContextFinder.java:368)
    [junit] at
javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:546)
    [junit] at
javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:493)
    [junit] at
com.inversoft.util.JAXBTools.unmarshal(JAXBTools.java:104)
    [junit] at
com.inversoft.iap.server.config.ServerConfigBuilder.build(ServerConfigBuilder.java:80)
    [junit] at
com.inversoft.iap.server.IAPServerTest.testReconnectSessionTransaction(IAPServerTest.java:598)
    [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
    [junit] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [junit] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Here's my beans and my XML document I'm trying to unmarshal:

Bean
------------------------------------------------------------------------------------------

package com.inversoft.iap.server.config.jaxb;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.AccessType;

import com.inversoft.iap.server.config.ServerConfigDefaults;

@XmlRootElement(name = "server")
@XmlAccessorType(AccessType.FIELD)
public class ServerBind {
    protected List<ApplicationBind> application = new
ArrayList<ApplicationBind>();
    protected DefaultApplicationBind defaultApplication;
    @XmlAttribute() protected String listenAddress;
    @XmlAttribute(required = true) protected String name;
    @XmlAttribute(required = true) protected int port;
    @XmlAttribute() protected Integer executeThreads;
    @XmlAttribute() protected Integer queueSize;
    @XmlAttribute() protected Integer selectTimeout;
    @XmlAttribute() protected Integer timeout;

    // ... Getter and setters only
}

package com.inversoft.iap.server.config.jaxb;

import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.AccessType;

@XmlType(name = "application")
@XmlAccessorType(AccessType.FIELD)
public class ApplicationBind {
    @XmlAttribute(required = true) protected String location;

    // ... Getter and setters only
}



XML
------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>

<server name="test" port="8080" executeThreads="100" queueSize="10000"
timeout="30000000" selectTimeout="4">
  <application location="src/apps/test/test-app1"/>
</server>


Any ideas why this would be happening? I'll take a look at the code as
well and see if I can see anything.

-bp


P.S. I also have an Object factory that I can email out if needed.