kazuki43zoo / mybatis-spring-native

The experimental project that the MyBatis integration with Spring Native feature

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fail bean initializing when specify @Transactional on mapper interface

kazuki43zoo opened this issue · comments

Mapper

@Mapper
@Transactional
public interface CityMapper {

  @Insert("INSERT INTO city (name, state, country) VALUES(#{name}, #{state}, #{country})")
  @Options(useGeneratedKeys = true, keyProperty = "id")
  void insert(City city);

  @Select("SELECT id, name, state, country FROM city ")
  Collection<City> findAll();

}

Error message

...
2022-01-15 09:42:12.915 WARN 14906 --- [ main] o.s.c.support.GenericApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mybatisSpringNativeSampleApplication.MyService': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cityMapper': Post-processing of FactoryBean's singleton object failed; nested exception is com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface org.mybatis.spring.nativex.sample.simple.CityMapper, interface org.springframework.aop.SpringProxy, interface org.springframework.aop.framework.Advised, interface org.springframework.core.DecoratingProxy] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles= and -H:DynamicProxyConfigurationResources= options.
2022-01-15 09:42:12.916 ERROR 14906 --- [ main] o.s.boot.SpringApplication : Application run failed
...