You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by zh...@umich.edu on 2006/02/18 20:30:32 UTC

c# ibatis: error

I go the following errors when I ran my own program:

- The error occurred while loading Providers.
   at 
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument 
docu
ment, DataSource dataSource, Boolean useConfigFileWatcher, Boolean 
isCallFromDao
)
   at 
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Configure(String 
resou
rce)
   at ArrayBind.Insert.go()

The program HelloWorld works just fine. But I created my own simple 
project and I got the errors.

Could you tell me how to fix it?

-Henry

c# ibatis: procedure

Posted by zh...@umich.edu.
Here is my procedure in the ORACLE database:
    CREATE or replace PACKAGE MYPACK AS    TYPE AssocArrayVarchar2_t is 
table of VARCHAR(20) index by BINARY_INTEGER;
      PROCEDURE TestVarchar2(
        Param1 IN     AssocArrayVarchar2_t,
        Param2 IN OUT AssocArrayVarchar2_t,
        Param3    OUT AssocArrayVarchar2_t);
      END MYPACK;

    CREATE or REPLACE package body MYPACK as      PROCEDURE TestVarchar2(
      Param1 IN     AssocArrayVarchar2_t,
      Param2 IN OUT AssocArrayVarchar2_t,
      Param3    OUT AssocArrayVarchar2_t)
      IS
      i integer;
      BEGIN
        -- copy a few elements from Param2 to Param1
        Param3(1) := Param2(1);
        Param3(2) := NULL;
        Param3(3) := Param2(3);
        -- copy all elements from Param1 to Param2
        Param2(1) := Param1(1);
        Param2(2) := Param1(2);
        Param2(3) := Param1(3);
        -- insert some values to db
        FOR i IN 1..3 LOOP
          insert into T1 values(i,Param2(i));
        END LOOP;
      END TestVarchar2;
    END MYPACK;
-------------------------------------------------
here is my sqlmap.xml file:
<alias>
	<typeAlias alias="Parameters" type="AssocArray.Parameters, AssocArray" />
</alias>

<parameterMap id="procedure_Result" class="Parameters">
<parameter property="P1"  direction="Input" column="Param1" />
<parameter property="P2"
  direction="InputOutput" column="Param2" />
<parameter property="P3"
  direction="Output" column="Param3" />
</parameterMap>

<statements>
<procedure id="call_procedure" parameterMap="procedure_Result">
MyPack.TestVarchar2
</procedure>
</statements>
--------------------------------------
and Parameters class:

namespace AssocArray
{
	/// <summary>
	/// Summary description for Parameters.
	/// </summary>
   public class Parameters
   {
      private string[] p1;
      private string[] p2;
      private string[] p3;

      public Parameters()
      {
      }

      public string[] P1      {
         get { return p1; }
         set { p1 = value; }
      }

      public string[] P2      {
         get { return p2; }
         set { p2 = value; }
      }

      public string[] P3      {
         get { return p3; }
         set { p3 = value; }
      }
   }
}

But the I got the following error when I run the program:
- The error occurred while loading SqlMap.
- loading procedure tag
- The error occurred in <sqlMap embedded="Resources.assocarray.xml, 
AssocArray"
xmlns="http://ibatis.apache.org/dataMapper" />.
- Check the call_procedure.
   at 
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument 
docu
ment, DataSource dataSource, Boolean useConfigFileWatcher, Boolean 
isCallFromDao
)
   at 
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Configure(String 
resou
rce)
...........

What is wrong?

-Henry



Re: c# ibatis: error

Posted by Ron Grabowski <ro...@yahoo.com>.
When I suggested you write your own program to verify the Oracle
provider is working correctly, I meant make an ADO.Net application
without IBatisNet. Your test application should connect to the an
Oracle database, query a table, and return information WITHOUT using
IBatisNet. Use the OracleCommand, OracleConnection, etc. objects (or
whatever they're called for the provider you're using). It sounds like
you're trying to solve two problems:

 1) The Oracle provider does not work
 2) IBatisNet does not work

at the same time. You should resolve the first issue then resolve the
second issue. I don't have access to an Oracle database. I think
Roberto does.

Could you post the entire stack trace to the list too. The snippet you
posted doesn't tell us what the actual exception is or what method
raised it.

--- zhlu@umich.edu wrote:

> I go the following errors when I ran my own program:
> 
> - The error occurred while loading Providers.
>    at 
> IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
> 
> docu
> ment, DataSource dataSource, Boolean useConfigFileWatcher, Boolean 
> isCallFromDao
> )
>    at 
> IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Configure(String 
> resou
> rce)
>    at ArrayBind.Insert.go()
> 
> The program HelloWorld works just fine. But I created my own simple 
> project and I got the errors.
> 
> Could you tell me how to fix it?
> 
> -Henry
>