3 Replies Latest reply on Nov 10, 2008 5:04 PM by Peter Johnson

    JPA with hypersonice db

    Brad Fach Newbie

      Hello,

      I am trying to deploy to separate datasources in jboss (both hypersonic db) for testing. We have already done this for oracle however I am getting an error when using hypersonic.

      The first datasource is for application data, the second for jboss messaging.

      I get the following when i start up jboss

      2008-11-07 11:38:22,987 WARN [org.jboss.system.ServiceController] Problem starting service jboss.messaging:service=JMSUserManager
      org.jboss.util.NestedSQLException: No matching credentials in Subject!; - nested throwable: (org.jboss.resource.JBossResourceException: No matching credentials in Subject!)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
      at org.jboss.messaging.core.impl.JDBCSupport.createSchema(JDBCSupport.java:280)
      at org.jboss.messaging.core.impl.JDBCSupport.start(JDBCSupport.java:160)
      at org.jboss.jms.server.plugin.JDBCJMSUserManager.start(JDBCJMSUserManager.java:98)
      at org.jboss.jms.server.plugin.JDBCJMSUserManagerService.startService(JDBCJMSUserManagerService.java:78)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:196)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:995)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at org.jboss.system.ServiceController.start(ServiceController.java:435)
      at org.jboss.system.ServiceController.start(ServiceController.java:435)
      at org.jboss.system.ServiceController.start(ServiceController.java:435)
      at org.jboss.system.ServiceController.start(ServiceController.java:435)
      at org.jboss.system.ServiceController.start(ServiceController.java:435)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy51.start(Unknown Source)
      at org.jboss.deployment.XSLSubDeployer.start(XSLSubDeployer.java:197)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy9.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
      at org.jboss.Main.boot(Main.java:200)
      at org.jboss.Main$1.run(Main.java:508)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.resource.JBossResourceException: No matching credentials in Subject!
      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnectionFactory.getConnectionProperties(BaseWrapperManagedConnectionFactory.java:381)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:149)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:577)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:262)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:538)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:315)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
      ... 119 more

      The hsqldb.xml is as follows

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

      <!-- The Hypersonic embedded database JCA connection factory config -->

      <!-- $Id: hsqldb-ds.xml 63175 2007-05-21 16:26:06Z rrajesh $ -->


      <local-tx-datasource>

      <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
      <jndi-name>DefaultDS</jndi-name>

      <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>

      <!-- The driver class -->
      <driver-class>org.hsqldb.jdbcDriver</driver-class>

      <!-- The login and password -->
      <user-name>sa</user-name>


      <min-pool-size>5</min-pool-size>
      <max-pool-size>20</max-pool-size>
      <idle-timeout-minutes>0</idle-timeout-minutes>

      <security-domain>HsqlDbRealm</security-domain>
      <prepared-statement-cache-size>32</prepared-statement-cache-size>

      <type-mapping>Hypersonic SQL</type-mapping>


      </local-tx-datasource>

      <local-tx-datasource>

      <!-- Datasources are not available outside the virtual machine -->
      <jndi-name>JBossDS</jndi-name>


      <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}JBossDB</connection-url>

      <!-- The driver class -->
      <driver-class>org.hsqldb.jdbcDriver</driver-class>

      <!-- The login and password -->
      <user-name>sa</user-name>


      <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
      <min-pool-size>5</min-pool-size>
      <max-pool-size>20</max-pool-size>

      <idle-timeout-minutes>0</idle-timeout-minutes>

      <security-domain>HsqlDbRealm</security-domain>

      <prepared-statement-cache-size>32</prepared-statement-cache-size>

      <type-mapping>Hypersonic SQL</type-mapping>


      </local-tx-datasource>


      localDB
      true



      jbossDB
      true




      When i check the jmx console, both datasources are deployed however there is an issue with messaging using this datasource.

      Any help would be greatly appreciated.

      Thanks,

        • 1. Re: JPA with hypersonice db
          Peter Johnson Master

           

          When i check the jmx console, both datasources are deployed however there is an issue with messaging using this datasource.


          Then why did you post the *-ds.xml file, and not the messaging configuration file? (By the way, what version of JBossAS are you using, and did you install JBoss Messaging and if so which version.)

          Also, when posting XML text, remember to enclose your XML text in UBBCode "code" tags - you can do this by selecting the XML text and clicking the Code button above the editor window. Also, click the Preview button to ensure that the formatting is correct and the XML text shows up before posting.

          • 2. Re: JPA with hypersonice db
            Brad Fach Newbie

            Thanks Peter.

            Sorry i totally forgot to post the version. JBoss4.2.2.GA with messaging 1.4.0.SP3.


            
            <?xml version="1.0" encoding="UTF-8"?>
            
            <!--
             Hypersonic persistence deployment descriptor.
            
             DO NOT USE HYPERSONIC IN PRODUCTION or in a clustered environment- Hypersonic does not have transaction isolation
            
             $Id: hsqldb-persistence-service.xml 3339 2007-11-16 20:48:08Z clebert.suconic@jboss.com $
             -->
            
            <server>
            
             <!-- Persistence Manager MBean configuration
             ======================================= -->
            
             <mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService"
             name="jboss.messaging:service=PersistenceManager"
             xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
            
             <depends>jboss.jca:service=DataSourceBinding,name=JBossDS</depends>
            
             <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
            
             <!-- The datasource to use for the persistence manager -->
            
             <attribute name="DataSource">java:/JBossDS</attribute>
            
             <!-- If true will attempt to create tables and indexes on every start-up -->
            
             <attribute name="CreateTablesOnStartup">true</attribute>
            
             <!-- If true then will use JDBC batch updates -->
            
             <attribute name="UsingBatchUpdates">false</attribute>
            
             <!-- The maximum number of parameters to include in a prepared statement -->
            
             <attribute name="MaxParams">500</attribute>
             </mbean>
            
             <!-- Messaging Post Office MBean configuration
             ========================================= -->
            
             <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
             name="jboss.messaging:service=PostOffice"
             xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
            
             <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
            
             <depends>jboss.jca:service=DataSourceBinding,name=JBossDS</depends>
            
             <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
            
             <!-- The name of the post office -->
            
             <attribute name="PostOfficeName">JMS post office</attribute>
            
             <!-- The datasource used by the post office to access it's binding information -->
            
             <attribute name="DataSource">java:/JBossDS</attribute>
            
             <!-- If true will attempt to create tables and indexes on every start-up -->
            
             <attribute name="CreateTablesOnStartup">true</attribute>
            
             <!-- This post office is NON CLUSTERED - do not use clustering with Hypersonic!! -->
            
             <attribute name="Clustered">false</attribute>
             </mbean>
            
             <!-- Messaging JMS User Manager MBean config
             ======================================= -->
            
             <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
             name="jboss.messaging:service=JMSUserManager"
             xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
            
             <depends>jboss.jca:service=DataSourceBinding,name=JBossDS</depends>
            
             <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
            
             <attribute name="DataSource">java:/JBossDS</attribute>
            
             <attribute name="CreateTablesOnStartup">true</attribute>
            
             <attribute name="SqlProperties"><![CDATA[
            POPULATE.TABLES.1 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('guest', 'guest')
            POPULATE.TABLES.2 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('j2ee', 'j2ee')
            POPULATE.TABLES.3 = INSERT INTO JBM_USER (USER_ID, PASSWD, CLIENTID) VALUES ('john', 'needle', 'DurableSubscriberExample')
            POPULATE.TABLES.4 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('nobody', 'nobody')
            POPULATE.TABLES.5 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('dynsub', 'dynsub')
            POPULATE.TABLES.6 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('guest','guest')
            POPULATE.TABLES.7 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('j2ee','guest')
            POPULATE.TABLES.8 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('john','guest')
            POPULATE.TABLES.9 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('subscriber','john')
            POPULATE.TABLES.10 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','john')
            POPULATE.TABLES.11 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','dynsub')
            POPULATE.TABLES.12 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','john')
            POPULATE.TABLES.13 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','dynsub')
            POPULATE.TABLES.14 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('noacc','nobody')
             ]]></attribute>
             </mbean>
            
            </server>


            • 3. Re: JPA with hypersonice db
              Peter Johnson Master

              I looked up the error message. Apparently you also set up a login module, which is referenced by:

              <security-domain>HsqlDbRealm</security-domain>


              The error has do do with that login module. Have you changed that login module? If so, please post it. If not, are you sure you want to use that login module?