tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmcletchie <dmcletc...@gmail.com>
Subject Re: datasource duplication in tomee
Date Mon, 14 Aug 2017 16:48:28 GMT
I solved my problem with the PSI probe & I wanted to post this in case anyone
comes across this issue.

If I define a datasource in tomee.xml, then it does not appear in the "Data
Sources" tab in PSI probe.

The problem is that psi probe is looking for instances of
"org.apache.tomcat.jdbc.pool.DataSource", and tomee is subclassing that,
using "org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource". 

I created an issue with PSI probe, and i'll submit a patch if i can figure
out how to use github.  There's about 10 ways to solve it, but if anyone is
stuck with this issue, this is a simple patch that functions as a workaround
for me:
----------------------------------
a/core/src/main/java/psiprobe/beans/accessors/TomcatJdbcPoolDatasourceAccessor.java
+++
b/core/src/main/java/psiprobe/beans/accessors/TomcatJdbcPoolDatasourceAccessor.java
@@ -43,8 +43,8 @@ public class TomcatJdbcPoolDatasourceAccessor implements
DatasourceAccessor {

   @Override
   public boolean canMap(Object resource) {
-    return
"org.apache.tomcat.jdbc.pool.DataSource".equals(resource.getClass().getName())
-        && resource instanceof DataSource;
+    return
/*"org.apache.tomcat.jdbc.pool.DataSource".equals(resource.getClass().getName())
+        &&*/ resource instanceof DataSource;
   }

 }

----------------------------------




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/datasource-duplication-in-tomee-tp4682413p4682456.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Mime
View raw message