7 Replies Latest reply on Jul 25, 2002 12:42 AM by David Jencks

    jboss-3.1.0alpha - postgres configuration

    Iulian Musat Newbie

      Hi !

      I have problems configuring postgres datasource in the jboss-3.1.0alpha, cvs head as today.

      I'm using a file like the one from jboss-all/build/output/jboss-3.1.0alpha/docs/examples/jca/postgres-service.xml
      and I got this error:

      18:19:38,145 INFO [ServiceConfigurator] Problem configuring service jboss.jca:service=LocalTxDS,name=PostgresDS
      org.jboss.deployment.DeploymentException: No Attribute found with name: JndiName
      at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:347)
      at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:188)
      at org.jboss.system.ServiceConfigurator.processDependency(ServiceConfigurator.java:452)
      at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:365)
      at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:188)
      at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:131)
      at org.jboss.system.ServiceController.install(ServiceController.java:217)
      at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy5.install(Unknown Source)
      at org.jboss.deployment.SARDeployer.create(SARDeployer.java:227)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:759)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:633)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:599)
      at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:381)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:576)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:449)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:187)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:197)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:177)
      18:19:38,295 WARN [ServiceController] jboss.jca:service=LocalTxDS,name=PostgresDS does not implement any Service methods

      Same file works with the same 3.1.0alpha, but an older (June 12) cvs head .

      Does anyone knows anything about this problem ?

      Regards,
      Iulian

        • 1. Re: jboss-3.1.0alpha - postgres configuration
          David Jencks Master

          I moved the JndiName attribute from the RARDeployment mbean up one level to the ConnectionManager mbean. Apparently I didn't update all the configuration files... its always something.

          For easier configuration, try the new postgres-ds.xml file. which should work with the new format.

          • 2. Re: jboss-3.1.0alpha - postgres configuration
            Jason Essington Newbie

            I had this same problem today :-/

            My question is how does one control the connection pool min/max with the new postgres-ds.xml configuration?
            How about security?

            thanks

            jason

            • 3. Re: jboss-3.1.0alpha - postgres configuration
              Jason Essington Newbie

              So I have tried creating a postgres-ds.xml file from the example. It creates the datasource and binds it to the java: context, but no I get a:

              java.lang.IllegalAccessError: try to access class org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListener from class org.jboss.resource.connectionmanager.LocalTxConnectionManager
              at org.jboss.resource.connectionmanager.LocalTxConnectionManager.registerConnectionEventListener(LocalTxConnectionManager.java:229)
              at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:534)
              at org.jboss.resource.connectionmanager.LocalTxConnectionManager.getManagedConnection(LocalTxConnectionManager.java:224)
              at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:595)
              at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:874)
              at org.jboss.resource.adapter.jdbc.local.LocalDataSource.getConnection(LocalDataSource.java:102)
              at com.grcs.hedgehog.ejb.session.GetDBDataBean.getResults(GetDBDataBean.java:104)
              at com.grcs.hedgehog.ejb.session.GetDBDataBean.getResults(GetDBDataBean.java:72)
              at java.lang.reflect.Method.invoke(Native Method)


              exception.

              How do I go about configuring this datasource to allow access from my ejbs? more specifically, which config file do I need to add information to, to allow access to the datasource?

              thanks
              jason

              • 4. Re: jboss-3.1.0alpha - postgres configuration
                David Jencks Master

                I did not experience this particular illegal access error, but another similar one (the -ds.xml stuff worked fine for me, that's why I checked it in). I think there may be something wrong with the current jboss classloaders handling of inner classes. Until this is fixed, try making the ConnectionEventListener inner class public. (worked for me on analogous problem)

                I'll try to come up with a complete generic sample-ds.xml showing all the possibilities later today.

                david jencks

                • 5. Re: jboss-3.1.0alpha - postgres configuration
                  Jason Essington Newbie

                  actually the -ds.xml works nicely!
                  Once I found the jboss-ds_1_0.dtd and added the line

                  <security-domain>PostgresDbRealm</security-domain>

                  to the postgres-ds.xml file (to match the realm set up in my login-config.xml file) everything worked just fine.

                  for anyone who is interested the dtd file is in
                  {jboss-src-home}/connector/src/resources/stylesheets/jboss-ds_1_0.dtd

                  or here:
                  http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jbosscx/src/resources/stylesheets/jboss-ds_1_0.dtd
                  in the sf cvs.

                  it contains all the available options for the *-ds.xml files

                  david, his is, by the way, a much nicer (cleaner) config than the *-service.xml files. It was just different and confused me for about half a day :-)

                  thanks
                  jason

                  • 6. Re: jboss-3.1.0alpha - postgres configuration
                    Iulian Musat Newbie

                    Thank you !

                    It works just fine for now.

                    -Iulian

                    • 7. Re: jboss-3.1.0alpha - postgres configuration
                      David Jencks Master

                      There is now a complete generic-ds.xml file showing (I think) all the things you can set for both local and xa datasources.

                      My intention for the *-service.xml mbean configs for adapters/datasources was always to provide a simpler configuration, it just took me a really long time to get it written.