Hi Vicky,

I don't have any problem with my <connection-factory-impl> class. It works 
nicely, I got all the properties that I want.

The problem is with JBoss loading the number of minimum connections as declared 
in -ds.xml file

<connection-factories>
  |     <no-tx-connection-factory>
  |         <jndi-name>SimplewireDS</jndi-name> 
  |         <rar-name>65-mitto-ra-smpp.rar</rar-name>
  |         <connection-definition>
  |              com.smsc.mitto.ra.smpp.SMPPConnectionFactory
  |         </connection-definition>
  |     <config-property name="Name" 
type="java.lang.String">Mitto-1</config-property>
  |         <config-property name="Server" 
type="java.lang.String">192.168.2.115</config-property>
  |         <config-property name="Port" 
type="java.lang.Integer">9999</config-property>
  |     <config-property name="Username" 
type="java.lang.String">binh</config-property>
  |     <config-property name="Password" 
type="java.lang.String">binh</config-property>
  |         <min-pool-size>2</min-pool-size>
  |         <max-pool-size>4</max-pool-size>
  |     <idle-timeout-minutes>525600</idle-timeout-minutes> <!-- if idle for a 
year reconnect... -->
  |     <blocking-timeout-millis>100</blocking-timeout-millis>
  |     <prefill>true</prefill>
  |     </no-tx-connection-factory>
  | </connection-factories>     

With the above xml, I expect JBoss to automatically create 2 fully functional 
connections to 192.168.2.115 for me using other connection request infor 
provided. Though, when I try to use these 2 connections, I always got null 
pointer exception.

I debuged through JBoss codes and found that JBoss does not make use of the 
connection request information also declared in the -ds.xml like server, port, 
username, password etc, when it tries to create connections to satisfy this 
minumum connection properties (it does load the property in) .... The problem 
lies in the fillToMin method of InternalManagedConnectionPool class of JBoss, 
where it uses null for ConnectionRequestInfo when trying to make the 
connections. Could you please check that for me ?

Thank you very much for your help,

Best regards,

Binh

----------
defaultCRI is null in the below codes
    public void fillToMin() {
  |     while (true) {
  |         // Get a permit - avoids a race when the pool is nearly full
  |         // Also avoids unnessary fill checking when all connections are
  |         // checked out
  |         try {
  |             if (permits.attempt(poolParams.blockingTimeout)) {
  |                 try {
  |                     if (shutdown.get())
  |                         return;
  | 
  |                     // We already have enough connections
  |                     if (getMinSize()
  |                             - connectionCounter.getGuaranteedCount() <= 0)
  |                         return;
  | 
  |                     // Create a connection to fill the pool
  |                     try {
  |                         ConnectionListener cl = 
createConnectionEventListener(
  |                                 defaultSubject, defaultCri);
  |                         synchronized (cls) {
  |                             if (trace)
  |                                 log.trace("Filling pool cl=" + cl);
  |                             cls.add(cl);
  |                         }
  |                     } catch (ResourceException re) {
  |                         log.warn("Unable to fill pool ", re);
  |                         return;
  |                     }
  |                 } finally {
  |                     permits.release();
  |                 }
  |             }
  |         } catch (InterruptedException ignored) {
  |             log.trace("Interrupted while requesting permit in fillToMin");
  |         }
  |     }
  |     }

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4130247#4130247

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4130247
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to