glassfish
  1. glassfish
  2. GLASSFISH-20597

UnsatisfiedDependencyException is thrown by JAX-RS, Bean Validation and CDI integration

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 4.0_b89_RC5
    • Fix Version/s: 4.1
    • Component/s: bean-validator, cdi, jax-rs
    • Labels:
      None
    • Environment:

      Windows 7 and JDK7 update 21 (both x86 and x86-64)

      Description

      It is problem that a JAX-RS application (exactly a resource class) throws org.glassfish.hk2.api.UnsatisfiedDependencyException when I send GET request to it. The application uses both Bean Validation (@NotNull and @Min) and CDI (@Inject) into same resource class and it is neither Managed Bean nor EJB (Session Bean). If it uses either of them (for example, it uses without Bean Validation), it runs well and send response as status 200.

      As a trial, I rewrite the application using not @Inject but @EJB (the resource class becomes Stateless Bean) and then it runs as expected.

        Issue Links

          Activity

          Hide
          Marek Potociar added a comment -

          Please provide a reproducible test case. Marking as incomplete, targeting for 4.0.1. Will be closed if a reproducible test case is not provided.

          Show
          Marek Potociar added a comment - Please provide a reproducible test case. Marking as incomplete, targeting for 4.0.1. Will be closed if a reproducible test case is not provided.
          Hide
          HASUNUMA Kenji added a comment - - edited

          I seem to have no privilege with attached files, so I write the parts of application that throws UnsatisfiedDependencyException as following;

          TweetResource.java (Resource class)
          package jp.co.ines.sagittarius.api.twitter;
          
          import java.util.List;
          
          import javax.ejb.EJB;
          import javax.ejb.Stateless;
          import javax.inject.Inject;
          import javax.validation.constraints.Min;
          import javax.validation.constraints.NotNull;
          import javax.ws.rs.DefaultValue;
          import javax.ws.rs.GET;
          import javax.ws.rs.Path;
          import javax.ws.rs.Produces;
          import javax.ws.rs.QueryParam;
          
          import twitter4j.TwitterException;
          
          @Path("/twitter")
          @Stateless
          public class TwitterResource {
            @Inject
            private TwitterSearch twitterSearch;
            
            @GET
            @Path("/search")
            @Produces({"application/xml", "application/json"})
            public List<Tweet> search(@QueryParam("q") @NotNull String queryString,
                @DefaultValue("100") @QueryParam("count") @Min(1) int count) 
                throws TwitterException {
              return twitterSearch.search(queryString, count);
            }
            
            @GET
            @Path("/peek")
            @Produces({"application/xml", "application/json"})
            public List<Tweet> peek(@QueryParam("q") String queryString, 
                @QueryParam("count") @Min(1) int count) throws TwitterException {
              return twitterSearch.peek(queryString, count);
            }
          }
          
          TweetSearch.java (Injected EJB)
          package jp.co.ines.sagittarius.api.twitter;
          
          import java.util.ArrayList;
          import java.util.List;
          import java.util.concurrent.TimeUnit;
          
          import javax.ejb.Stateless;
          import javax.ws.rs.InternalServerErrorException;
          import javax.ws.rs.ServiceUnavailableException;
          
          import twitter4j.Query;
          import twitter4j.QueryResult;
          import twitter4j.RateLimitStatus;
          import twitter4j.Status;
          import twitter4j.Twitter;
          import twitter4j.TwitterException;
          import twitter4j.TwitterFactory;
          
          @Stateless
          public class TwitterSearch {
            private static final int API_RATE_LIMIT = 180;
            private static final int SEARCH_RATE_LIMIT = 60;
            private static final int PEEK_RATE_LIMIT = 30;
            private static final int TWEETS_PER_PAGE = 100;
          	
            public List<Tweet> search(String queryString, int count) 
                throws TwitterException {
              Twitter twitter = new TwitterFactory().getInstance();
              
              RateLimitStatus rateLimitStatus = 
                twitter.search(new Query("from:home")).getRateLimitStatus();
              if (getPages(count) > getRemaining(rateLimitStatus, SEARCH_RATE_LIMIT)) {
                throw new ServiceUnavailableException(
                  (long) rateLimitStatus.getSecondsUntilReset());
              }
              
              Query query = new Query(queryString);
              query.setCount(TWEETS_PER_PAGE);
              
              List<Tweet> results = new ArrayList<>();
              for (int page = 0; page < getPages(count); page++) {
                QueryResult result = twitter.search(query);
                if (result.getTweets().isEmpty()) {
                  break;
                }
                
                for (Status status : result.getTweets()) {
                  Tweet tweet = new Tweet();
                  tweet.setId(status.getId());
                  tweet.setCreateAt(status.getCreatedAt());
                  tweet.setFromUser(status.getUser().getScreenName());
                  tweet.setFromUserName(status.getUser().getName());
                  tweet.setProfileImageUrl(status.getUser().getProfileImageURLHttps());
                  tweet.setVerified(status.getUser().isVerified());
                  tweet.setText(status.getText());
                  results.add(tweet);
                }
                query.setMaxId(result.getTweets().get(0).getId() - 1L);
              }
              return results;
            }
          
            public List<Tweet> peek(String queryString, int count) throws TwitterException {
              Twitter twitter = new TwitterFactory().getInstance();
              
              RateLimitStatus rateLimitStatus = twitter.search(
                new Query("from:home")).getRateLimitStatus();
              if (getPages(count) > getRemaining(rateLimitStatus, WATCH_RATE_LIMIT)) {
                throw new ServiceUnavailableException(
                  (long) rateLimitStatus.getSecondsUntilReset());
              }
              
              Query query = new Query(queryString);
              query.setCount(TWEETS_PER_PAGE);
              
              List<Tweet> results = new ArrayList<>();
              for (int page = 0; page < getPages(count); page++) {
                QueryResult result = twitter.search(query);
                if (result.getTweets().isEmpty()) {
                  break;
                }
                for (Status status : result.getTweets()) {
                  Tweet tweet = new Tweet();
                  tweet.setId(status.getId());
                  tweet.setCreateAt(status.getCreatedAt());
                  tweet.setFromUser(status.getUser().getScreenName());
                  tweet.setFromUserName(status.getUser().getName());
                  tweet.setProfileImageUrl(status.getUser().getProfileImageURLHttps());
                  tweet.setVerified(status.getUser().isVerified());
                  tweet.setText(status.getText());
                  results.add(tweet);
                }
                try {
                  int until = result.getRateLimitStatus().getSecondsUntilReset();
                  int wait = until / getRemaining(
                    result.getRateLimitStatus(), PEEK_RATE_LIMIT);
                    TimeUnit.SECONDS.sleep(wait);
                } catch (InterruptedException e) {
                  e.printStackTrace();
                  throw new InternalServerErrorException(e);
                }
                query.setMaxId(result.getTweets().get(0).getId() - 1L);
              }
              return results;
            }
            
            private int getRemaining(RateLimitStatus rateLimitStatus, int rateLimit) {
              return rateLimitStatus.getRemaining() - (API_RATE_LIMIT - rateLimit);
            }
          	
            private int getPages(int count) {
              return (count + TWEETS_PER_PAGE - 1) / TWEETS_PER_PAGE;
            }
          }
          
          Tweet.java (in part of)
          package jp.co.ines.sagittarius.api.twitter;
          
          import static javax.xml.bind.annotation.XmlAccessType.FIELD;
          
          import java.io.Serializable;
          import java.util.Date;
          
          import javax.xml.bind.annotation.XmlAccessorType;
          import javax.xml.bind.annotation.XmlElement;
          import javax.xml.bind.annotation.XmlRootElement;
          
          @XmlRootElement
          @XmlAccessorType(FIELD)
          public class Tweet implements Serializable {
            private static final long serialVersionUID = 3677514835637906987L;
          
            @XmlElement private long id;
            @XmlElement private Date createAt;
            @XmlElement private String fromUser;
            @XmlElement private String fromUserName;
            @XmlElement private String profileImageUrl;
            @XmlElement private boolean verified;
            @XmlElement private String text;
          
            // omit following getters/setters because of verbose description
          }
          
          WEB-INF/beans.xml
          <?xml version="1.0" encoding="UTF-8"?>
          <beans xmlns="http://java.sun.com/xml/ns/javaee"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                 http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
          </beans>
          

          UnsatisfiedDependencyException is thrown directly following TwitterResource#search method. But I think it is also happen in TwitterSearch#peek method.

          Remarks:

          • This application uses Twitter4J 3.0.3 (http://twitter4j.org/).
          • If I remove "@NotNull" and "@Min" from above TwitterResource, this runs well.
          • If I also replace "@Inject" to "@EJB" from above one, this runs well.


          If possible, please grant attached files role to me because that I'll add reproducible test cases to future issues. I sent "Oracle Contributor Agreement" and wait it's acceptance.

          Show
          HASUNUMA Kenji added a comment - - edited I seem to have no privilege with attached files, so I write the parts of application that throws UnsatisfiedDependencyException as following; TweetResource.java (Resource class) package jp.co.ines.sagittarius.api.twitter; import java.util.List; import javax.ejb.EJB; import javax.ejb.Stateless; import javax.inject.Inject; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import twitter4j.TwitterException; @Path( "/twitter" ) @Stateless public class TwitterResource { @Inject private TwitterSearch twitterSearch; @GET @Path( "/search" ) @Produces({ "application/xml" , "application/json" }) public List<Tweet> search(@QueryParam( "q" ) @NotNull String queryString, @DefaultValue( "100" ) @QueryParam( "count" ) @Min(1) int count) throws TwitterException { return twitterSearch.search(queryString, count); } @GET @Path( "/peek" ) @Produces({ "application/xml" , "application/json" }) public List<Tweet> peek(@QueryParam( "q" ) String queryString, @QueryParam( "count" ) @Min(1) int count) throws TwitterException { return twitterSearch.peek(queryString, count); } } TweetSearch.java (Injected EJB) package jp.co.ines.sagittarius.api.twitter; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; import javax.ejb.Stateless; import javax.ws.rs.InternalServerErrorException; import javax.ws.rs.ServiceUnavailableException; import twitter4j.Query; import twitter4j.QueryResult; import twitter4j.RateLimitStatus; import twitter4j.Status; import twitter4j.Twitter; import twitter4j.TwitterException; import twitter4j.TwitterFactory; @Stateless public class TwitterSearch { private static final int API_RATE_LIMIT = 180; private static final int SEARCH_RATE_LIMIT = 60; private static final int PEEK_RATE_LIMIT = 30; private static final int TWEETS_PER_PAGE = 100; public List<Tweet> search( String queryString, int count) throws TwitterException { Twitter twitter = new TwitterFactory().getInstance(); RateLimitStatus rateLimitStatus = twitter.search( new Query( "from:home" )).getRateLimitStatus(); if (getPages(count) > getRemaining(rateLimitStatus, SEARCH_RATE_LIMIT)) { throw new ServiceUnavailableException( ( long ) rateLimitStatus.getSecondsUntilReset()); } Query query = new Query(queryString); query.setCount(TWEETS_PER_PAGE); List<Tweet> results = new ArrayList<>(); for ( int page = 0; page < getPages(count); page++) { QueryResult result = twitter.search(query); if (result.getTweets().isEmpty()) { break ; } for (Status status : result.getTweets()) { Tweet tweet = new Tweet(); tweet.setId(status.getId()); tweet.setCreateAt(status.getCreatedAt()); tweet.setFromUser(status.getUser().getScreenName()); tweet.setFromUserName(status.getUser().getName()); tweet.setProfileImageUrl(status.getUser().getProfileImageURLHttps()); tweet.setVerified(status.getUser().isVerified()); tweet.setText(status.getText()); results.add(tweet); } query.setMaxId(result.getTweets().get(0).getId() - 1L); } return results; } public List<Tweet> peek( String queryString, int count) throws TwitterException { Twitter twitter = new TwitterFactory().getInstance(); RateLimitStatus rateLimitStatus = twitter.search( new Query( "from:home" )).getRateLimitStatus(); if (getPages(count) > getRemaining(rateLimitStatus, WATCH_RATE_LIMIT)) { throw new ServiceUnavailableException( ( long ) rateLimitStatus.getSecondsUntilReset()); } Query query = new Query(queryString); query.setCount(TWEETS_PER_PAGE); List<Tweet> results = new ArrayList<>(); for ( int page = 0; page < getPages(count); page++) { QueryResult result = twitter.search(query); if (result.getTweets().isEmpty()) { break ; } for (Status status : result.getTweets()) { Tweet tweet = new Tweet(); tweet.setId(status.getId()); tweet.setCreateAt(status.getCreatedAt()); tweet.setFromUser(status.getUser().getScreenName()); tweet.setFromUserName(status.getUser().getName()); tweet.setProfileImageUrl(status.getUser().getProfileImageURLHttps()); tweet.setVerified(status.getUser().isVerified()); tweet.setText(status.getText()); results.add(tweet); } try { int until = result.getRateLimitStatus().getSecondsUntilReset(); int wait = until / getRemaining( result.getRateLimitStatus(), PEEK_RATE_LIMIT); TimeUnit.SECONDS.sleep(wait); } catch (InterruptedException e) { e.printStackTrace(); throw new InternalServerErrorException(e); } query.setMaxId(result.getTweets().get(0).getId() - 1L); } return results; } private int getRemaining(RateLimitStatus rateLimitStatus, int rateLimit) { return rateLimitStatus.getRemaining() - (API_RATE_LIMIT - rateLimit); } private int getPages( int count) { return (count + TWEETS_PER_PAGE - 1) / TWEETS_PER_PAGE; } } Tweet.java (in part of) package jp.co.ines.sagittarius.api.twitter; import static javax.xml.bind.annotation.XmlAccessType.FIELD; import java.io.Serializable; import java.util.Date; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(FIELD) public class Tweet implements Serializable { private static final long serialVersionUID = 3677514835637906987L; @XmlElement private long id; @XmlElement private Date createAt; @XmlElement private String fromUser; @XmlElement private String fromUserName; @XmlElement private String profileImageUrl; @XmlElement private boolean verified; @XmlElement private String text; // omit following getters/setters because of verbose description } WEB-INF/beans.xml <?xml version= "1.0" encoding= "UTF-8" ?> <beans xmlns= "http: //java.sun.com/xml/ns/javaee" xmlns:xsi= "http: //www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http: //java.sun.com/xml/ns/javaee http: //java.sun.com/xml/ns/javaee/beans_1_0.xsd"> </beans> UnsatisfiedDependencyException is thrown directly following TwitterResource#search method. But I think it is also happen in TwitterSearch#peek method. Remarks: This application uses Twitter4J 3.0.3 ( http://twitter4j.org/ ). If I remove "@NotNull" and "@Min" from above TwitterResource, this runs well. If I also replace "@Inject" to "@EJB" from above one, this runs well. – If possible, please grant attached files role to me because that I'll add reproducible test cases to future issues. I sent "Oracle Contributor Agreement" and wait it's acceptance.
          Hide
          Michal Gajdos added a comment -

          Hi,

          can you paste the whole stacktrace of the exception? Are you running this example on GlassFish or on something else?

          Thanks.

          Show
          Michal Gajdos added a comment - Hi, can you paste the whole stacktrace of the exception? Are you running this example on GlassFish or on something else? Thanks.
          Hide
          HASUNUMA Kenji added a comment -

          I run the example only on GlassFish 4.0 build 89.

          The whole stacktrace is following;

          org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at Injectee(requiredType=TwitterSearch,parent=TwitterResource,qualifiers={}),position=-1,optional=false,self=false,unqualified=null,1920339034)
          at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:74)
          at org.jvnet.hk2.internal.Utilities.justInject(Utilities.java:771)
          at org.jvnet.hk2.internal.ServiceLocatorImpl.inject(ServiceLocatorImpl.java:790)
          at org.glassfish.jersey.gf.cdi.CdiComponentProvider$1.inject(CdiComponentProvider.java:316)
          at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:158)
          at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:69)
          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:716)
          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:738)
          at org.glassfish.jersey.gf.cdi.CdiComponentProvider$CdiFactory$1.getInstance(CdiComponentProvider.java:174)
          at org.glassfish.jersey.gf.cdi.CdiComponentProvider$CdiFactory.provide(CdiComponentProvider.java:143)
          at org.jvnet.hk2.internal.FactoryCreator.create(FactoryCreator.java:96)
          at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448)
          at org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:69)
          at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2204)
          at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:579)
          at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:566)
          at org.glassfish.jersey.internal.inject.Injections.getOrCreate(Injections.java:172)
          at org.glassfish.jersey.server.model.MethodHandler$ClassBasedMethodHandler.getInstance(MethodHandler.java:185)
          at org.glassfish.jersey.server.internal.routing.PushMethodHandlerRouter.apply(PushMethodHandlerRouter.java:105)
          at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:118)
          at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:121)
          at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:121)
          at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:121)
          at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:121)
          at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:102)
          at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:62)
          at org.glassfish.jersey.process.internal.Stages.process(Stages.java:197)
          at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:215)
          at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
          at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
          at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
          at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
          at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
          at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
          at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:198)
          at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:946)
          at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:323)
          at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:372)
          at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:335)
          at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:218)
          at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
          at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
          at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
          at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
          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(Thread.java:722)

          Show
          HASUNUMA Kenji added a comment - I run the example only on GlassFish 4.0 build 89. The whole stacktrace is following; org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at Injectee(requiredType=TwitterSearch,parent=TwitterResource,qualifiers={}),position=-1,optional=false,self=false,unqualified=null,1920339034) at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:74) at org.jvnet.hk2.internal.Utilities.justInject(Utilities.java:771) at org.jvnet.hk2.internal.ServiceLocatorImpl.inject(ServiceLocatorImpl.java:790) at org.glassfish.jersey.gf.cdi.CdiComponentProvider$1.inject(CdiComponentProvider.java:316) at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:158) at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:69) at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:716) at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:738) at org.glassfish.jersey.gf.cdi.CdiComponentProvider$CdiFactory$1.getInstance(CdiComponentProvider.java:174) at org.glassfish.jersey.gf.cdi.CdiComponentProvider$CdiFactory.provide(CdiComponentProvider.java:143) at org.jvnet.hk2.internal.FactoryCreator.create(FactoryCreator.java:96) at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448) at org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:69) at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2204) at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:579) at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:566) at org.glassfish.jersey.internal.inject.Injections.getOrCreate(Injections.java:172) at org.glassfish.jersey.server.model.MethodHandler$ClassBasedMethodHandler.getInstance(MethodHandler.java:185) at org.glassfish.jersey.server.internal.routing.PushMethodHandlerRouter.apply(PushMethodHandlerRouter.java:105) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:118) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:121) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:121) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:121) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:121) at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:102) at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:62) at org.glassfish.jersey.process.internal.Stages.process(Stages.java:197) at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:215) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:198) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:946) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:323) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:372) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:335) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:218) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188) 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(Thread.java:722)
          Hide
          Michal Gajdos added a comment -

          Thanks for the stacktrace.

          This issue is a duplicate of GLASSFISH-20255. The fix will be present in GF 4.0.1 and after the official release of GF 4.0 we will provide an IPS update package with Jersey where this issue is fixed. (I'll let you know when the package is available)

          In the meantime you can download the jersey-gf-cdi from maven central ([1]), replace this module in glassfish4/glassfish/modules and delete the osgi cache glassfish4/glassfish/domains/domain1/osgi-cache/felix. This should fix the issue.

          [1] http://repo1.maven.org/maven2/org/glassfish/jersey/containers/glassfish/jersey-gf-cdi/2.0/jersey-gf-cdi-2.0.jar

          Show
          Michal Gajdos added a comment - Thanks for the stacktrace. This issue is a duplicate of GLASSFISH-20255 . The fix will be present in GF 4.0.1 and after the official release of GF 4.0 we will provide an IPS update package with Jersey where this issue is fixed. (I'll let you know when the package is available) In the meantime you can download the jersey-gf-cdi from maven central ( [1] ), replace this module in glassfish4/glassfish/modules and delete the osgi cache glassfish4/glassfish/domains/domain1/osgi-cache/felix . This should fix the issue. [1] http://repo1.maven.org/maven2/org/glassfish/jersey/containers/glassfish/jersey-gf-cdi/2.0/jersey-gf-cdi-2.0.jar

            People

            • Assignee:
              Michal Gajdos
              Reporter:
              HASUNUMA Kenji
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: