guice
guice copied to clipboard
Before packaging into a jar, the program runs normally in IDEA. However, after packaging with the maven-shade-plugin, an exception occurs during execution. I used jd-gui to decompile the jar, and both the mapper class and mapper.xml are present. Below are the related programs and the exception that occurs after running. Could you help me figure out what is causing this issue?
Before packaging into a jar, the program runs normally in IDEA. However, after packaging with the maven-shade-plugin, an exception occurs during execution. I used jd-gui to decompile the jar, and both the mapper class and mapper.xml are present. Below are the related programs and the exception that occurs after running. Could you help me figure out what is causing this issue?
import com.google.inject.PrivateModule; import com.google.inject.Scopes; import com.google.inject.name.Names; import com.ultimate.cas.sso.server.service.IUserService; import com.ultimate.cas.sso.server.service.impl.UserServiceImpl; import org.mybatis.guice.XMLMyBatisModule;
public class MybatisModule extends PrivateModule { @Override protected void configure() { install(new XMLMyBatisModule() {
@Override
protected void initialize() {
setEnvironmentId("mysql");
setClassPathResource("mybatis-config-mysql.xml");
bind(IUserService.class).annotatedWith(Names.named("mysql")).to(UserServiceImpl.class).in(Scopes.SINGLETON);
}
});
expose(IUserService.class).annotatedWith(Names.named("mysql"));
}
}