This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 180937 - "WARNING: duplicate class definition bug occured? Please report this :"
Summary: "WARNING: duplicate class definition bug occured? Please report this :"
Status: RESOLVED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: JAXB (show other bugs)
Version: 6.x
Hardware: Macintosh (x86) Mac OS X
: P3 normal with 1 vote (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-18 16:16 UTC by tom_fisher
Modified: 2013-08-28 12:23 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tom_fisher 2010-02-18 16:16:33 UTC
I am running a NetBeans (6.8) webservice in a GlassFish (3) container.  It is the GlassFish version that is distributed with Netbens and run from within NetBeans.  My web service app compiles fine, buy when GlassFish fires up and tries to run the webservice, a throw shows up in the GlassFish output console. Note that the webservice appears to be available after GF finishes its startup, in spite of the exceptions.  The following is one of the throws:

WARNING: duplicate class definition bug occured? Please report this : com/paceap/services/api/ilokremote2/schema/LicenseBaseArrayType$JaxbAccessorM_getLicense_setLicense_[Lcom_paceap_services_api_ilokremote2_schema_LicenseBaseType;
java.lang.ClassFormatError: Illegal class name "com/paceap/services/api/ilokremote2/schema/LicenseBaseArrayType$JaxbAccessorM_getLicense_setLicense_[Lcom_paceap_services_api_ilokremote2_schema_LicenseBaseType;" in class file com/paceap/services/api/ilokremote2/schema/LicenseBaseArrayType$JaxbAccessorM_getLicense_setLicense_[Lcom_paceap_services_api_ilokremote2_schema_LicenseBaseType;
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:698)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:544)
        at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.inject(Injector.java:205)
        at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.inject(Injector.java:85)
        at com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:89)
        at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:114)
        at com.sun.xml.bind.v2.runtime.reflect.Accessor$GetterSetterReflection.optimize(Accessor.java:369)
        at com.sun.xml.bind.v2.runtime.property.ArrayProperty.<init>(ArrayProperty.java:65)
        at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.<init>(ArrayERProperty.java:84)
        at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:96)
        at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:58)
        at sun.reflect.GeneratedConstructorAccessor51.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:179)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:515)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:534)
        at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:101)
        at sun.reflect.GeneratedConstructorAccessor50.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:179)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:515)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:534)
        at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:108)
        at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:58)
        at sun.reflect.GeneratedConstructorAccessor51.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:179)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:515)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:534)
        at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:101)
        at sun.reflect.GeneratedConstructorAccessor50.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:179)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:515)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:330)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
        at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:106)
        at com.sun.xml.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:109)
        at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:161)
        at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:154)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:153)
        at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:94)
        at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:258)
        at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:338)
        at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:201)
        at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:505)
        at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:560)
        at org.glassfish.webservices.EjbRuntimeEndpointInfo.prepareInvocation(EjbRuntimeEndpointInfo.java:277)
        at org.glassfish.webservices.EjbRuntimeEndpointInfo.initRuntimeInfo(EjbRuntimeEndpointInfo.java:357)
        at org.glassfish.webservices.WebServiceEjbEndpointRegistry.registerEndpoint(WebServiceEjbEndpointRegistry.java:128)
        at com.sun.ejb.containers.BaseContainer.initializeHome(BaseContainer.java:1160)
        at com.sun.ejb.containers.StatelessSessionContainer.initializeHome(StatelessSessionContainer.java:197)
        at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:161)
        at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:207)
        at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:197)
        at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:63)
        at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:175)
        at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:216)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:338)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
        at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
        at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
        at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
        at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
        at java.lang.Thread.run(Thread.java:637)
Comment 1 zemu 2010-08-10 12:38:35 UTC
I had the same problem deploying a web service on a tomcat 6.0.18 with netbeans 6.8. Strange thing is that I successfuylly deployed the web service several times, then changed another thing I would have thought had no connection, and the web service refused to deploy, with a similar error. Although I have not the stacktrace here, it looked like :

WARNING: duplicate class definition bug occured? Please report this :
...
java.lang.ClassFormatError: Illegal class name
...

It was complaining about a setter method taking an array of customized beans as parameter. I bypassed the problem by replacing "MyBeans[]" with "List<MyBeans>" in my class/method.
Comment 2 Java4Me 2010-08-10 17:07:48 UTC
The problem can be recreated by using an array of String objects in a web service. The bug is in JAX-WS, not NetBeans, and the bug has already been fixed in JAX-WS. However, the latest version of NetBeans (6.9.1) was not deployed with the latest version of JAX-WS (2.2.1).

The URL for the JAX-WS Bug #813 is: https://jax-ws.dev.java.net/issues/show_bug.cgi?id=813

The bug report for JAX-WS lists a possible work-around using a switch, but I have not tried this. It may also be possible to manually download and use JAX-WS 2.2.1, but I am new to NetBeans and have not tried this.

My attempt to convert my JAX-RPC to JAX-WS using NetBeans is on hold because I have not found a way to work around this bug. My web services use arrays of objects all over the place. This is a high priority problem for me. I hope that it is easy to fix just by releasing a NetBeans patch with the latest JAX-WS libraries.
Comment 3 Denis Anisimov 2010-11-03 14:31:03 UTC
Metro libraries should be updated with JAX-WS 2.2.1 version.
Comment 4 Svata Dedic 2011-11-15 17:23:15 UTC
Already too risky to upgrade libraries in this dev cycle, sorry. Scheduling for next release.
Comment 5 Milan Kuchtiak 2013-08-28 12:23:44 UTC
Should be fine.

Netbeans bundled JAX-WS library was updated to version 2.2.6 for Netbeans 7.2.
See the bug 212616.