[JBoss JIRA] Created: (JBAS-5049) NoInitialContextException on deployment of EAR that contains MDB and persistence.xml
by Alan Feng (JIRA)
NoInitialContextException on deployment of EAR that contains MDB and persistence.xml
------------------------------------------------------------------------------------
Key: JBAS-5049
URL: http://jira.jboss.com/jira/browse/JBAS-5049
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Deployment services, EJB3
Affects Versions: JBossAS-4.2.2.GA
Environment: Windows XP SP2, JDK1.5.0_09, JBoss AS-4.2.2.GA, SEAM 2.0.0.GA
Reporter: Alan Feng
Assigned To: Dimitris Andreadis
When deploy an EAR that contains EJB3 MDB, you may receive NoInitialContextException on the deployment of other EJB3 elements. In my particular case, I have a persistence.xml file that configures the EntityManager. The deployment of this persistence.xml throws the NoInitialContextException. Depending on the contents of the EAR, it may be other deployment unit that is throwing this exception.
Tracing into the deployment code shows that the problem is with the latest code change in the org.jboss.ejb3.EJBContainer class. This class has method named getInitialContext(). In the previous release it returns a newly constructed InitialConext object. In the 4.2.2.GA, it returns the shared static InitialContext object from the InitialContextFactory class. The MDB deployer class org.jboss.ejb3.mdb.MessagingContainer.getJMSProviderAdapter() method calls this method to obtain a InitialContext object and closes this InitialContext object after using it. This results in that the shared InitialContext object been closed prematurely as it is used later on to deploy other EJB3 units, such as the persistence.xml file in my case.
Suggested fix:
Change the org.jboss.ejb3.mdb.MessagingContainer.getJMSProviderAdapter() method as follows:
Change the line (around line # 586):
Context context = getInitialContext();
to:
Context context = initialContextProperties == null ? new InitialContext() : new InitialContext(initialContextProperties);
The above suggested change is copied from the previous implementation of the EJBContainer.getInitialContext() method.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBMESSAGING-1090) Add appropriate Exception handling when hitting MaxSize
by Jay Howell (JIRA)
Add appropriate Exception handling when hitting MaxSize
-------------------------------------------------------
Key: JBMESSAGING-1090
URL: http://jira.jboss.com/jira/browse/JBMESSAGING-1090
Project: JBoss Messaging
Issue Type: Bug
Components: Messaging Core
Affects Versions: 1.4.0.GA
Reporter: Jay Howell
Assigned To: Tim Fox
When using MaxSize for a queue and topic the following behaviors exist
Queue - When a queue hits MaxSize, the delivery returned in Channel Support is null. This triggers a very generic JMSException to be thrown by looking at the delivery and seeing if it's null in the ServerConnectionEndpoint.
Topic - When a subscription hits the MaxSize(defined in the topic), the delivery returned will be null, but no check is done and no JMSException is thrown in the ServerConnectionEndpoint.
What this means is that anyone who wants to put hooks in to gather the messages dropped can't. Either because the exception is too generic or because one is not thrown at all.
I would purpose that we put proper exception handling down in the ChannelSupport where MaxSize is checked for both queues and subscriptions.
We would need to Change the The two methods in channel support for send and sendInternal to throw a JMSException. Then we throw a checked Exception in ChannelSupport for MaxSize violations(make a new exception derived from MessagingJMSException).
Adding proper exception handling to these would allow users to add aspects and notifications when messages are dropped due to MaxSize.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years