eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
382 stars 143 forks source link

NPE at com.sun.enterprise.deployment.ServiceReferenceDescriptor.hasGenericServiceInterface(ServiceReferenceDescriptor.java:277) #20018

Closed glassfishrobot closed 11 years ago

glassfishrobot commented 11 years ago

This is causing CDI tck failure.

A WebSerficeRef is defined like so: @WebServiceRef public SheepWS sheepWS;

WebServiceRefHandler.processAWsRef is constructing ServiceReferenceDescriptor via the no-arg constructor (line 234). Later at line 322 wsclientAnn is null which is causing a AnnotationProcessorException to be thrown. This exception is not caught anywhere and so eventually ServiceReferenceDescriptor.hasGenericServiceInterface is called causing the NPE. Here's the stack trace:

[2013-03-24T15:34:26.403-0400] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=44 _ThreadName=Thread-4] [timeMillis: 1364153666403] [levelValue: 1000] [[ java.lang.RuntimeException at org.glassfish.javaee.core.deployment.JavaEEDeployer.prepare(JavaEEDeployer.java:229) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:922) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:431) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Unknown Source) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1761) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674) at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:235) at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:257) at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:329) at org.glassfish.admin.rest.resources.TemplateListOfResource.post(TemplateListOfResource.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:125) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:91) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:350) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:345) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:214) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:207) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:203) at org.glassfish.jersey.internal.Errors.process(Errors.java:251) at org.glassfish.jersey.internal.Errors.process(Errors.java:233) at org.glassfish.jersey.internal.Errors.process(Errors.java:203) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:190) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:865) at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:325) at org.glassfish.admin.rest.adapter.RestAdapter$2.service(RestAdapter.java:318) at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.RuntimeException at org.glassfish.webservices.codegen.JaxRpcRICodegen.accept(JaxRpcRICodegen.java:290) at com.sun.enterprise.deployment.util.ModuleContentLinker.accept(ModuleContentLinker.java:96) at org.glassfish.webservices.codegen.JaxRpcRICodegen.accept(JaxRpcRICodegen.java:852) at com.sun.enterprise.deployment.BundleDescriptor.visit(BundleDescriptor.java:621) at org.glassfish.web.deployment.descriptor.WebBundleDescriptorImpl.visit(WebBundleDescriptorImpl.java:1958) at org.glassfish.web.deployment.descriptor.WebBundleDescriptorImpl.visit(WebBundleDescriptorImpl.java:1948) at org.glassfish.webservices.codegen.JaxRpcRICodegen.accept(JaxRpcRICodegen.java:844) at com.sun.enterprise.deployment.BundleDescriptor.visit(BundleDescriptor.java:621) at org.glassfish.webservices.codegen.JaxRpcRICodegen.run(JaxRpcRICodegen.java:161) at org.glassfish.webservices.JAXRPCCodeGenFacadeImpl.run(JAXRPCCodeGenFacadeImpl.java:60) at org.glassfish.javaee.core.deployment.JavaEEDeployer.prepare(JavaEEDeployer.java:218) ... 59 more Caused by: java.lang.NullPointerException at com.sun.enterprise.deployment.ServiceReferenceDescriptor.hasGenericServiceInterface(ServiceReferenceDescriptor.java:277) at com.sun.enterprise.deployment.ServiceReferenceDescriptor.hasGeneratedServiceInterface(ServiceReferenceDescriptor.java:281) at org.glassfish.webservices.codegen.JaxRpcRICodegen.accept(JaxRpcRICodegen.java:233) ... 69 more]]

Affected Versions

[4.0_dev]

glassfishrobot commented 6 years ago
glassfishrobot commented 11 years ago

@glassfishrobot Commented @lukasj said: Can you share full test case with me, ie via email, or point me to the sources at github, please? Thanks!

glassfishrobot commented 11 years ago

@glassfishrobot Commented @lukasj said: got failing CDI TCK test from JJ and based on the first look and JSR-224, section 7.9 (pages 100-101) it is likely that the test is expecting undefined behaviour. But will double check.

glassfishrobot commented 11 years ago

@glassfishrobot Commented @lukasj said: SheepWS is not a class annotated with @WebServiceClient nor the @WebServiceRef.value is defined for the field.

during deployment there are also following warnings:

SEVERE:   Class must be annotated with a interface javax.xml.ws.WebServiceClient annotation
 symbol : interface javax.xml.ws.WebServiceClient
 location: interface org.jboss.cdi.tck.tests.lookup.injection.non.contextual.ws.SheepWS
SEVERE:   Class must be annotated with a interface javax.xml.ws.WebServiceClient annotation
 symbol : interface javax.xml.ws.WebServiceClient
 location: interface org.jboss.cdi.tck.tests.lookup.injection.non.contextual.ws.SheepWS
SEVERE:   Annotations processing failed for file:/home/lukas/NetBeansProjects/WebApplication3/build/web/
SEVERE:   Unsupported deployment descriptors element org.jboss.cdi.tck.tests.lookup.injection.non.contextual.ws.SheepWSProducer/sheepWS value com.sun.enterprise.deploy.shared.FileArchive@15fbbf77.
S
glassfishrobot commented 11 years ago

@glassfishrobot Commented @lukasj said: cause and fix lies in web services area only

glassfishrobot commented 11 years ago

@glassfishrobot Commented @lukasj said:

glassfishrobot commented 11 years ago

@glassfishrobot Commented @lukasj said: http://java.net/projects/glassfish/sources/svn/revision/61363

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA GLASSFISH-20018

glassfishrobot commented 11 years ago

@glassfishrobot Commented Reported by @jjsnyder

glassfishrobot commented 11 years ago

@glassfishrobot Commented Marked as fixed on Thursday, April 11th 2013, 11:29:26 am