[JNDI/Naming/Network] - Re: Getting DB connection from jboss pool via JNDI
by amayen
Ok, thanks for the answer.
What I'm still not 100 % sure is what the term remote client suggests.
Is a Tomcat that runs on the same physical machine but in another process than JBoss a 'remote' client?
And if this is so, how do you go about letting also JSP's and JSP Beans used in Tomcat profit from the JBoss connection pooling WITHOUT using the Antipattern of putting db resources in the global JNDI namespace with the use of
<use-java-context>false</use-java-context>?
That is my main concern, the application is functioning with that configuration but everywhere I read it is said you should not do that.
So which alternatives to that do I have? Is the only alternative to run the tomcat instance embedded in jboss?
And local clients are only clients that were spawned through the same java process which was used to start the jboss server?
Kind regards,
Anatol
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241365#4241365
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241365
16 years, 9 months
[JCA/JBoss] - Re: Problem for JNDI database connection pooling
by Allen_Lei
"vickyk" wrote : Spend some time to view the "Connection leak" section here
| http://www.jboss.org/community/wiki/FAQJBossJCA
|
Thanks.I have read the docs.
What i mentioned above happends when i executing an operation.Before executing i monitor the ds "JBossManagedConnectionPool" MBean attribute description page,everything is ok,the value of "InUseConnectionCount" attribute is 0,means there are no connections that not closed,and the value of "AvailableConnectionCount" is 30,means there are idle connections for use.
oracle-ds.xml
| <?xml version="1.0" encoding="UTF-8"?>
|
| <datasources>
| <local-tx-datasource>
| <jndi-name>oracleDs</jndi-name>
| <connection-url>jdbc:oracle:thin:@10.10.1.31:1521:ora9i</connection-url>
| <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
| <security-domain>EncryptDBPassword4</security-domain>
| <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
| <metadata>
| <type-mapping>Oracle9i</type-mapping>
| </metadata>
| <min-pool-size>10</min-pool-size>
| <max-pool-size>30</max-pool-size>
| <blocking-timeout-millis>60000</blocking-timeout-millis>
| <idle-timeout-minutes>15</idle-timeout-minutes>
| <new-connection-sql>SELECT COUNT(*) FROM dual</new-connection-sql>
| <check-valid-connection-sql>SELECT COUNT(*) FROM dual</check-valid-connection-sql>
| </local-tx-datasource>
| </datasources>
|
the threadDump after executing an operation:
| ......
| Thread: ajp-10.10.0.42-8009-7 : priority:5, demon:true, threadId:500, threadState:BLOCKED, lockName:java.util.ArrayList@7052f5
| org.jboss.resource.connectionmanager.IdleRemover.internalRegisterPool(IdleRemover.java:92)
| org.jboss.resource.connectionmanager.IdleRemover.registerPool(IdleRemover.java:53)
| org.jboss.resource.connectionmanager.InternalManagedConnectionPool.initialize(InternalManagedConnectionPool.java:141)
| ......
|
So anybody have ideas with this?
Your reply will by most appreciated.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241363#4241363
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241363
16 years, 9 months
[JBoss Cache: Core Edition] - why eviction needs Mbean in standalone environment?
by sridhar_ratna
Hi,
I am specifying eviction policy for some of the regions in jboss cache.
When i started the cache, its throwing exception that
| java.lang.NullPointerException
| at org.jboss.cache.config.parsing.XmlConfigurationParser2x.getMBeanElement(XmlConfigurationParser2x.java:214)
|
My configuration file is
| <?xml version="1.0" encoding="UTF-8"?>
|
| <jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns="urn:jboss:jbosscache-core:config:3.1">
|
| <transaction
| transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
| syncRollbackPhase="false" syncCommitPhase="false" />
|
| <locking isolationLevel="REPEATABLE_READ"
| lockParentForChildInsertRemove="false" lockAcquisitionTimeout="200000"
| nodeLockingScheme="mvcc" writeSkewCheck="false" useLockStriping="false"
| concurrencyLevel="500" />
|
| <eviction wakeUpInterval="5000">
| <default algorithmClass="org.jboss.cache.eviction.LRUPolicy"
| eventQueueSize="200000">
| <property name="maxNodes" value="10000" />
| <property name="timeToLive" value="0" />
| </default>
| <region name="/male" >
| <property name="maxNodes" value="10000" />
| <property name="timeToLive" value="-1" />
| <property name="maxAge" value="-1" />
| </region>
| </eviction>
| <!-- <invocationBatching enabled="true"/> -->
| <jmxStatistics enabled="true" />
|
| <loaders passivation="false" shared="false">
| <preload>
| <node fqn="/male" />
| </preload>
|
| <loader class="org.jboss.cache.loader.jdbm.JdbmCacheLoader"
| async="false" fetchPersistentState="true" ignoreModifications="false">
| <properties>
| location=c:/cache/ncrb
| </properties>
| </loader>
| </loaders>
| </jbosscache>
|
and the code fragment is
| package com.cmc.facts.grid;
|
| import org.apache.log4j.Logger;
| import org.jboss.cache.Cache;
| import org.jboss.cache.CacheFactory;
| import org.jboss.cache.DefaultCacheFactory;
| import org.jboss.cache.Fqn;
| import org.jboss.cache.Node;
|
| /**
| * @author sridhar
| *
| */
| public final class GridJbossCacheManager {
|
| public static final String CACHE_CFG_PATH = System.getProperty("jbcachexml.path");
|
| /** JBoss Cache instance. */
| private Cache<Long, Object> cache = null;
|
| /** Cache node for caching example data. */
| private Node<Long, Object> cacheRoot = null;
|
| /** Singleton instance. */
| private static GridJbossCacheManager instance = null;
|
| public static GridJbossCacheManager getInstance() {
| if (instance == null) {
| instance = new GridJbossCacheManager();
| }
| return instance;
| }
|
| public void start() {
|
| try {
| CacheFactory<Long, Object> factory = new DefaultCacheFactory<Long, Object>();
| cache = factory.createCache(CACHE_CFG_PATH);
|
| cache.create();
| cache.start();
| cacheRoot = cache.getRoot();
| } catch (Exception e) {
| LOG.error(e.getMessage(), e);
| System.exit(1);
| }
| LOG.debug("JBoss Cache data manager started.");
| }
|
| public void stop() {
| if (cache != null) {
| cache.stop();
| }
|
| instance = null;
| LOG.debug("JBoss Cache data manager stopped.");
| }
|
| public Cache<Long, Object> getCache() {
| return cache;
| }
|
| public static void main(String[] args) {
| GridJbossCacheManager cacheMgr = GridJbossCacheManager.getInstance();
| cacheMgr.start();
|
| }
| }
|
the exception stacktrace is
| java.lang.NullPointerException
| at org.jboss.cache.config.parsing.XmlConfigurationParser2x.getMBeanElement(XmlConfigurationParser2x.java:214)
| at org.jboss.cache.config.parsing.XmlConfigurationParser2x.parseStream(XmlConfigurationParser2x.java:104)
| at org.jboss.cache.config.parsing.XmlConfigurationParser2x.parseFile(XmlConfigurationParser2x.java:90)
| at org.jboss.cache.DefaultCacheFactory.createCache(DefaultCacheFactory.java:91)
| at org.jboss.cache.DefaultCacheFactory.createCache(DefaultCacheFactory.java:77)
| at com.cmc.facts.grid.GridJbossCacheManager.start(GridJbossCacheManager.java:80)
| at com.cmc.facts.grid.StartGridJbossCacheNode.main(StartGridJbossCacheNode.java:12)
|
I am using Jboss 3.1 in a standalone environment.
>From the stacktrace, its looking for MBeans. Why does it require Mbeans?
Please help me.
Thanks in advance
Sridhar
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241349#4241349
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241349
16 years, 9 months