I asked this on the JNDI forum, and no one seemed to know the answer. Maybe someone on this forum will have an idea.
We have a connection pool (xa-datasource), accessed through JNDI, specified in [JBoss]\server\default\deploy\oracle-xa-ds.xml, and we're having difficulty accessing it during servlet (filter) init. Our filters (in their init methods) access other global objects that are themselves initialized and require the data connection.
From the log file it's clear that the connection pool service starts after the filters initialize, which is too late, because the filters and other objects have already failed to initialize properly. Of course, if we add a try block surrounding the context.lookup("java:[ourConnectionPool]") and subsequent catch block containing the hard-coded connection process, everything works fine. It's an ok work-around for now, but there ought to be an elegant way of doing this.
We've tried moving the xml code to other files, namely jboss-service.xml and server.xml, but that doesn't seem to change anything.
Can anyone give me an answer as to whether this works as it does by design or whether I'm just not setting it up properly? Is there any way to ensure that the connection pool is set up before the filters start their initialization?