Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting exception with xml mapper #286

Open
abondar24 opened this issue Apr 1, 2023 · 4 comments
Open

Getting exception with xml mapper #286

abondar24 opened this issue Apr 1, 2023 · 4 comments

Comments

@abondar24
Copy link

abondar24 commented Apr 1, 2023

I am using xml config and xml mapper. With this extension I am getting ivalid bound statement exception.

Here is xml config

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>

    <typeAliases>
        <typeAlias type='org.abondar.experimental.quarkusdemo.model.Person' alias='Person'/>
    </typeAliases>
    <environments default="dev">
        <environment id="dev">
            <transactionManager type="QUARKUS">
                <property name="QUARKUS.autoCommit" value="true"/>
            </transactionManager>

            <dataSource type="QUARKUS">
                <property name="db" value="postgres"/>
                <property name="url" value="${url}"/>
                <property name="username" value="${username}"/>
                <property name="password" value="${password}"/>
            </dataSource>
        </environment>
        <environment id="test">
            <transactionManager type="JDBC">
                <property name="JDBC.autoCommit" value="true"/>
            </transactionManager>
            <dataSource type="QUARKUS">
                <property name="db" value="postgres"/>
                <property name="url" value="${url}"/>
                <property name="username" value="${username}"/>
                <property name="password" value="${password}"/>
            </dataSource>
        </environment>
    </environments>
    <mappers>
       <mapper resource="mapper.xml"/>
    </mappers>

</configuration>

Mapper stored in the same dir.

Application yml

  mybatis:
    xmlconfig:
      enable: true

@abondar24 abondar24 changed the title Getting excdption with xml mapper Getting exception with xml mapper Apr 1, 2023
@zhfeng
Copy link
Collaborator

zhfeng commented Apr 2, 2023

Hi @abondar24 , is it possible to share a reproducer? Then I can take a close look. Thanks!

@abondar24
Copy link
Author

Which reproducer do you mean? From one of the issues I used this @MapperDataSource("xmlconfig") as a workaround. Isn't it supposed to work out of the box?

@zhfeng
Copy link
Collaborator

zhfeng commented Apr 10, 2023

So you met the issues in

@abondar24
Copy link
Author

Yep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants