Closed dfbadawi closed 6 years ago
@dfbadawi thanks for your pull-request, it sounds great to me. I'm just not sure if it will work in servlet-containers, just like tomcat and jetty. could you test it?
@Turini sure! I'll test tomorrow
@Turini It didn't work in tomcat. Later I will try to fix the PR.
@dfbadawi great! thank you for your test and the time you're spending improving the project. let me know if there's something I can help you with.
Closing this PR because #1113
We are migrating our projects from Wildfly 10 to Wildfly 12 and Wildfly 12 has a different approach for initialization components, such as
@Startup
from EJB,@WebListener
from servlets and@Observes @Initialized(ApplicationScoped.class)
from CDI.With this new approach, if the application is deployed together with the application server startup (like restart the server with the application deployed), these "listeners" are triggered when some of the resources are not available (sometimes it is available, maybe Wildfly 12 registering the components asynchronously?).
So, in this case, the ServletContext may not be available while VRaptor is registering the controllers throwing this Exception:
Which makes me wonder why VRaptor has a
@Provides
for ServletContext, Considering that Weld already provides it. Also, the spec defines (from ServletContext's javadoc):There is no need to alternate the provider and define as ApplicationScoped. That leads me to believe it is safe to remove the ServletContextFactory.