New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Eager blocked deployment in Jetty (regression?) #318

Closed
jansohn opened this Issue Sep 26, 2016 · 8 comments

Comments

Projects
None yet
2 participants
@jansohn

jansohn commented Sep 26, 2016

Since Omnifaces 2.5 the exception org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enterprise.context.ApplicationScoped is being treated as FATAL (FATAL: OmniFaces failed to initialize! Report an issue to OmniFaces.), compared to WARNING in previous versions (see #166).

This effectively prevents the deployment of the servlets.

+= default@5c13d641==org.eclipse.jetty.servlet.DefaultServlet,0,false - STOPPED
[...]
+= jsp@19c47==org.eclipse.jetty.jsp.JettyJspServlet,0,false - STOPPED
[...]
+- [/]=>default
+- [*.jsp, *.jspf, *.jspx, *.xsp, *.JSP, *.JSPF, *.JSPX, *.XSP]=>jsp
+= org.eclipse.jetty.servlet.ListenerHolder@25147a - STARTED
+= Faces Servlet@87ee159b==javax.faces.webapp.FacesServlet,1,false - STOPPED
+- [*.jsf]=>Faces Servlet
+= org.eclipse.jetty.servlet.ListenerHolder@168cb27 - STARTED
+= com.test.webapp.servlets.HelloServlet@97f99221==com.test.webapp.servlets.HelloServlet,-1,false - STOPPED
@jansohn

This comment has been minimized.

Show comment
Hide comment
@jansohn

jansohn Sep 26, 2016

Reproducer app: https://github.com/jansohn/jetty-omnifaces

Jetty: 9.3.12.v20160915
Log4j2: 2.6.2
Mojarra JSF: 2.2.13
WELD: 2.4.0.Final

jansohn commented Sep 26, 2016

Reproducer app: https://github.com/jansohn/jetty-omnifaces

Jetty: 9.3.12.v20160915
Log4j2: 2.6.2
Mojarra JSF: 2.2.13
WELD: 2.4.0.Final

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Sep 26, 2016

Member

Most likely caused by #281 where all CDI workarounds were removed against currently available Java EE servers. Jetty wasn't covered by the new integration test system and was overlooked. I will look once again at it.

Member

BalusC commented Sep 26, 2016

Most likely caused by #281 where all CDI workarounds were removed against currently available Java EE servers. Jetty wasn't covered by the new integration test system and was overlooked. I will look once again at it.

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Sep 26, 2016

Member

Right I see it now, I mistakenly refactored getInstance() outside the try block:

if (getInstance() != null && instance.hasAnyApplicationScopedBeans()) {

I will fix it.

Member

BalusC commented Sep 26, 2016

Right I see it now, I mistakenly refactored getInstance() outside the try block:

if (getInstance() != null && instance.hasAnyApplicationScopedBeans()) {

I will fix it.

BalusC added a commit that referenced this issue Sep 26, 2016

#318: move getInstance() back into try
Caused deployment fail in Jetty
@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Sep 26, 2016

Member

Fix will be available in today's latest 2.6-SNAPSHOT after the build has passed.

Sorry for any inconvenience caused by this and let me know if that works for you.

Member

BalusC commented Sep 26, 2016

Fix will be available in today's latest 2.6-SNAPSHOT after the build has passed.

Sorry for any inconvenience caused by this and let me know if that works for you.

@jansohn

This comment has been minimized.

Show comment
Hide comment
@jansohn

jansohn Sep 26, 2016

Works, thanks for the quick fix!

Any hints how to get rid of these NullPointerExceptions on every request? I'm not quite getting the JavaDoc from @Eager or if it even applies in my case. AFAICS I don't have request scope annotated beans in my webapp?!

WARNUNG: Could not instantiate eager request scoped beans for request /HelloServlet. Possibly the CDI request scope is not active. If this is indeed the case, see JavaDoc on org.omnifaces.cdi.Eager on how to remedy this.
java.lang.NullPointerException
        at org.omnifaces.cdi.eager.EagerBeansRepository$EagerBeans.access$200(EagerBeansRepository.java:137)
        at org.omnifaces.cdi.eager.EagerBeansRepository.instantiateByRequestURI(EagerBeansRepository.java:112)
        at org.omnifaces.cdi.eager.EagerBeansRepository$Proxy$_$$_WeldClientProxy.instantiateByRequestURI(Unknown Source)
        at org.omnifaces.cdi.eager.EagerBeansWebListener.requestInitialized(EagerBeansWebListener.java:75)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1164)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
        at org.eclipse.jetty.server.Server.handle(Server.java:523)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
        at java.lang.Thread.run(Thread.java:745)

jansohn commented Sep 26, 2016

Works, thanks for the quick fix!

Any hints how to get rid of these NullPointerExceptions on every request? I'm not quite getting the JavaDoc from @Eager or if it even applies in my case. AFAICS I don't have request scope annotated beans in my webapp?!

WARNUNG: Could not instantiate eager request scoped beans for request /HelloServlet. Possibly the CDI request scope is not active. If this is indeed the case, see JavaDoc on org.omnifaces.cdi.Eager on how to remedy this.
java.lang.NullPointerException
        at org.omnifaces.cdi.eager.EagerBeansRepository$EagerBeans.access$200(EagerBeansRepository.java:137)
        at org.omnifaces.cdi.eager.EagerBeansRepository.instantiateByRequestURI(EagerBeansRepository.java:112)
        at org.omnifaces.cdi.eager.EagerBeansRepository$Proxy$_$$_WeldClientProxy.instantiateByRequestURI(Unknown Source)
        at org.omnifaces.cdi.eager.EagerBeansWebListener.requestInitialized(EagerBeansWebListener.java:75)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1164)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
        at org.eclipse.jetty.server.Server.handle(Server.java:523)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
        at java.lang.Thread.run(Thread.java:745)

@jansohn jansohn closed this Sep 26, 2016

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Sep 26, 2016

Member

This is another bug. I will look at it tonight.

As to javadoc, see "Compatibility section how to install a servlet filter. But this shouldn't be necessary after all.

Member

BalusC commented Sep 26, 2016

This is another bug. I will look at it tonight.

As to javadoc, see "Compatibility section how to install a servlet filter. But this shouldn't be necessary after all.

BalusC added a commit that referenced this issue Sep 26, 2016

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Sep 26, 2016

Member

Can you retry the latest 2.6-SNAPSHOT?

Member

BalusC commented Sep 26, 2016

Can you retry the latest 2.6-SNAPSHOT?

@jansohn

This comment has been minimized.

Show comment
Hide comment
@jansohn

jansohn Sep 27, 2016

Looking good, thanks!

I tried the servlet filter btw but it still produced the NPE.

jansohn commented Sep 27, 2016

Looking good, thanks!

I tried the servlet filter btw but it still produced the NPE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment