jersey
  1. jersey
  2. JERSEY-1437

WADL generation does not work in GlassFish

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0-m08
    • Fix Version/s: 2.0-m09
    • Component/s: core
    • Labels:
      None

      Description

      When I try to get WADL for a resource, I get 500. E.g. try with localhost:4848/monitoring/application.wadl. The following exception is logged:

      INFO: REST00001: Listening to REST requests at context: /monitoring/domain
      WARNING: Could not marshal wadl Application.
      java.lang.NullPointerException
      at org.glassfish.jersey.server.wadl.internal.WadlResource.getWadl(WadlResource.java:101)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.glassfish.jersey.server.model.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:80)
      at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:107)
      at org.glassfish.jersey.server.model.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:146)
      at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:80)
      at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:304)
      at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:299)
      at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:90)
      at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:198)
      at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:316)
      at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:174)
      at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:747)
      at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:306)
      at org.glassfish.admin.rest.adapter.RestAdapter$1.service(RestAdapter.java:327)
      at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:189)
      at com.sun.enterprise.v3.server.HK2Dispatcher.dispatch(HK2Dispatcher.java:113)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:236)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:175)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
      at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:825)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
      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:578)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:558)
      at java.lang.Thread.run(Thread.java:722)

      I am guessing this is because WadlApplicationContextImpl line 92 results in exception which is not logged(!?!?!?!!) and jaxbContext is set to null. With this, the WADL functionality is totally unusable. This is blocking the EM team - needs to be fixed ASAP!

        Issue Links

          Activity

          Hide
          Jakub Podlesak added a comment - - edited

          same exception, different use case

          Show
          Jakub Podlesak added a comment - - edited same exception, different use case
          Hide
          Pavel Bucek added a comment -

          reason:

          [#|2012-09-27T11:57:15.427+0200|SEVERE|44.0|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=12;_ThreadName=admin-listener(1);|javax.xml.bind.JAXBException: "com.sun.research.ws.wadl" doesnt contain ObjectFactory.class or jaxb.index
          	at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:281)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          	at java.lang.reflect.Method.invoke(Method.java:597)
          	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:186)
          	at javax.xml.bind.ContextFinder.find(ContextFinder.java:332)
          	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:446)
          	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:409)
          	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:313)
          	at org.glassfish.jersey.server.wadl.internal.WadlApplicationContextImpl.<init>(WadlApplicationContextImpl.java:92)
          	at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:350)
          	at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:234)
          	at org.glassfish.jersey.server.ContainerFactory.createContainer(ContainerFactory.java:79)
          	at org.glassfish.admin.rest.adapter.RestAdapter.getJerseyContainer(RestAdapter.java:323)
          	at org.glassfish.admin.rest.adapter.RestAdapter.exposeContext(RestAdapter.java:316)
          	at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:184)
          	at com.sun.enterprise.v3.server.HK2Dispatcher.dispatch(HK2Dispatcher.java:113)
          	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:236)
          	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
          	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:175)
          	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
          	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265)
          	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
          	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
          	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
          	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
          	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:825)
          	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
          	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:578)
          	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:558)
          	at java.lang.Thread.run(Thread.java:680)
          |#]
          

          fix (tested only in gf):

          --- a/core-server/pom.xml
          +++ b/core-server/pom.xml
          @@ -76,7 +76,7 @@
                           <configuration>
                               <instructions>
                                   <!-- Note: When you're changing these properties change them also in bundles/jax-rs-ri/bundle/pom.xml. -->
          -                        <Export-Package>org.glassfish.jersey.server.*;version=${project.version}</Export-Package>
          +                        <Export-Package>org.glassfish.jersey.server.*;version=${project.version},com.sun.research.ws.wadl.*;version=${project.version}</Export-Package>
                                   <Import-Package>javax.annotation.*;resolution:=optional;version="${range;[==,+);${javax.annotation.version}}", *</Import-Package>
                               </instructions>
                               <unpackBundle>true</unpackBundle>
          
          Show
          Pavel Bucek added a comment - reason: [#|2012-09-27T11:57:15.427+0200|SEVERE|44.0|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=12;_ThreadName=admin-listener(1);|javax.xml.bind.JAXBException: "com.sun.research.ws.wadl" doesnt contain ObjectFactory.class or jaxb.index at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:281) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:186) at javax.xml.bind.ContextFinder.find(ContextFinder.java:332) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:446) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:409) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:313) at org.glassfish.jersey.server.wadl.internal.WadlApplicationContextImpl.<init>(WadlApplicationContextImpl.java:92) at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:350) at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:234) at org.glassfish.jersey.server.ContainerFactory.createContainer(ContainerFactory.java:79) at org.glassfish.admin. rest .adapter.RestAdapter.getJerseyContainer(RestAdapter.java:323) at org.glassfish.admin. rest .adapter.RestAdapter.exposeContext(RestAdapter.java:316) at org.glassfish.admin. rest .adapter.RestAdapter.service(RestAdapter.java:184) at com.sun.enterprise.v3.server.HK2Dispatcher.dispatch(HK2Dispatcher.java:113) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:236) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:175) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:825) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) 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:578) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:558) at java.lang. Thread .run( Thread .java:680) |#] fix (tested only in gf): --- a/core-server/pom.xml +++ b/core-server/pom.xml @@ -76,7 +76,7 @@ <configuration> <instructions> <!-- Note: When you're changing these properties change them also in bundles/jax-rs-ri/bundle/pom.xml. --> - <Export-Package>org.glassfish.jersey.server.*;version=${project.version}</Export-Package> + <Export-Package>org.glassfish.jersey.server.*;version=${project.version},com.sun.research.ws.wadl.*;version=${project.version}</Export-Package> <Import-Package>javax.annotation.*;resolution:=optional;version= "${range;[==,+);${javax.annotation.version}}" , *</Import-Package> </instructions> <unpackBundle> true </unpackBundle>

            People

            • Assignee:
              Pavel Bucek
              Reporter:
              Martin Matula
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: