Bug 1283962 - Unable to use CDI extension in Tomcat
Unable to use CDI extension in Tomcat
Product: JBoss Data Grid 6
Classification: JBoss
Component: Infinispan (Show other bugs)
Unspecified Unspecified
unspecified Severity high
: ER3
: 6.6.0
Assigned To: Sebastian Łaskawiec
Martin Gencur
Depends On:
  Show dependency treegraph
Reported: 2015-11-20 07:10 EST by Martin Gencur
Modified: 2018-01-29 11:07 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Detailed test output (321.75 KB, text/plain)
2015-11-20 07:10 EST, Martin Gencur
no flags Details

  None (edit)
Description Martin Gencur 2015-11-20 07:10:00 EST
Created attachment 1097139 [details]
Detailed test output

Deploying an application to Tomcat7/8 after the CDI package split fails. The following errors can be seen in the log.

SEVERE: Exception sending context initialized event to listener instance of class org.jboss.weld.environment.servlet.Listener
org.jboss.weld.exceptions.DeploymentException: com/sun/jdi/request/EventRequest
Caused by: java.lang.ClassNotFoundException: com.sun.jdi.request.EventRequest

SEVERE: Exception sending context destroyed event to listener instance of class org.jboss.weld.environment.servlet.Listener
	at org.jboss.weld.servlet.WeldInitialListener.contextDestroyed(WeldInitialListener.java:102)
	at org.jboss.weld.servlet.api.helpers.ForwardingServletListener.contextDestroyed(ForwardingServletListener.java:30)
	at org.jboss.weld.environment.servlet.Listener.contextDestroyed(Listener.java:85)

SEVERE: Exception sending context initialized event to listener instance of class org.jboss.weld.environment.servlet.Listener
org.jboss.weld.exceptions.DeploymentException: javax/persistence/EntityNotFoundException

There are also a number of log errors similar to this one:
INFO: WELD-000119: Not generating any bean definitions from infinispan.org.jboss.logging.Log4jLogger because of underlying class loading error: Type org.apache.log4j.Priority not found.  If this is unexpected, enable DEBUG logging to see the full error.

Detailed test output can be found in the attached log.
Comment 2 Sebastian Łaskawiec 2015-11-23 07:52:24 EST
Unfortunately we are a bit constrained here since it is very likely that if we fix Tomcat error, we will cause some EAP error and vice versa. 

Addressing those comments in order:
Ad1. com.sun.jdi.request.EventRequest errors

As you mentioned we have no JDK dependency from Tomcat Classloader. Also, this class seems to be shipped as a part of Protostream and it's JavaAssist integration. Since I'm not sure what's the impact - I would recommend leaving this for now (in DR phase I would remove it without hesitation). 

Ad2. org.jboss.weld.environment.servlet.Listener while redeploying

It seems this is a Weld error. For some reason WeldInitialListener.lifecycle is null when calling WeldInitialListener#contextDestroyed. That one should probably go to Weld upstream.

Ad3. javax/persistence/EntityNotFoundException errors

I can't reproduce this one. Maybe it's related to your test?

Ad4. org.jboss.logging.Log4jLogger errors

This one will probably need to stay. If I include log4j jar - I would need to pull a lot of dependencies which are not needed. If I remove it - JBoss logging - Log4J integration will not work...

The easiest fix might be applied by the user. He might add Log4J jar to his application or provide SLF4J-Log4J bridge. In JDG7 we will have a better approach since newer Log4J is split into api and implementation.
Comment 3 Sebastian Łaskawiec 2015-11-23 08:58:35 EST
JPA related errors will probably need JPA provider on classpath.
Comment 5 Vojtech Juranek 2015-12-03 11:21:47 EST
Works on Tomcat, also tested on EAP, that it's not broken there.

Note You need to log in before you can comment on or make changes to this bug.