0 Replies Latest reply on Feb 12, 2003 2:50 PM by RV

    MySQL & JBoss: UndeclaredThrowableException

    RV Newbie

      System Configuration

      WinXP Pro, jboss-3.0.4, Apache-2.0.44, PHP-4.3.0, JConnector 3.0

      =======

      using mysql-connector-java-3.0-nightly-20030123-bin.jar which is in

      C:\jdk\jre\lib\ext
      =======
      == Note ==
      JBoss - starts up with only 1 error, shown below.
      - shuts down with no problem.
      PHP - successfully access a MySQL database, and is able to query and display data
      - succesfully uses java to retrieve functions such as java.version

      &java.text.SimpleDateFormat

      But I get this error when trying to use jboss to retrieve data from the MySQL

      database
      Warning: java.lang.Exception: UserClient.getUsers >> exception:
      java.lang.reflect.UndeclaredThrowableException in C:\Program Files\Apache

      Group\Apache2\htdocs\index.php on line 156

      =======
      == line 156 in index.php ==
      $wddx = $java_obj->getUsers()

      =======
      == Warning message I get while JBoss starts up ==

      14:43:18,343 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean ope
      ration 'checkIncompleteDeployments()'
      Cause: Incomplete Deployment listing:
      Packages waiting for a deployer:

      Incompletely deployed packages:

      MBeans waiting for classes:

      MBeans waiting for other MBeans:
      [ObjectName: jboss.jca:service=LocalTxCM,name=jdbc/phpa/Users
      state: CONFIGURED
      I Depend On: jboss.jca:service=LocalTxDS,name=jdbc/phpa/Users
      jboss.jca:service=LocalTxPool,name=PHPaMySQLdbDS
      jboss.jca:service=CachedConnectionManager
      jboss.security:service=JaasSecurityManager
      jboss.jca:service=RARDeployer

      Depends On Me: , ObjectName: jboss.jca:service=LocalTxDS,name=jdbc/phpa/Users
      state: CONFIGURED
      I Depend On: jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC
      Wrapper
      jboss:service=MySQL

      Depends On Me: jboss.jca:service=LocalTxCM,name=jdbc/phpa/Users
      ]
      14:43:18,437 INFO [URLDeploymentScanner] Started
      14:43:18,437 INFO [MainDeployer] Deployed package: file:/C:/jboss/server/defaul
      t/conf/jboss-service.xml
      14:43:18,437 INFO [Server] JBoss (MX MicroKernel) [3.0.4 Date:200211021607] Sta
      rted in 0m:33s:47ms


      ====================
      phpa_mysql-service.xml



      <!-- Include a login module configuration named HsqlDbRealm.
      Update your login-conf.xml, here is an example for a
      ConfiguredIdentityLoginModule:
      -->
      <application-policy name = "MySQLDbRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"

      flag = "required">
      <module-option name = "principal">developer</module-option>
      <module-option name = "userName">root</module-option>
      <module-option name = "password"></module-option>
      <module-option name =

      "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=jdbc/phpa/Users</mod

      ule-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 DB2DbRealm above -->
      MySQLDbRealm


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


      jdbc/phpa/Users


      <config-property name="ConnectionURL"

      type="java.lang.String">jdbc:mysql://localhost:3306/mysqldb</config-property>
      <config-property name="DriverClass"

      type="java.lang.String">com.mysql.jdbc.Driver</config-property>
      <config-property name="UserName" type="java.lang.String">____</config-property>
      <config-property name="Password" type="java.lang.String"></config-property>



      <!--Below here are advanced properties -->
      <!--hack-->
      <depends

      optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBos

      s LocalTransaction JDBC Wrapper
      jboss:service=MySQL



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


      0
      50
      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=CachedConnection

      Manager

      <depends

      optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecu

      rityManager

      java:/TransactionManager

      <!--make the rar deploy! hack till better deployment-->
      jboss.jca:service=RARDeployer