Derby
  1. Derby
  2. DERBY-3887

Embedded Derby fails under JBoss because of JMX-related conflicts

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 10.4.2.0
    • Fix Version/s: 10.4.2.1, 10.5.2.0, 10.6.1.0
    • Component/s: JMX
    • Labels:
      None
    • Environment:
      Windows XP SP2, JBoss 4.2.3.GA, Embedder Derby 10.4.2.0.
      Also tested with JBoss 5.0.0.CR2 with the same result.
    • Issue & fix info:
      High Value Fix
    • Bug behavior facts:
      Regression

      Description

      I'm trying to use embedded Derby as datasource for JBoss and found that it fails with error.
      See stacktrace below.
      It looks like JMX module in Derby conflicts with JBoss JMX.
      After I have disabled Derby JMX removing "derby.module.mgmt.jmx=org.apache.derby.impl.services.jmx.JMXManagementService" line from org\apache\derby\modules.properties file in derby.jar JAR, the bug disappears.

      How to reproduce the issue:
      1). Install JBoss
      2). Copy jboss\docs\examples\varia\derby-plugin.jar into jboss\server\default\lib
      3). Copy Derby JAR (derby.jar) into jboss\server\default\lib
      4). Copy datasource file into jboss\server\default\lib
      5). Start JBoss using bin\run.bat

      Datasource file (zzzzz-ds.xml):

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

      <!DOCTYPE datasources
      PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
      "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">

      <datasources>
      <local-tx-datasource>
      <jndi-name>zzzzzDatasource</jndi-name>
      <driver-class>org.apache.derby.jdbc.EmbeddedDriver</driver-class>
      <!--connection-url>jdbc:derby:$

      {jboss.server.data.dir} {/}derby{/}

      zzzzz;create=true</connection-url-->
      <connection-url>jdbc:derby:IGNORED</connection-url>
      <user-name>IGNORED</user-name>
      <password>IGNORED</password>
      <min-pool-size>5</min-pool-size>
      <max-pool-size>20</max-pool-size>
      <idle-timeout-minutes>5</idle-timeout-minutes>
      <track-statements/>
      <depends>jboss:service=zzzzzDerbyDB</depends>
      </local-tx-datasource>

      <!-- Don't forget to install derby-plugin.jar and derby*.jar into jboss/server/default/lib -->
      <mbean code="org.jboss.jdbc.DerbyDatabase" name="jboss:service=zzzzzDerbyDB">
      <attribute name="Database">zzzzz</attribute>
      <attribute name="User">sa</attribute>
      <attribute name="Password"></attribute>
      </mbean>

      </datasources>
      ===}}}

      Part of JBoss log with error and stacktrace:

      ==={{{
      02:40:28,031 INFO [DerbyDatabase] starting derby jdbc:derby:C:\opt\jboss-4.2.3.GA\server\default\data/derby/zzzzz;create=true
      02:40:28,468 WARN [ServiceController] Problem starting service jboss:service=zzzzzDerbyDB
      java.lang.ExceptionInInitializerError
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:247)
      at org.jboss.jdbc.DerbyDatabase.getConnection(DerbyDatabase.java:222)
      at org.jboss.jdbc.DerbyDatabase.startService(DerbyDatabase.java:189)
      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:597)
      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:597)
      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:304)
      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:597)
      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 $Proxy42.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.GeneratedMethodAccessor21.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      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:597)
      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:597)
      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:304)
      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:597)
      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:619)
      Caused by: javax.management.JMRuntimeException: Failed to load MBeanServerBuilder class org.jboss.mx.server.MBeanServerBuilderImpl: java.lang.ClassNotFoundException: org/jboss/mx/server/MBeanServerBuilderImpl
      at javax.management.MBeanServerFactory.checkMBeanServerBuilder(MBeanServerFactory.java:480)
      at javax.management.MBeanServerFactory.getNewMBeanServerBuilder(MBeanServerFactory.java:511)
      at javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:298)
      at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:213)
      at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:174)
      at sun.management.ManagementFactory.createPlatformMBeanServer(ManagementFactory.java:302)
      at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:504)
      at org.apache.derby.impl.services.jmx.JMXManagementService$3.run(Unknown Source)
      at org.apache.derby.impl.services.jmx.JMXManagementService$3.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.apache.derby.impl.services.jmx.JMXManagementService.findServer(Unknown Source)
      at org.apache.derby.impl.services.jmx.JMXManagementService.boot(Unknown Source)
      at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
      at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
      at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
      at org.apache.derby.iapi.services.monitor.Monitor.startSystemModule(Unknown Source)
      at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(Unknown Source)
      at org.apache.derby.impl.services.monitor.FileMonitor.<init>(Unknown Source)
      at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Unknown Source)
      at org.apache.derby.iapi.jdbc.JDBCBoot.boot(Unknown Source)
      at org.apache.derby.jdbc.EmbeddedDriver.boot(Unknown Source)
      at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(Unknown Source)
      ... 110 more
      Caused by: java.lang.ClassNotFoundException: org/jboss/mx/server/MBeanServerBuilderImpl
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:169)
      at javax.management.MBeanServerFactory.loadBuilderClass(MBeanServerFactory.java:427)
      at javax.management.MBeanServerFactory.checkMBeanServerBuilder(MBeanServerFactory.java:465)
      ... 131 more
      02:40:29,250 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
      02:40:29,562 INFO [A] Bound to JNDI name: queue/A
      02:40:29,562 INFO [B] Bound to JNDI name: queue/B
      02:40:29,562 INFO [C] Bound to JNDI name: queue/C
      02:40:29,562 INFO [D] Bound to JNDI name: queue/D
      02:40:29,578 INFO [ex] Bound to JNDI name: queue/ex
      02:40:29,593 INFO [testTopic] Bound to JNDI name: topic/testTopic
      02:40:29,593 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
      02:40:29,609 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
      02:40:29,609 INFO [testQueue] Bound to JNDI name: queue/testQueue
      02:40:29,656 INFO [UILServerILService] JBossMQ UIL service available at : /127.0.0.1:8093
      02:40:29,703 INFO [DLQ] Bound to JNDI name: queue/DLQ
      02:40:29,875 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
      02:40:30,093 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
      02:40:30,250 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

      — MBeans waiting for other MBeans —
      ObjectName: jboss:service=zzzzzDerbyDB
      State: FAILED
      Reason: java.lang.ExceptionInInitializerError
      Depends On Me:
      jboss.jca:service=ManagedConnectionFactory,name=zzzzzDatasource

      — MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM —
      ObjectName: jboss:service=zzzzzDerbyDB
      State: FAILED
      Reason: java.lang.ExceptionInInitializerError
      Depends On Me:
      jboss.jca:service=ManagedConnectionFactory,name=zzzzzDatasource

      02:40:30,656 INFO [Http11AprProtocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
      02:40:30,687 INFO [AjpAprProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
      02:40:30,703 INFO [Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] Started in 23s:375ms

      1. Derby3887.java
        0.5 kB
        Kathey Marsden
      2. derby-3887_test_attempt_diff.txt
        5 kB
        Kathey Marsden
      3. derby-3887_diff.txt
        3 kB
        Kathey Marsden

        Issue Links

          Activity

          Gavin made changes -
          Workflow jira [ 12443136 ] Default workflow, editable Closed status [ 12801636 ]
          Kathey Marsden made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Knut Anders Hatlen made changes -
          Link This issue relates to DERBY-4634 [ DERBY-4634 ]
          Kathey Marsden made changes -
          Bug behavior facts [Regression]
          Kathey Marsden made changes -
          Fix Version/s 10.5.1.2 [ 12313870 ]
          Fix Version/s 10.5.2.0 [ 12314116 ]
          Dag H. Wanvik made changes -
          Issue & fix info [Patch Available] [High Value Fix]
          Kathey Marsden made changes -
          Attachment derby-3887_test_attempt_diff.txt [ 12411012 ]
          Kathey Marsden made changes -
          Attachment Derby3887.java [ 12410995 ]
          Kathey Marsden made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 10.4.2.1 [ 12313401 ]
          Fix Version/s 10.5.1.2 [ 12313870 ]
          Fix Version/s 10.6.0.0 [ 12313727 ]
          Resolution Fixed [ 1 ]
          Kathey Marsden made changes -
          Derby Info [Patch Available]
          Kathey Marsden made changes -
          Attachment derby-3887_diff.txt [ 12410502 ]
          Kathey Marsden made changes -
          Assignee Kathey Marsden [ kmarsden ]
          Kathey Marsden made changes -
          Derby Categories [High Value Fix]
          Jeremy Gustie made changes -
          Link This issue relates to DERBY-3745 [ DERBY-3745 ]
          Kristian Waagan made changes -
          Link This issue relates to DERBY-3429 [ DERBY-3429 ]
          Rick Hillegas made changes -
          Field Original Value New Value
          Summary Embedded Derby fails while using in JBoss Embedded Derby fails under JBoss because of JMX-related conflicts
          Valery Khromov created issue -

            People

            • Assignee:
              Kathey Marsden
              Reporter:
              Valery Khromov
            • Votes:
              4 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development