[Clustering/JBoss] - Problem for JNDI database connection pooling
by Allen_Lei
Hi,all
I hava an app which runs on JBoss 4.* with the JNDI connection datasource pooling named testDs,and sometimes it does not work.At that time I view the "jboss.system"-"type=ServerInfo" in jmx-console,invoke the "java.lang.String listThreadDump()" operation button and find there are several BLOCKING state threads which indicate they are blocking in getting datasource connection.
In the meantime,i try to view "jboss.jca"-"name=testDs,service=ManagedConnectionPool" in jmx-console,but find there is no response when i click that link,which means i could't access the attribute page for the testDs connection pooling.When i restart the JBoss,it works.Anybody knows how this happened? What lead to the connnection pooling attribute page can't be accessible?
Your reply will by most appreciated.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240624#4240624
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4240624
16 years, 9 months
[JNDI/Naming/Network] - Getting DB connection from jboss pool via JNDI
by amayen
Hi!
I have a problem with the look up of a database resource.
I have the following setup:
One standalone Tomcat 5.x
One standalone JBoss 4.x
They are both running on the same pyhsical host machine.
The Jboss is configured with a datasource *-ds.xml. This can be used by the EJB's running inside JBOSS.
The JSP's running in Tomcat are also sometimes trying to get the datasource from JBoss via JNDI. That fails if I do not set <use-java-context>false</...>.
But as I read setting this property to true is an anti pattern (and I'm seeing errors over time getting db connections which did not occur before).
Furthermore the application seems to have been running with this setup without even mentioning <use-java-context/> (The default should be true, shouldn't it?) very successful.
So my question is if it could be possible somehow that this setup can work without setting <use-java-context/> to false (It seemed to have worked that way, but all I'm reading suggests that this does never ever work)?
And second, what is the preferred way to let tomcat access the database resource via jndi (where jboss and tomcat run in the same machine but in different jvm instances)?
I also tried setting up a reference in web.xml and jboss-web.xml which I put into the WEB-INF directory.
Here the contents:
web.xml:
<resource-ref>
fdjlf
<res-ref-name>java:postgresqlDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<resource-ref>
jboss-web.xml:
<resource-ref>
fdjlf
<res-ref-name>java:postgresqlDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:postgresqlDS</jndi-name>
<resource-ref>
Does this web.xml jboss-web.xml configuration only work for stuff put into the global namespace of jndi?
Thanks for any answers!
Kind regards,
Anatol
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240618#4240618
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4240618
16 years, 9 months