1 Reply Latest reply on Aug 21, 2002 11:14 AM by David Jencks

    Physical connections not created in Conn Pool

    Jay Hombal Newbie

      Hi Friends,

      Thanks for helping me in reding the datasource from JNDI
      I got the solution. I can get context to PostgresDS

      now I have another issue, I think I am not getting any physical connection to the data base though u see the
      connection object refrence printed here below...

      my connection paramters to data base are also leasted below< ihave made sure that they are right. Also I donot think Jboss creates physical connections in the pool at the start up. as I could not see any postgres Thread running representing the min connections in the pool

      so whats going wrong here... The table for sure exists in the data base but not able to find it!!!! --> surprising

      i am totally a newbie to JBoss,.. so not able to figure out the probelm Ur help is sought..

      Thanks in advance
      Jay




      Connection Object --->
      org.jboss.resource.adapter.jdbc.local.LocalConnection@6f3870


      // stack trave
      com.myrio.tm.framework.exception.CException: Table not found: USERGROUP in statement [select * from usergroup]
      at com.myrio.tm.framework.al.CInitializationBean.createdefaultGroupAndUser(Unknown Source)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:664)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
      at org.jboss.ejb.Container.invoke(Container.java:705)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
      at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      at $Proxy992.createdefaultGroupAndUser(Unknown Source)
      at com.myrio.tm.framework.servlet.InitializingServlet.init(Unknown Source)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:916)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:808)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3266)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3395)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454)
      at org.jboss.web.catalina.EmbeddedCatalinaServiceSX.createWebContext(EmbeddedCatalinaServiceSX.java:321)
      at org.jboss.web.catalina.EmbeddedCatalinaServiceSX.performDeploy(EmbeddedCatalinaServiceSX.java:238)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:300)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:678)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:671)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:513)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:481)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy4.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:405)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:586)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:465)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:202)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      tvdata: init

      // end of stack trace

      //postgres-service.xml


      <!-- ======================================================= -->
      <!-- You must include a login module configuration named PostgresDbRealm
      in your login-conf.xml, here is an example for a
      ConfiguredIdentityLoginModule:

      <application-policy name = "PostgresDbRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
      <module-option name = "principal">yourprincipal</module-option>
      <module-option name = "userName">yourusername</module-option>
      <module-option name = "password">yourpassword</module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=PostgresDS</module-option>
      </login-module>

      </application-policy>

      NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
      module-option name = "managedConnectionFactoryName"
      must match the object name of the ConnectionManager you are configuring here.
      -->
      <!-- ===================================================================== -->
      <!--uncomment out this line if you are using the PostgresDbRealm above -->
      PostgresDbRealm

      <depends optional-attribute-name="ManagedConnectionFactoryName">
      <!--embedded mbean-->

      <!-- ========== Set the JndiName ======================= -->
      PostgresDS


      <config-property name="ConnectionURL" type="java.lang.String">jdbc:postgresql://10.130.0.66:5432/jay2</config-property>
      <config-property name="DriverClass" type="java.lang.String">org.postgresql.Driver</config-property>
      <!--set these only if you want only default logins, not through JAAS -->
      <config-property name="UserName" type="java.lang.String">myrio</config-property>
      <config-property name="Password" type="java.lang.String">myrio</config-property>


      <!--Below here are advanced properties -->
      <!--hack-->
      <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
      <!--real attributes-->


      <depends optional-attribute-name="ManagedConnectionPool">
      <!--embedded mbean-->

      10
      100
      5000
      15
      <!--criteria indicates if Subject (from security domain) or app supplied
      parameters (such as from getConnection(user, pw)) are used to distinguish
      connections in the pool. Choices are
      ByContainerAndApplication (use both),
      ByContainer (use Subject),
      ByApplication (use app supplied params only),
      ByNothing (all connections are equivalent, usually if adapter supports
      reauthentication)-->
      ByContainer


      <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
      <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=JaasSecurityManager
      java:/TransactionManager
      <!--make the rar deploy! hack till better deployment-->
      jboss.jca:service=RARDeployer



      // end of postgres-service.xml


      // login-config.xml

      <application-policy name="PostgresDbRealm">

      <login-module code="org.jboss.resource.security.ConfiguredIdentityLoginModule" flag="required">
      <module-option name="principal">postgres</module-option>
      <module-option name="userName">jay2</module-option>
      <module-option name="password">myrio</module-option>
      <module-option name="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=PostgresDS</module-option>
      </login-module>

      </application-policy>
      // end of login-config.xml

        • 1. Re: Physical connections not created in Conn Pool
          David Jencks Master

          The pool doesn't create the minimum number of connections until you ask for the first one, because in general it can't know who to connect as until you give it a request with user/pw.

          I think that since your are getting a "table not found" exception most likely you are successfully getting a connection to the db and that the problem lies in your sql. However, you don't show the code that is generating the exception, so it's hard to know what it means.