10 Replies Latest reply: Feb 1, 2011 1:17 PM by Anton RSS

    MPL Listener cannot initialize JDBC connections in Framework 4.0.2

    Anton
      Hello!

      I'm trying to configure loading of initial measurements via XML files placed in a certain folder to Oracle Meter Data Management 2.0.0.1 by XAI engine.
      Sun Server: Solaris 10 SPARC
      Oracle Meter Data Management 2.0.0.1 installed on Oracle Utilities Applications Framework 4.0.2.

      I've configured a set of XAI configuration objects such as XAI Inbound Service, XAI Executer, XAI Group, XAI JDBC Connection, XAI Receiver, etc.
      On XAI Receiver configuration page i specified XMLFILERCVR for XAI Class field, for XAI JDBC Connection specified CM_XAIJDBC.

      I've created XAI JDBC Connection CM_XAIJDBC with the following attribute values:
      Connection Type = Determined by parameter file
      JDBC URL = @JDBCRL@
      Database User = @DBUSER@
      Database Password = @DBENCPASS@

      The content of MPLParameterInfo.xml file:

      <XAIParameterInfo>
      <Source type="oracle" jdbcURL="jdbc:oracle:thin:@10.20.7.50:1521:DB" databaseUser="mdmplayadm"
      databaseUserPasswordEnc="ENC(adgaOXByI3h8jLqcGB4C0ZCniwnw0ZJbGIIJpoB372E=)" />
      <ParameterVariables>
      <ParameterVariable name="SPLEBASE" value="/data/mdmapp/ouaf/MDMPLAY" />
      <ParameterVariable name="WLHOST" value="10.20.7.50" />
      <ParameterVariable name="WLPORT" value="8500" />
      <ParameterVariable name="XAIROOT" value="ouaf/" />
      <ParameterVariable name="SPLDB" value="oracle" />
      <ParameterVariable name="DBNAME" value="DB" />
      <ParameterVariable name="DBUSER" value="mdmplayadm" />
      <ParameterVariable name="DBENCPASS" value="ENC(adgaOXByI3h8jLqcGB4C0ZCniwnw0ZJbGIIJpoB372E=)" />
      <ParameterVariable name="JDBCURL" value="jdbc:oracle:thin:@10.20.7.50:1521:DB" />
      </ParameterVariables>
      <AddHocParameters>
      <Options>
      <Option name="traceFile" value="/data/mdmapp/ouaf/MDMPLAY/logs/system/xaiInMPL.trc"/>
      <Option name="adminPort" value="8502"/>
      </Options>
      </AddHocParameters>
      </XAIParameterInfo>

      -------------------------------------------------------------
      Finally i've tried to start MPL Listener by command ./startMPL.sh and got the following ERRORS in MPL Log:

      [Wed Nov 17 10:44:11 MSK 2010] Going to initialize JNDI servers.
      [Wed Nov 17 10:44:11 MSK 2010] JNDI initializtion failed. There is no available JNDI server.
      ...........
      Unable to initialize JDBC connection "CM_XAIJDBC" : java.sql.SQLException: Unable to start the Universal Connection Pool: java.sql.SQLException: Unable to start the Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: MBean exception occurred while registering or unregistering the MBean
      at com.splwg.mpl.server.jdbc.MplDatabaseConnectionPool.getConnection(MplDatabaseConnectionPool.java:72)
      at com.splwg.mpl.server.jdbc.JDBCUtilImpl.getConnectionMetaInfo(JDBCUtilImpl.java:137)
      at com.splwg.mpl.server.jdbc.JDBCUtilImpl.createDatabaseConnection(JDBCUtilImpl.java:212)
      at com.splwg.mpl.server.jdbc.JDBCUtilImpl.init(JDBCUtilImpl.java:180)
      at com.splwg.mpl.server.jdbc.JDBCFactory.createJDBCUtil(JDBCFactory.java:30)
      at com.splwg.mpl.server.ServerUtilImpl.<init>(ServerUtilImpl.java:80)
      at com.splwg.mpl.server.MPLServer.init(MPLServer.java:374)
      at com.splwg.mpl.server.MPLServer.run(MPLServer.java:516)
      at com.splwg.mpl.server.MPLServer.runMPL(MPLServer.java:504)
      at com.splwg.mpl.server.MP of LServer.main(MPLServer.java:493)
      ..............

      Analyzing of source code in ucp-11.2.jar showed, that the source of the error it the following call in initConnectionFactory() method in ucp-11.2.jar\oracle\ucp\jdbc\PoolDataSourceImpl.class:

      private void initConnectionFactory()
      throws SQLException
      {
      String className = getClass().getName();
      try
      {
      synchronized (this.m_connectionFactoryClassName)
      {
      ClassLoader clsLoader = Thread.currentThread().getContextClassLoader();
      this.m_connectionFactory = Class.forName(this.m_connectionFactoryClassName, true, clsLoader).newInstance();
      ...................

      Call of Class.forName(this.m_connectionFactoryClassName, true, clsLoader).newInstance() - drops exception because this.m_connectionFactoryClassName has empty value.

      Adding
      this.this.m_connectionFactoryClassName = "oracle.jdbc.pool.OracleDataSource"
      before this call fixed an error and MPL Listener started fine.
      So my XML files loading by XAI works fine in this case.

      Further code review showed that m_connectionFactoryClassName property assigned in a single place - getObjectInstance method
      Information about getObjectInstancel contains in http://download.oracle.com/javase/1.3/docs/api/javax/naming/spi/ObjectFactory.html
      So this method calls externally by "something".

      ----------------------------
      Then I tried to configure XAI JDBC Connection using JNDI Defined connection as Connection type. I've tried to get JDBC connection by JNDI name (MDMPLAY-jdbc) of Data Source defined in my Weblogic Server.

      In MPL Listener startup log i saw successfull initializing of JNDI Servers, but got the class cast error:

      java.lang.ClassCastException: weblogic.jdbc.common.internal.RmiDataSource_1033_WLStub cannot be cast to javax.sql.ConnectionPoolDataSource


      The properties of MDMPLAY-jdbc element on JNDI Tree Structure:

      Binding Name: MDMPLAY-jdbc
      Class: weblogic.jdbc.common.internal.RmiDataSource
      Hash Code: 1964500283
      toString Results: weblogic.jdbc.common.internal.RmiDataSource@7517e53b

      -----------------------------

      My final purpose is to configure XML file uploading by XAI without doing any code changes (only at configuration level).
      So the main problem is to start MPL Listener with working Data Sources.

      ------------------------------

      In Framework 2.2.0 MPL Starts fine, because it uses с3p0 classes for connection, but MPL Listener in Framework 4.0.2 uses UCP.

      Edited by: user9506014 on 18.11.2010 3:03

      Edited by: Anton on 19.11.2010 3:16
        • 1. Re: MPL Listener cannot initialize JDBC connections in Framework 4.0.2
          824079
          Hi Aton,

          I do see the same issue. wanted to check where did you change the code? what is the workaround to get it started.. I get the following error

          [Wed Dec 15 17:35:23 SGT 2010] Multi Purpose Listener version [BCV] 4.0.2.0.0000.001 is starting
          [Wed Dec 15 17:35:23 SGT 2010] Parameter info is "file:///oracle/base/ouaf/V200_MDM_DEMO/splapp/mpl/MPLParameterInfo.xml"
          [Wed Dec 15 17:35:46 SGT 2010] Log writing thread started.
          [Wed Dec 15 17:35:46 SGT 2010] Going to initialize JNDI servers.
          [Wed Dec 15 17:35:46 SGT 2010] JNDI initializtion failed. There is no available JNDI server.
          [Wed Dec 15 17:35:46 SGT 2010] Going to initialize JDBC connections.
          [Wed Dec 15 17:35:46 SGT 2010] Attempting to initialize JDBC connection "DefaultJDBCConnection"
          [Wed Dec 15 17:35:46 SGT 2010] Unable to get the Connection from pool...java.sql.SQLException: Unable to start the Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: Error during pool creation in Universal Connection Pool Manager MBean
          [Wed Dec 15 17:35:46 SGT 2010] Unable to initialize JDBC connection "DefaultJDBCConnection" : Unable to start the Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: Error during pool creation in Universal Connection Pool Manager MBean
          com.splwg.mpl.server.jdbc.JDBCConnectionException: Unable to start the Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: Error during pool creation in Universal Connection Pool Manager MBean
          at com.splwg.mpl.server.jdbc.MplDatabaseConnectionPool.getConnection(MplDatabaseConnectionPool.java:72)
          at com.splwg.mpl.server.jdbc.JDBCUtilImpl.getConnectionMetaInfo(JDBCUtilImpl.java:137)
          at com.splwg.mpl.server.jdbc.JDBCUtilImpl.createDatabaseConnection(JDBCUtilImpl.java:212)
          at com.splwg.mpl.server.jdbc.JDBCUtilImpl.init(JDBCUtilImpl.java:180)
          at com.splwg.mpl.server.jdbc.JDBCFactory.createJDBCUtil(JDBCFactory.java:30)
          at com.splwg.mpl.server.ServerUtilImpl.<init>(ServerUtilImpl.java:80)
          at com.splwg.mpl.server.MPLServer.init(MPLServer.java:374)
          at com.splwg.mpl.server.MPLServer.run(MPLServer.java:516)
          at com.splwg.mpl.server.MPLServer.runMPL(MPLServer.java:504)
          at com.splwg.mpl.server.MPLServer.main(MPLServer.java:493)

          [Wed Dec 15 17:35:46 SGT 2010] JDBC connections initialization failed. There is no available JDBC connection.
          [Wed Dec 15 17:35:46 SGT 2010] Going to initialize JMS connection factories.
          [Wed Dec 15 17:35:46 SGT 2010] JMS connection factories initialization failed. There is no available JMS connection factory.
          [Wed Dec 15 17:35:46 SGT 2010] Going to initialize JMS queues.
          [Wed Dec 15 17:35:46 SGT 2010] JMS queues initialization failed. There is no available JMS queue.
          [Wed Dec 15 17:35:46 SGT 2010] Going to initialize JMS topics.
          [Wed Dec 15 17:35:46 SGT 2010] JMS topics initialization failed. There is no available JMS topic.
          [Wed Dec 15 17:35:46 SGT 2010] Going to initialize local XAI server
          [Wed Dec 15 17:35:46 SGT 2010] XAI: XAIS (OHMPL) XAI Server version [FNH] 4.0.2.0.0000.000 is now initializing. Server Id=OHMPL
          [Wed Dec 15 17:35:46 SGT 2010] XAI: XAIS (OHMPL) Environment is MPL.
          [Wed Dec 15 17:35:46 SGT 2010] XAI: XAIS (OHMPL) XAI parameters information is file:///oracle/base/ouaf/V200_MDM_DEMO/splapp/mpl/MPLParameterInfo.xml
          [Wed Dec 15 17:35:46 SGT 2010] XAI: XAIS (OHMPL) Reading parameters
          [Wed Dec 15 17:36:26 SGT 2010] XAI: XAIS (OHMPL) Parameters read completed.
          [Wed Dec 15 17:36:26 SGT 2010] XAI: XAIS (OHMPL) ServerUtil initialization completed.
          [Wed Dec 15 17:36:26 SGT 2010] XAI: XAIS (OHMPL) Schemas directory is "file:////oracle/base/ouaf/V200_MDM_DEMO/modules/xai/source/config/schemas" .
          [Wed Dec 15 17:36:26 SGT 2010] XAI: XAIS (OHMPL) XSL directory is "file:////oracle/base/ouaf/V200_MDM_DEMO/modules/xai/source/config/schemas" .
          [Wed Dec 15 17:36:26 SGT 2010] XAI: XAIS (OHMPL) Trace initialized. Trace file is "/oracle/base/ouaf/V200_MDM_DEMO/logs/system/xaiInMPL.trc". Trace Type="Full"
          • 2. Re: MPL Listener cannot initialize JDBC connections in Framework 4.0.2
            823381
            Hi,

            your problem is, that the JNDI Server is not configured within the system.
            You must configure the JNDI server via the Admin Menu Admin -> X -> XAI JNDI Server
            and then add your JNDI Server.
            You must define a name and description for the JNDI server and set the URL (e.g "t3://localhost:6500") and the Initial Context Factory (e.g. "weblogic.jndi.WLInitialContextFactory")

            But then you will have the same problem like Anton!
            @Anton: Please post what you have done to fix your problem without change the java code.
            • 3. Re: MPL Listener cannot initialize JDBC connections in Framework 4.0.2
              823381
              Hi,

              MPL is not longer supported by Oracle MDM (see the Releas Notes for MDM 2.0.0.1)
              • 4. Re: MPL Listener cannot initialize JDBC connections in Framework 4.0.2
                Anton
                I've tried to configure connection from JNDI Tree, but problem still apears, because the default connection (used by standard receivers) doesn't look to any JNDI sources.
                I posted this issue to metalink as SR 3-2429512931. It contains more detailed info, and our temporary solution.

                Edited by: Anton on 19.01.2011 4:02
                • 5. Re: MPL Listener cannot initialize JDBC connections in Framework 4.0.2
                  824079
                  Aton,

                  I cant find the SR 3-2429512931 at the Oracle Support site. I wanted to have a look at the workaround you did for fixing this
                  • 6. Re: MPL Listener cannot initialize JDBC connections in Framework 4.0.2
                    824079
                    If MPL is not supported in MDM 2.0, how would XAI work? Would XAI Inbound & Outbound services work without MPL.
                    • 7. Re: MPL Listener cannot initialize JDBC connections in Framework 4.0.2
                      Anton
                      MPL works in FW 4.0.2, we have already used it to load data via XAI (using MPL Listener) to MDM 2.0.

                      Workaround from SR:

                      ### Workaround ###
                      First of all source code showed that MPL Listener in Framework 2.2.0 uses c3p0.jar library to create connections, and MPL starts without errors, but MPL Listener in Framework 4.0.2 uses ucp-11.2.jar library and we have described problem.

                      Analyzing of the source code in ucp-11.2.jar showed, that the source of the error is the following call in initConnectionFactory() method in ucp-11.2.jar\oracle\ucp\jdbc\PoolDataSourceImpl.class:

                      private void initConnectionFactory()
                      throws SQLException
                      {
                      String className = getClass().getName();
                      try
                      {
                      synchronized (this.m_connectionFactoryClassName)
                      {
                      ClassLoader clsLoader = Thread.currentThread().getContextClassLoader();
                      this.m_connectionFactory = Class.forName(this.m_connectionFactoryClassName, true, clsLoader).newInstance();
                      ...................

                      Call of Class.forName(this.m_connectionFactoryClassName, true, clsLoader).newInstance() - drops exception because this.m_connectionFactoryClassName has empty value.

                      Adding
                      this.this.m_connectionFactoryClassName = "oracle.jdbc.pool.OracleDataSource"
                      before this call fixed an error and MPL Listener started fine.
                      .....................
                      Next moment: If we navigate Admin Menu->X->XAI JDBC Connection and create a connection with Connection Type Determined by parameter file or Oracle defined connection we have the same problem with created connection.

                      Creating a connection with Connection type = JNDI defined connection and writing a Java code for binding object of oracle.jdbc.pool.OracleConnectionPoolDataSource.OracleConnectionPoolDataSource class to weblogic server JNDI tree
                      solved the problem with initialization of created XAI JDBC Connections which uses connections from JNDI. The only one place that initialize
                      m_connectionFactory value (method PoolDataSourceImpl.getObjectInstance) called during JNDI handling process.
                      But the problem with DefaultJDBCConnection remained, because it doesn't use JNDI.

                      If we create DataSource in weblogic Admin Console (with defining JNDI name) and try to use it in XAI JDBC Connection on MPL startup we get an class cast error because weblogic binded DataSource is RMI proxy.

                      Edited by: Anton on 25.01.2011 2:11

                      Edited by: Anton on 25.01.2011 2:12
                      • 8. Re: MPL Listener cannot initialize JDBC connections in Framework 4.0.2
                        824079
                        Thanks Anton for responding to my query

                        I will try this workaround to see if it works for me.

                        Just wondering if you are aware of how to use a service bus(oracle service bus) instead of MPL in this kind of setup. This is mainly due to the fact that Oracle doesnt support MPL for MDMS2.0.

                        How do we configure OSB with MDMS2.0 for uploading & downloading data without MPL.

                        Thanks
                        Lingaraj
                        • 9. Re: MPL Listener cannot initialize JDBC connections in Framework 4.0.2
                          824079
                          Hi Anton,

                          is it possible to send me the ucp-11.2.jar as the ucp-11.2.jar which I recreated by decompiling the class you mentioned to accomodate the change of code, doesnt work for me.

                          my email id <linayak.sg@gmail.com>

                          thanks
                          Lingaraj
                          • 10. Re: MPL Listener cannot initialize JDBC connections in Framework 4.0.2
                            Anton
                            Hello, Lingaraj.

                            I've received the reply in my SR. Oracle says that MPL is obsolete and really doesn't officially supported in MDM 2.0, and will be removed from it in future releases.
                            So they recommended to use Smart Grid, which will be released in the nearest future.

                            I think the best way is to wait the release of Smart Grid.