Bug 1283962 - Unable to use CDI extension in Tomcat
Summary: Unable to use CDI extension in Tomcat
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: JBoss Data Grid 6
Classification: JBoss
Component: Infinispan
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER3
: 6.6.0
Assignee: Tristan Tarrant
QA Contact: Martin Gencur
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-20 12:10 UTC by Martin Gencur
Modified: 2025-02-10 03:48 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-02-10 03:48:31 UTC
Type: Bug
Embargoed:


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

Description Martin Gencur 2015-11-20 12:10:00 UTC
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.

1) 
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

2) 
SEVERE: Exception sending context destroyed event to listener instance of class org.jboss.weld.environment.servlet.Listener
java.lang.NullPointerException
	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)

3) 
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

4)
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 12:52:24 UTC
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 13:58:35 UTC
JPA related errors will probably need JPA provider on classpath.

Comment 5 Vojtech Juranek 2015-12-03 16:21:47 UTC
Works on Tomcat, also tested on EAP, that it's not broken there.

Comment 8 Red Hat Bugzilla 2025-02-10 03:48:31 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.


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