2

JAXB-RI から moxy への移行に苦労しています。

注釈のほとんどを移行しました (RI と Moxy の間で動作に大きな違いがいくつかありました) が、今は奇妙な例外に苦しんでいます。既存のアプリケーション内で実行されるこの単純なケースに絞り込みました。

@XmlRootElement(name="StringMap")
public class StringMap extends StringMapBase  
{
}

@XmlTransient
class StringMapBase extends HashMap<String,String>
{

}

StringMap は、シリアル化しようとしているクラスです。これは、Glassfish でのデプロイに失敗します。StringMapBase を変更するとすぐに、HashMap を拡張しないため、デプロイは問題ありません。StringMapBase が ArrayList を拡張すると、同じエラーが発生します。

moxy バージョンは :- 実装バージョン: 2.3.2.v20111125-r10461

GlassFish のバージョンは :- 3.1.2.2-5 です。これは、新規インストールではなく、3.1-43 から GlassFish アップグレード ツールを使用してアップグレードされました (顧客が経験するプロセスを再現する必要があるため、新規インストールはできません)。

moxy に対するバグとして提起する前に、他に試してみることができる明らかなことはありますか? 私はここ数日間、この壁に頭をぶつけてきましたが、これが機能しない場合は、すべての変更を解明して JAXB-RI に戻る必要があります!

よろしくお願いします。オーウェン

===== 例外

[#|2013-04-08T11:58:30.805+0100|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=24;_ThreadName=Thread-2;|javax.xml.bind.JAXBException
 - with linked exception:
[java.lang.reflect.MalformedParameterizedTypeException]
    at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:832)
    at org.eclipse.persistence.jaxb.JAXBContext.<init>(JAXBContext.java:143)
    at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:142)
    at com.sun.xml.ws.db.toplink.JAXBContextFactory.newContext(JAXBContextFactory.java:180)
    at com.sun.xml.ws.spi.db.BindingContextFactory.create(BindingContextFactory.java:191)
    at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:213)
    at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:186)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:186)
    at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:111)
    at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:318)
    at com.sun.xml.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:99)
    at com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:74)
    at com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:58)
    at com.sun.xml.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:130)
    at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:433)
    at com.sun.xml.ws.server.EndpointFactory.create(EndpointFactory.java:268)
    at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:145)
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:569)
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:552)
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:623)
    at org.glassfish.webservices.WSServletContextListener.registerEndpoint(WSServletContextListener.java:282)
    at org.glassfish.webservices.WSServletContextListener.contextInitialized(WSServletContextListener.java:102)
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4750)
    at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:550)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:5366)
    at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
    at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
    at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
    at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
    at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.reflect.MalformedParameterizedTypeException
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:42)
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:35)
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:77)
    at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:86)
    at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:122)
    at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
    at sun.reflect.generics.repository.FieldRepository.getGenericType(FieldRepository.java:67)
    at java.lang.reflect.Field.getGenericType(Field.java:223)
    at org.eclipse.persistence.jaxb.javamodel.reflection.JavaFieldImpl.getResolvedType(JavaFieldImpl.java:96)
    at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.getFieldPropertiesForClass(AnnotationsProcessor.java:1654)
    at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.getFieldPropertiesForClass(AnnotationsProcessor.java:1637)
    at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.getPublicMemberPropertiesForClass(AnnotationsProcessor.java:2662)
    at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.getPropertiesForClass(AnnotationsProcessor.java:1629)
    at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildTypeInfo(AnnotationsProcessor.java:683)
    at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.postBuildTypeInfo(AnnotationsProcessor.java:597)
    at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processClassesAndProperties(AnnotationsProcessor.java:234)
    at org.eclipse.persistence.jaxb.compiler.Generator.<init>(Generator.java:147)
    at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:829)
    ... 64 more
|#]

[#|2013-04-08T11:58:30.805+0100|WARNING|glassfish3.1.2|javax.enterprise.webservices.org.glassfish.webservices|_ThreadID=24;_ThreadName=Thread-2;|Deployment failed
com.sun.xml.ws.spi.db.DatabindingException
    at com.sun.xml.ws.db.toplink.JAXBContextFactory.newContext(JAXBContextFactory.java:185)
    at com.sun.xml.ws.spi.db.BindingContextFactory.create(BindingContextFactory.java:191)
    at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:213)
    at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:186)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:186)
    at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:111)
    at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:318)
    at com.sun.xml.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:99)
    at com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:74)
    at com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:58)
    at com.sun.xml.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:130)
    at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:433)
    at com.sun.xml.ws.server.EndpointFactory.create(EndpointFactory.java:268)
    at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:145)
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:569)
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:552)
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:623)
    at org.glassfish.webservices.WSServletContextListener.registerEndpoint(WSServletContextListener.java:282)
    at org.glassfish.webservices.WSServletContextListener.contextInitialized(WSServletContextListener.java:102)
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4750)
    at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:550)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:5366)
    at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
    at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
    at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
    at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
    at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:662)
Caused by: javax.xml.bind.JAXBException
 - with linked exception:
[java.lang.reflect.MalformedParameterizedTypeException]
    at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:832)
    at org.eclipse.persistence.jaxb.JAXBContext.<init>(JAXBContext.java:143)
    at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:142)
    at com.sun.xml.ws.db.toplink.JAXBContextFactory.newContext(JAXBContextFactory.java:180)
    ... 61 more
Caused by: java.lang.reflect.MalformedParameterizedTypeException
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:42)
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:35)
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:77)
    at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:86)
    at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:122)
    at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
    at sun.reflect.generics.repository.FieldRepository.getGenericType(FieldRepository.java:67)
    at java.lang.reflect.Field.getGenericType(Field.java:223)
    at org.eclipse.persistence.jaxb.javamodel.reflection.JavaFieldImpl.getResolvedType(JavaFieldImpl.java:96)
    at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.getFieldPropertiesForClass(AnnotationsProcessor.java:1654)
    at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.getFieldPropertiesForClass(AnnotationsProcessor.java:1637)
    at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.getPublicMemberPropertiesForClass(AnnotationsProcessor.java:2662)
    at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.getPropertiesForClass(AnnotationsProcessor.java:1629)
    at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildTypeInfo(AnnotationsProcessor.java:683)
    at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.postBuildTypeInfo(AnnotationsProcessor.java:597)
    at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processClassesAndProperties(AnnotationsProcessor.java:234)
    at org.eclipse.persistence.jaxb.compiler.Generator.<init>(Generator.java:147)
    at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:829)
    ... 64 more
|#]

[#|2013-04-08T11:58:31.148+0100|SEVERE|glassfish3.1.2|org.apache.catalina.core.StandardContext|_ThreadID=24;_ThreadName=Thread-2;|PWC1306: Startup of context /WebServices failed due to previous errors|#]
4

1 に答える 1