java.lang.IllegalArgumentException

bundle context should be set before refreshing the application context

Samebug tips1

If you're unit testing, you should instantiate only the service and mock the dependencies. If you're testing integration, you should add all the mocking to the configurations file.


rafaelrafael

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web546

  • via Stack Overflow by Prashant Onkar
    ,
  • via Unknown by Unknown author,
  • via Unknown by evaleto...@gmail.com,
  • Stack trace

    • java.lang.IllegalArgumentException: bundle context should be set before refreshing the application context at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.normalRefresh(AbstractDelegatedExecutionApplicationContext.java:179) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$NoDependenciesWaitRefreshExecutor.refresh(AbstractDelegatedExecutionApplicationContext.java:89) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:467) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:483) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:358) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:325) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127) at javax.servlet.GenericServlet.init(GenericServlet.java:158) at org.apache.sling.servlets.resolver.internal.SlingServletResolver.createServlet(SlingServletResolver.java:988) at org.apache.sling.servlets.resolver.internal.SlingServletResolver.bindServlet(SlingServletResolver.java:936) at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    osvzsosvzs
    2 times, last one
    oddodd
    2 times, last one
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    mauritiusmauritius
    Once,
    190 more bugmates