0 Replies Latest reply on Mar 21, 2003 3:56 PM by Sameer Dhawan

    postgress 7.3.1 data source not bound

    Sameer Dhawan Newbie

      postgress 7.3.1 and jboss-3.0.6_tomcat-4.1.18

      All,

      My Application is deployed as a EAR file and works perfectly with MySQL + JBOSS. But I am not able to connect to a postgress Data Source from JBOSS.

      Any help, suggestions will be appreciated.

      Is there an example/documentation of an ejb using a postgress data source from JBOSS ?

      Sameer.


      My file configurations are as follows -


      standardjbosscmp-jdbc.xml
      --------------------------

      java:/PostgresDS
      <datasource-mapping>PostgreSQL</datasource-mapping>

      <create-table>false</create-table>
      <remove-table>false</remove-table>
      <read-only>false</read-only>
      <time-out>300</time-out>
      <pk-constraint>true</pk-constraint>
      <fk-constraint>false</fk-constraint>
      <row-locking>true</row-locking>
      <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
      <read-ahead>
      on-load
      <page-size>1000</page-size>
      <eager-load-group>*</eager-load-group>
      </read-ahead>
      <list-cache-max>1000</list-cache-max>



      login-config.xml
      ----------------
      <!-- PostgresDbRealm
      -->
      <application-policy name = "PostgresDbRealm">

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

      </application-policy>


      postgres-service.xml from Deploy directory
      -------------------------------------------
      PostgresDS


      <config-property name="ConnectionURL" type="java.lang.String">jdbc:postgresql:BonusDB</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">DHAWAS</config-property>
      <config-property name="Password" type="java.lang.String"></config-property>





      jbosscmp-jdbc.xml
      -----------------
      <?xml version="1.0" encoding="UTF-8"?>
      <jbosscmp-jdbc>

      java:/PostgresDS
      <datasource-mapping>PostgreSQL</datasource-mapping>

      <enterprise-beans>

      no description
      <display-name>BonusBean</display-name>
      <ejb-name>BonusBean</ejb-name>
      <table-name>bonus</table-name>
      Beans.BonusHome
      Beans.Bonus
      <ejb-class>Beans.BonusBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      False
      <resource-ref>
      <res-ref-name>jdbc/BonusDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      </enterprise-beans>
      </jbosscmp-jdbc>


      server.log file starts giving error's at
      ----------------------------------------

      2003-03-21 15:20:53,251 INFO [org.jboss.system.server.Server] JBoss (MX MicroKernel) [3.0.6 (CVSTag=JBoss_3_0_6 Date=200301260037)] Started in 0m:33s:729ms
      2003-03-21 15:21:32,136 INFO [STDOUT] setEntityContext method
      2003-03-21 15:21:32,146 INFO [STDOUT] Create
      2003-03-21 15:21:32,717 INFO [STDOUT] setEntityContext method
      2003-03-21 15:21:32,717 INFO [STDOUT] Find by primary key
      2003-03-21 15:21:32,767 ERROR [STDERR] java.sql.SQLException: Table not found: BONUS in statement [SELECT socsec FROM bonus WHERE socsec = '000' ]
      2003-03-21 15:21:32,767 ERROR [STDERR] at org.hsqldb.Trace.getError(Trace.java:180)
      2003-03-21 15:21:32,767 ERROR [STDERR] at org.hsqldb.Result.(Result.java:175)
      2003-03-21 15:21:32,767 ERROR [STDERR] at org.hsqldb.jdbcConnection.executeHSQL(jdbcConnection.java:907)
      2003-03-21 15:21:32,777 ERROR [STDERR] at org.hsqldb.jdbcConnection.execute(jdbcConnection.java:718)
      2003-03-21 15:21:32,777 ERROR [STDERR] at org.hsqldb.jdbcStatement.fetchResult(jdbcStatement.java:686)
      2003-03-21 15:21:32,777 ERROR [STDERR] at org.hsqldb.jdbcStatement.executeQuery(jdbcStatement.java:68)
      2003-03-21 15:21:32,777 ERROR [STDERR] at org.hsqldb.jdbcPreparedStatement.executeQuery(jdbcPreparedStatement.java:133)
      2003-03-21 15:21:32,777 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.executeQuery(LocalPreparedStatement.java:289)
      2003-03-21 15:21:32,777 ERROR [STDERR] at Beans.BonusBean.ejbFindByPrimaryKey(BonusBean.java:98)
      2003-03-21 15:21:32,777 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      2003-03-21 15:21:32,777 ERROR [STDERR] at org.jboss.ejb.plugins.BMPPersistenceManager.callFinderMethod(BMPPersistenceManager.java:638)
      2003-03-21 15:21:32,777 ERROR [STDERR] at org.jboss.ejb.plugins.BMPPersistenceManager.findEntity(BMPPersistenceManager.java:330)
      2003-03-21 15:21:32,777 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntity(CachedConnectionInterceptor.java:301)
      2003-03-21 15:21:32,777 ERROR [STDERR] at org.jboss.ejb.EntityContainer.find(EntityContainer.java:690)
      2003-03-21 15:21:32,777 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      2003-03-21 15:21:32,777 ERROR [STDERR] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1119)
      2003-03-21 15:21:32,777 ERROR [STDERR] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:207)
      2003-03-21 15:21:32,777 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
      2003-03-21 15:21:32,777 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:90)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:228)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:62)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:730)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
      2003-03-21 15:21:32,787 ERROR [STDERR] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
      2003-03-21 15:21:32,797 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
      2003-03-21 15:21:32,797 ERROR [STDERR] at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:198)
      2003-03-21 15:21:32,797 ERROR [STDERR] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      2003-03-21 15:21:32,797 ERROR [STDERR] at $Proxy22.findByPrimaryKey(Unknown Source)
      2003-03-21 15:21:32,797 ERROR [STDERR] at Beans.CalcBean.getRecord(CalcBean.java:39)
      2003-03-21 15:21:32,797 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      2003-03-21 15:21:32,797 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
      2003-03-21 15:21:32,797 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      2003-03-21 15:21:32,797 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
      2003-03-21 15:21:32,797 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
      2003-03-21 15:21:32,797 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:228)
      2003-03-21 15:21:32,797 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:92)
      2003-03-21 15:21:32,797 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
      2003-03-21 15:21:32,797 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
      2003-03-21 15:21:32,797 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
      2003-03-21 15:21:32,807 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:712)
      2003-03-21 15:21:32,807 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      2003-03-21 15:21:32,807 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
      2003-03-21 15:21:32,807 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
      2003-03-21 15:21:32,807 ERROR [STDERR] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
      2003-03-21 15:21:32,807 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
      2003-03-21 15:21:32,807 ERROR [STDERR] at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
      2003-03-21 15:21:32,807 ERROR [STDERR] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      2003-03-21 15:21:32,807 ERROR [STDERR] at $Proxy24.getRecord(Unknown Source)
      2003-03-21 15:21:32,807 ERROR [STDERR] at JBonusBean.genXML(JBonusBean.java:68)
      2003-03-21 15:21:32,807 ERROR [STDERR] at JBonusBean.getBonusAmt(JBonusBean.java:52)
      2003-03-21 15:21:32,807 ERROR [STDERR] at org.apache.jsp.bonus_jsp._jspService(bonus_jsp.java:99)
      2003-03-21 15:21:32,807 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
      2003-03-21 15:21:32,807 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      2003-03-21 15:21:32,807 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
      2003-03-21 15:21:32,817 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
      2003-03-21 15:21:32,817 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
      2003-03-21 15:21:32,817 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      2003-03-21 15:21:32,827 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      2003-03-21 15:21:32,827 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      2003-03-21 15:21:32,827 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
      2003-03-21 15:21:32,827 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      2003-03-21 15:21:32,827 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      2003-03-21 15:21:32,827 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      2003-03-21 15:21:32,827 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      2003-03-21 15:21:32,827 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      2003-03-21 15:21:32,827 ERROR [STDERR] at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      2003-03-21 15:21:32,827 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      2003-03-21 15:21:32,827 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      2003-03-21 15:21:32,827 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      2003-03-21 15:21:32,827 ERROR [STDERR] at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
      2003-03-21 15:21:32,827 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      2003-03-21 15:21:32,837 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      2003-03-21 15:21:32,837 ERROR [STDERR] at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      2003-03-21 15:21:32,837 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      2003-03-21 15:21:32,837 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      2003-03-21 15:21:32,837 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      2003-03-21 15:21:32,837 ERROR [STDERR] at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
      2003-03-21 15:21:32,837 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      2003-03-21 15:21:32,837 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      2003-03-21 15:21:32,837 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      2003-03-21 15:21:32,837 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      2003-03-21 15:21:32,837 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      2003-03-21 15:21:32,837 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      2003-03-21 15:21:32,837 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      2003-03-21 15:21:32,837 ERROR [STDERR] at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
      2003-03-21 15:21:32,847 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
      2003-03-21 15:21:32,847 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
      2003-03-21 15:21:32,847 ERROR [STDERR] at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
      2003-03-21 15:21:32,847 ERROR [STDERR] at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
      2003-03-21 15:21:32,847 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484)
      2003-03-21 15:21:32,847 ERROR [org.jboss.web.localhost.Engine] StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
      org.apache.jasper.JasperException
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
      at java.lang.Thread.run(Thread.java:484)