Problems with MyBatis in JUnit test

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems with MyBatis in JUnit test

yusuf.kaplan78

When calling pl sql procedure in JUnit Test with myBatis Mapper.xml I get

 

12:15:25.015 [main] ERROR MyClass - org.springframework.jdbc.UncategorizedSQLException:

### Error querying database.  Cause: java.sql.SQLException: ORA-20210: MyPackage.MyProcedure. ExceptionDocumentProblem: MyError.

ORA-06512: in "MySchema.MyPackage", Zeile 1689

ORA-06512: in "MySchema.MyPackage", Zeile 1705

ORA-06512: in Zeile 1

 

### The error may exist in de/…/MyMapper.xml

### The error may involve defaultParameterMap

### The error occurred while setting parameters

### SQL: {   ? = call   MySchema.myFunction(pContentText   => ?)   }

### Cause: java.sql.SQLException: ORA-20210: MySchema.myFunction. ExceptionDocumentProblem: MyError.

ORA-06512: in "MySchema.MyPackage", Zeile 1689

ORA-06512: in "MySchema.MyPackage", Zeile 1705

ORA-06512: in Zeile 1

 

Strange thing is, that in production it works fine. I checked that there are no differences between the parameters in production an junit with which the Java method in Mapper.xml is called.

 

I use ojdbc.jar. Configuration for JUnit looks like:

 

     <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >

        <property name="driverClassName" value="oracle.jdbc.OracleDriver"/>

        <property name="url" value="jdbc:oracle:thin:@host:port/DB"/>

       

        <property name="username" value="myUser"/>

        <property name="password" value="*****"/>

    </bean>

 

 

Thanks for helping

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Problems with MyBatis in JUnit test

Jose María Zaragoza
Hello

El lun., 25 mar. 2019 a las 12:26, yusuf.kaplan78 via mybatis-user
(<[hidden email]>) escribió:

>
> When calling pl sql procedure in JUnit Test with myBatis Mapper.xml I get
>
>
>
> 12:15:25.015 [main] ERROR MyClass - org.springframework.jdbc.UncategorizedSQLException:
>
> ### Error querying database.  Cause: java.sql.SQLException: ORA-20210: MyPackage.MyProcedure. ExceptionDocumentProblem: MyError.
>
> ORA-06512: in "MySchema.MyPackage", Zeile 1689
>
> ORA-06512: in "MySchema.MyPackage", Zeile 1705
>
> ORA-06512: in Zeile 1
>
>
>
> ### The error may exist in de/…/MyMapper.xml
>
> ### The error may involve defaultParameterMap
>
> ### The error occurred while setting parameters
>
> ### SQL: {   ? = call   MySchema.myFunction(pContentText   => ?)   }
>
> ### Cause: java.sql.SQLException: ORA-20210: MySchema.myFunction. ExceptionDocumentProblem: MyError.
>
> ORA-06512: in "MySchema.MyPackage", Zeile 1689
>
> ORA-06512: in "MySchema.MyPackage", Zeile 1705
>
> ORA-06512: in Zeile 1
>
>
>
> Strange thing is, that in production it works fine. I checked that there are no differences between the parameters in production an junit with which the Java method in Mapper.xml is called.

Execute PLSQL procedure manually in test environment

>
>
>
> I use ojdbc.jar. Configuration for JUnit looks like:
>
>
>
>      <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >
>
>         <property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
>
>         <property name="url" value="jdbc:oracle:thin:@host:port/DB"/>
>
>
>
>         <property name="username" value="myUser"/>
>
>         <property name="password" value="*****"/>
>
>     </bean>
>
>
>
>
>
> Thanks for helping
>
> --
> You received this message because you are subscribed to the Google Groups "mybatis-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.