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?
I went ahead and posted this to the "JBoss Web Server" forum (http://www.jboss.com/index.html?module=bb&op=viewtopic&t=99054), because I wasn't sure if I had chosen the right forum to post this question, and I presumed that the folks who handle these forums only handle a limited number of them.