Reading MaxPoolSize via MBean in EAP 7.1 - jboss-eap-7

how can I get the maxPoolSize of a datasource via mbean?
In JBoss 6 it was jboss.as:subsystem=datasources,xa-data-source=MyDataSource -> maxPoolSize
In EAP 7.1 it doesn't exist anymore.
Thanks!

Yes,this does not exist in EAP 7.1 anymore,
mbeans
have been replaced by the native management API.
To know the max-pool-size of a datasource you could try the below given command from CLI instead after starting the server:
This would give you a complete insight into datasource parameters values.
./jboss-cli.sh --connect
/subsystem=datasources/data-source=ExampleDS/statistics=pool:read-resource(include-runtime=true

Related

Jboss-service.xml in Jboss is not understood by EAP 7

1) We are migrating from Jboss 5 to EAP 7.
2) The same code deploys under jboss 5 but throws below error when deploying under EAP7
Can someone help with how we accomplish
jboss-service.xml equivalent in EAP?
Thanks for your help.
There were many changes in between JBoss 5 and the latest EAP. You'll have to take a look at jboss-service.xml to see what it's trying to accomplish (this is generally just MBean configuration), there will be a new way to do this.
There are lots changes between EAP 5 and EAP 7. JBoss-service .xml is no longer valid. You will have to configure using standalone or domain.xml.
If you need messaging or clustering support then you will have to choose Ha or full or Full-ha profile.

Oracle 12 c RAC connection issue in jboss 4.2.3 through datasource

We were using oracle 11g, in jboss 4.2.3 using datasource xml file .It was working fine.Now we moved to oracle 12 c rac version. we changed the url in datasource xml file but it is giving [org.jboss.resource.connectionmanager.JBossManagedConnectionPool]Throwable while attempting to get a new connection: null
but using same url in jdbc connection using Class. forName(....), It is working proper.
Please help me out , why we are not able to connect through datasource xml file.
our configuration :
jboss 4.2.3
oracle 12c rac
jdk 1.6
ojdbc6.jar
Try adding a new datasource(12c one) from the JBOSS console, rather than doing this manually.

Enable OJDBC Logging on JBoss

I'm facing database connection issue when using ojdbc6.jar. Therefore, I would like to enable logging by using ojdbc6_g.jar.
I am using JBoss AS 7.1.
How to add these Java options:
-Doracle.jdbc.Trace=true
-Djava.util.logging.config.file
Do I have to add to Eclipse or JBoss or Oracle database ? My guess would be Eclipse.
Please help.
the JDBC driver has to be in the classpath of the JBOSS server otherwise JBOSS could not be able to find the oracle Server
this could also be a network issue
also you mix several concept in once line ; weird
so we need more details about your problem, for example errors ; logs etc.

OpenJPA logging with slf4j on WebSphere

My Java EE 6 application uses slf4j with logback as logging framework.
Now I want to add the SQL traces of OpenJpa to my log files. The OpenJpa-Documentation says, I can use a parameter to this:
<property name="openjpa.Log" value="slf4j"/>
I use the WebSphere Application Server v8.0.0.1 as Java EE container. If I deploy my application to the server, this parameter does not change anything. I can change log levels in WebSphere Admin Console and this works fine. But a cannot bypass the OpenJpa logging to my slf4j framework.
Does anyone uses such configuration and solved the problem?
Btw. I know, that the InformationCenter-Article http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.doc%2Finfo%2Fae%2Fae%2Ftejb_jpatroubleshoot.html
says, that the parameter will be ignored, but everything should be possible, eh?
I don't know what version of OpenJPA is embedded in WAS 8.0.
In OpenJPA 1.x there was no possibility to use "slf4j". A workaround was copying the class org.apache.openjpa.lib.log.SLF4JLogFactory from OpenJPA 2.x sources to your application and using it directly:
<property name="openjpa.Log" value="org.apache.openjpa.lib.log.SLF4JLogFactory"/>
You can always specify the factory class name directly, the short name is only a convenience trick.
In OpenJPA 2.x the SLF4JLogFactory is present, so it should work with your current settings; perhaps you set it in a place that is overridden by other configuration? For example, if you configure JPA through EntityManagerFactory's propertyMap, it takes precedence over the settings in persistence.xml.
I solved it.
There are four things to do:
Say that OpenJpa logs the statements. That is done by the property entry in the persistence.xml.
Say Slf4j that it has to fetch the logs from JUL too. This can be done by installing the SLF4JBridgeHandler by SLF4J. I installed the bridge via a ServletContextListener which is called at application start.
Configure Logback that it does not log ALL logs from JUL but only the needed Logs. This is done by adding the LevelChangePropagator in the logBack-test.xml
Ask the WebSphere TraceService to hand down the logs from OpenJPA to the application. This is a setting in the WebSphere Administration Console

How to override TOMCAT Oracle ojdbc14 driver in the application?

The TOMCAT server is using an Oracle 9G ojdbc14 driver to its jndi connections in the /common/lib folder.
My web application uses Maven + Spring and I'm getting the dataSource using Spring jndi features.
I'm trying to bypass TOMCAT old ojdbc14 driver with a newer one (ojdbc14 10.2.0.4.0).
I've tried putting the jars in the WEB-INF/lib folder as a project dependency, but it doesn't work the application keeps using the old oracle driver that is in the TOMCAT folder.
I'm trying to bypass the TOMCAT oracle driver because I cannot update it to the newest version because there are lots of other projects using it.
Does anyone have a clue?
This won't work, Tomcat won't use the JDBC driver of your webapp to create a connection pool. In other words, you'll have to either replace the version in common/lib or to use a standalone connection pool at the application level.

Resources