mybatis guice strange trouble

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

mybatis guice strange trouble

nino martinez wael
Hi Guys

Im have some really strange problems with inconstant failings of test. I have a test that usually fails and some times passes, when it fails it gives this error:

com.google.inject.CreationException: Guice creation errors:

1) Error in custom provider, java.lang.NullPointerException
  while locating org.mybatis.guice.environment.EnvironmentProvider
  while locating org.apache.ibatis.mapping.Environment
    for parameter 0 at org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
  while locating org.mybatis.guice.configuration.ConfigurationProvider
  while locating org.apache.ibatis.session.Configuration
    for parameter 0 at org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
  while locating org.mybatis.guice.SqlSessionFactoryProvider
  while locating org.apache.ibatis.session.SqlSessionFactory
    for parameter 0 at org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
  while locating org.mybatis.guice.SqlSessionManagerProvider
  while locating org.apache.ibatis.session.SqlSessionManager
    for field at org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
  at org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)

1 error
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
at com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
at com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
at com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
at com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.NullPointerException
at com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
at com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
at com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
at com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
at com.google.inject.Scopes$1$1.get(Scopes.java:54)
at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
at com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
at com.google.inject.Scopes$1$1.get(Scopes.java:54)
at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
at com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
at com.google.inject.Scopes$1$1.get(Scopes.java:54)
at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
at com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
at com.google.inject.Scopes$1$1.get(Scopes.java:54)
at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
at com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
at com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
at com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
at com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
at com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
at com.google.inject.Initializer.injectAll(Initializer.java:92)
at com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
... 26 more


I only have a vague clue on what could be wrong, but what really annoys me are the inconstant failings. So it seems to be a timing issue?

So any hints highly appreciated

-Nino
Reply | Threaded
Open this post in threaded view
|

Re: mybatis guice strange trouble

Simone Tripodi
Hi Nino!!
can you post please your configuration? It would be easier to
understand where the problem could be.
Thanks in advance!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Mon, Nov 22, 2010 at 10:55 AM, nino martinez wael
<[hidden email]> wrote:

> Hi Guys
> Im have some really strange problems with inconstant failings of test. I
> have a test that usually fails and some times passes, when it fails it gives
> this error:
> com.google.inject.CreationException: Guice creation errors:
> 1) Error in custom provider, java.lang.NullPointerException
>   while locating org.mybatis.guice.environment.EnvironmentProvider
>   while locating org.apache.ibatis.mapping.Environment
>     for parameter 0 at
> org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
>   while locating org.mybatis.guice.configuration.ConfigurationProvider
>   while locating org.apache.ibatis.session.Configuration
>     for parameter 0 at
> org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
>   while locating org.mybatis.guice.SqlSessionFactoryProvider
>   while locating org.apache.ibatis.session.SqlSessionFactory
>     for parameter 0 at
> org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
>   while locating org.mybatis.guice.SqlSessionManagerProvider
>   while locating org.apache.ibatis.session.SqlSessionManager
>     for field at
> org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
>   at
> org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)
> 1 error
> at
> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
> at
> com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
> at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
> at com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
> at com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
> at
> com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> Caused by: java.lang.NullPointerException
> at
> com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
> at com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
> at
> com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at
> com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
> at
> com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
> at com.google.inject.Scopes$1$1.get(Scopes.java:54)
> at
> com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at
> com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
> at
> com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
> at com.google.inject.Scopes$1$1.get(Scopes.java:54)
> at
> com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at
> com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
> at
> com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
> at com.google.inject.Scopes$1$1.get(Scopes.java:54)
> at
> com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at
> com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
> at
> com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
> at com.google.inject.Scopes$1$1.get(Scopes.java:54)
> at
> com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
> at
> com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
> at com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
> at com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
> at
> com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
> at
> com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
> at com.google.inject.Initializer.injectAll(Initializer.java:92)
> at
> com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
> ... 26 more
>
> I only have a vague clue on what could be wrong, but what really annoys me
> are the inconstant failings. So it seems to be a timing issue?
> So any hints highly appreciated
> -Nino
Reply | Threaded
Open this post in threaded view
|

Re: mybatis guice strange trouble

nino martinez wael
sure for the failing test I am using CiscoV7Module, this has been a hard nut to crack and any help are very appreciated, if you need more info please ask:

public abstract class CiscoUCCXModule extends AbstractModule {

private CoreDaoService coreDaoService;

Logger logger = LoggerFactory.getLogger(CiscoUCCXModule.class);

public CiscoUCCXModule() {
super();
}

protected abstract Class<? extends com.netdesign.dao.cisco.general.CiscoStatisticsMapper> getCiscoStatisticsMapper();

protected abstract Class<? extends com.netdesign.dao.cisco.general.AgentMapper> getAgentMapper();

protected abstract Class<? extends com.netdesign.dao.cisco.general.GeneralMapper> getGeneralMapper();

@Override
protected void configure() {
logger.info("Starting :" + getWallboardProviderClass());

Names.bindProperties(this.binder(), getConnectionProperties());

Builder builder = new Builder();
builder.setDataSourceProviderType(getDataSourceProvider());

builder.addMapperClasses(getCiscoStatisticsMapper());
builder.addMapperClasses(getAgentMapper());
builder.addMapperClasses(getGeneralMapper());
builder.addTypeHandler(AgentStatus.class, AgentStatusTypeHandler.class);

Module myBatisModule = builder.create();

install(myBatisModule);

bind(GeneralMapper.class).to(getGeneralMapper());
bind(CiscoStatisticsMapper.class).to(getCiscoStatisticsMapper());
bind(AgentMapper.class).to(getAgentMapper());
bind(WallBoardDataProvider.class).to(getWallboardProviderClass());
logger.info("Started:" + getWallboardProviderClass());
}

protected Class<? extends DataSourceProvider> getDataSourceProvider() {
return DataSourceProvider.class;
}

protected abstract Class<? extends WallBoardDataProvider> getWallboardProviderClass();

private Properties getConnectionProperties() {
final Properties myBatisProperties = new Properties();

CiscoUCCXWallBoardDataProvider ciscoWallBoardDataProvider = getWallboardProvider();

Parameter parameterPassword = getCoreDaoService().getParameter(
ciscoWallBoardDataProvider.providerUniqueID(),
CiscoUCCXWallBoardDataProvider.PASSWORD);
Parameter parameterUsername = getCoreDaoService().getParameter(
ciscoWallBoardDataProvider.providerUniqueID(),
CiscoUCCXWallBoardDataProvider.USERNAME);
Parameter parameterServerIPA = getCoreDaoService().getParameter(
ciscoWallBoardDataProvider.providerUniqueID(),
CiscoUCCXWallBoardDataProvider.SERVER_IP_A);

Parameter parameterServerIPB = null;
try {
parameterServerIPB = getCoreDaoService().getParameter(
ciscoWallBoardDataProvider.providerUniqueID(),
CiscoUCCXWallBoardDataProvider.SERVER_IP_B);
} catch (Exception e) {
parameterServerIPB = new Parameter();
parameterServerIPB
.setName(CiscoUCCXWallBoardDataProvider.SERVER_IP_B);
parameterServerIPB.setValue("");
}

myBatisProperties.setProperty("mybatis.environment.id", "production");

myBatisProperties.setProperty("mybatis.JDBC.username",
parameterUsername.getValue());
myBatisProperties.setProperty("mybatis.JDBC.password",
parameterPassword.getValue());
myBatisProperties.setProperty("mybatis.JDBC.autoCommit", "true");
setupURLAndServer(myBatisProperties, parameterPassword,
parameterUsername, parameterServerIPA, parameterServerIPB);

setupCache(CacheManager.getInstance(), ciscoWallBoardDataProvider);

return myBatisProperties;
}

protected abstract void setupURLAndServer(Properties myBatisProperties,
Parameter parameterPassword, Parameter parameterUsername,
Parameter parameterServerIPA, Parameter parameterServerIPB);

protected abstract CiscoUCCXWallBoardDataProvider getWallboardProvider();

private void setupCache(CacheManager cacheManager,
CiscoUCCXWallBoardDataProvider ciscoWallBoardDataProvider) {
ciscoWallBoardDataProvider.setCachemanager(cacheManager);
try {
Parameter parameterCache = getCoreDaoService().getParameter(
ciscoWallBoardDataProvider.providerUniqueID(),
CiscoUCCXWallBoardDataProvider.CACHE);
ciscoWallBoardDataProvider.setupCache(Integer
.parseInt(parameterCache.getValue()));
} catch (NoResultException e) {
logger.debug("Could not find cache settings, running with the driver the first time?");
}
}

@Inject
public void setCoreDaoService(CoreDaoService coreDaoService) {
this.coreDaoService = coreDaoService;
}

public CoreDaoService getCoreDaoService() {
return coreDaoService;
}

}

public class CiscoV7Module extends CiscoUCCXModule implements
WallBoardDriverModule {

public CiscoV7Module() {

}

@Override
protected Class<? extends DataSourceProvider> getDataSourceProvider() {

return CiscoV7DataSourceProvider.class;
}

@Override
protected Class<? extends AgentMapper> getAgentMapper() {
return com.netdesign.dao.cisco.v7.uccx.AgentMapper.class;
}

@Override
protected Class<? extends CiscoStatisticsMapper> getCiscoStatisticsMapper() {

return com.netdesign.dao.cisco.v7.uccx.CiscoStatisticsMapper.class;
}

@Override
protected Class<? extends GeneralMapper> getGeneralMapper() {
return com.netdesign.dao.cisco.v7.uccx.GeneralMapper.class;
}

protected CiscoUCCXWallBoardDataProvider getWallboardProvider() {
return new CiscoUCCX7WallBoardDataProvider();
}

protected Class<? extends CiscoUCCXWallBoardDataProvider> getWallboardProviderClass() {
return CiscoUCCX7WallBoardDataProvider.class;
}

@Override
protected void setupURLAndServer(Properties myBatisProperties,
Parameter parameterPassword, Parameter parameterUsername,
Parameter parameterServerIPA, Parameter parameterServerIPB) {
myBatisProperties.setProperty("mybatis.JDBC.driver",

"com.microsoft.sqlserver.jdbc.SQLServerDriver");
myBatisProperties.setProperty("mybatis.JDBC.urlA",
"jdbc:sqlserver://" + parameterServerIPA.getValue() + ";user="
+ parameterUsername.getValue() + ";password="
+ parameterPassword.getValue() + ";");
if (parameterServerIPB != null) {
myBatisProperties
.setProperty("mybatis.JDBC.urlB", "jdbc:sqlserver://"
+ parameterServerIPB.getValue() + ";user="
+ parameterUsername.getValue() + ";password="
+ parameterPassword.getValue() + ";");
} else {
myBatisProperties.setProperty("mybatis.JDBC.urlB", "");
}
}

}


2010/11/22 Simone Tripodi <[hidden email]>
Hi Nino!!
can you post please your configuration? It would be easier to
understand where the problem could be.
Thanks in advance!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Mon, Nov 22, 2010 at 10:55 AM, nino martinez wael
<[hidden email]> wrote:
> Hi Guys
> Im have some really strange problems with inconstant failings of test. I
> have a test that usually fails and some times passes, when it fails it gives
> this error:
> com.google.inject.CreationException: Guice creation errors:
> 1) Error in custom provider, java.lang.NullPointerException
>   while locating org.mybatis.guice.environment.EnvironmentProvider
>   while locating org.apache.ibatis.mapping.Environment
>     for parameter 0 at
> org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
>   while locating org.mybatis.guice.configuration.ConfigurationProvider
>   while locating org.apache.ibatis.session.Configuration
>     for parameter 0 at
> org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
>   while locating org.mybatis.guice.SqlSessionFactoryProvider
>   while locating org.apache.ibatis.session.SqlSessionFactory
>     for parameter 0 at
> org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
>   while locating org.mybatis.guice.SqlSessionManagerProvider
>   while locating org.apache.ibatis.session.SqlSessionManager
>     for field at
> org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
>   at
> org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)
> 1 error
> at
> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
> at
> com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
> at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
> at com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
> at com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
> at
> com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> Caused by: java.lang.NullPointerException
> at
> com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
> at com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
> at
> com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at
> com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
> at
> com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
> at com.google.inject.Scopes$1$1.get(Scopes.java:54)
> at
> com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at
> com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
> at
> com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
> at com.google.inject.Scopes$1$1.get(Scopes.java:54)
> at
> com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at
> com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
> at
> com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
> at com.google.inject.Scopes$1$1.get(Scopes.java:54)
> at
> com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at
> com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
> at
> com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
> at com.google.inject.Scopes$1$1.get(Scopes.java:54)
> at
> com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
> at
> com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
> at com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
> at com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
> at
> com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
> at
> com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
> at com.google.inject.Initializer.injectAll(Initializer.java:92)
> at
> com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
> ... 26 more
>
> I only have a vague clue on what could be wrong, but what really annoys me
> are the inconstant failings. So it seems to be a timing issue?
> So any hints highly appreciated
> -Nino

Reply | Threaded
Open this post in threaded view
|

Re: mybatis guice strange trouble

nino martinez wael
sure for the failing test I am using CiscoV7Module, this has been a hard nut to crack and any help are very appreciated, if you need more info please ask:
http://pastebin.com/FL8pYFcp

I could'nt send the pasties directly to the group (was marked as spam by spam assassin)

-Nino


 

2010/11/22 Simone Tripodi <[hidden email]>

Hi Nino!!
can you post please your configuration? It would be easier to
understand where the problem could be.
Thanks in advance!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Mon, Nov 22, 2010 at 10:55 AM, nino martinez wael
<[hidden email]> wrote:
> Hi Guys
> Im have some really strange problems with inconstant failings of test. I
> have a test that usually fails and some times passes, when it fails it gives
> this error:
> com.google.inject.CreationException: Guice creation errors:
> 1) Error in custom provider, java.lang.NullPointerException
>   while locating org.mybatis.guice.environment.EnvironmentProvider
>   while locating org.apache.ibatis.mapping.Environment
>     for parameter 0 at
> org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
>   while locating org.mybatis.guice.configuration.ConfigurationProvider
>   while locating org.apache.ibatis.session.Configuration
>     for parameter 0 at
> org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
>   while locating org.mybatis.guice.SqlSessionFactoryProvider
>   while locating org.apache.ibatis.session.SqlSessionFactory
>     for parameter 0 at
> org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
>   while locating org.mybatis.guice.SqlSessionManagerProvider
>   while locating org.apache.ibatis.session.SqlSessionManager
>     for field at
> org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
>   at
> org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)
> 1 error
> at
> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
> at
> com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
> at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
> at com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
> at com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
> at
> com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> Caused by: java.lang.NullPointerException
> at
> com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
> at com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
> at
> com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at
> com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
> at
> com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
> at com.google.inject.Scopes$1$1.get(Scopes.java:54)
> at
> com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at
> com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
> at
> com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
> at com.google.inject.Scopes$1$1.get(Scopes.java:54)
> at
> com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at
> com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
> at
> com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
> at com.google.inject.Scopes$1$1.get(Scopes.java:54)
> at
> com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at
> com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
> at
> com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
> at
> com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
> at
> com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
> at
> com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
> at
> com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
> at com.google.inject.Scopes$1$1.get(Scopes.java:54)
> at
> com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
> at com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
> at com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
> at
> com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
> at com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
> at com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
> at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
> at
> com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
> at
> com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
> at com.google.inject.Initializer.injectAll(Initializer.java:92)
> at
> com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
> ... 26 more
>
> I only have a vague clue on what could be wrong, but what really annoys me
> are the inconstant failings. So it seems to be a timing issue?
> So any hints highly appreciated
> -Nino


Reply | Threaded
Open this post in threaded view
|

Re: mybatis guice strange trouble

Simone Tripodi
Hi Nino,
thanks, I'll let you know ASAP, stay tuned!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Tue, Nov 23, 2010 at 9:09 AM, nino martinez wael
<[hidden email]> wrote:

> sure for the failing test I am using CiscoV7Module, this has been a hard nut
> to crack and any help are very appreciated, if you need more info please
> ask:
> http://pastebin.com/FL8pYFcp
> I could'nt send the pasties directly to the group (was marked as spam by
> spam assassin)
> -Nino
>
>
>>
>> 2010/11/22 Simone Tripodi <[hidden email]>
>>>
>>> Hi Nino!!
>>> can you post please your configuration? It would be easier to
>>> understand where the problem could be.
>>> Thanks in advance!
>>> Simo
>>>
>>> http://people.apache.org/~simonetripodi/
>>> http://www.99soft.org/
>>>
>>>
>>>
>>> On Mon, Nov 22, 2010 at 10:55 AM, nino martinez wael
>>> <[hidden email]> wrote:
>>> > Hi Guys
>>> > Im have some really strange problems with inconstant failings of test.
>>> > I
>>> > have a test that usually fails and some times passes, when it fails it
>>> > gives
>>> > this error:
>>> > com.google.inject.CreationException: Guice creation errors:
>>> > 1) Error in custom provider, java.lang.NullPointerException
>>> >   while locating org.mybatis.guice.environment.EnvironmentProvider
>>> >   while locating org.apache.ibatis.mapping.Environment
>>> >     for parameter 0 at
>>> >
>>> > org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
>>> >   while locating org.mybatis.guice.configuration.ConfigurationProvider
>>> >   while locating org.apache.ibatis.session.Configuration
>>> >     for parameter 0 at
>>> >
>>> > org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
>>> >   while locating org.mybatis.guice.SqlSessionFactoryProvider
>>> >   while locating org.apache.ibatis.session.SqlSessionFactory
>>> >     for parameter 0 at
>>> >
>>> > org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
>>> >   while locating org.mybatis.guice.SqlSessionManagerProvider
>>> >   while locating org.apache.ibatis.session.SqlSessionManager
>>> >     for field at
>>> >
>>> > org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
>>> >   at
>>> >
>>> > org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)
>>> > 1 error
>>> > at
>>> >
>>> > com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
>>> > at
>>> >
>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
>>> > at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
>>> > at
>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
>>> > at
>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
>>> > at
>>> >
>>> > com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
>>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> > at
>>> >
>>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> > at
>>> >
>>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> > at java.lang.reflect.Method.invoke(Method.java:597)
>>> > at
>>> >
>>> > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>>> > at
>>> >
>>> > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>>> > at
>>> >
>>> > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>>> > at
>>> >
>>> > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>>> > at
>>> >
>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
>>> > at
>>> >
>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>>> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>>> > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>>> > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>>> > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>>> > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>>> > at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>>> > at
>>> >
>>> > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
>>> > at
>>> >
>>> > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>> > at
>>> >
>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>>> > at
>>> >
>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>>> > at
>>> >
>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>>> > at
>>> >
>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>>> > Caused by: java.lang.NullPointerException
>>> > at
>>> >
>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>>> > at com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
>>> > at
>>> >
>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>> > at
>>> >
>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>> > at
>>> >
>>> > com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
>>> > at
>>> >
>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>>> > at
>>> >
>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
>>> > at
>>> >
>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>> > at
>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>> > at
>>> >
>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>> > at
>>> >
>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>> > at
>>> >
>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>> > at
>>> >
>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>> > at
>>> >
>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>> > at
>>> >
>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>> > at
>>> >
>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>> > at
>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>> > at
>>> >
>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>> > at
>>> >
>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>> > at
>>> >
>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>> > at
>>> >
>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>> > at
>>> >
>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>> > at
>>> >
>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>> > at
>>> >
>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>> > at
>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>> > at
>>> >
>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>> > at
>>> >
>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>> > at
>>> >
>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>> > at
>>> >
>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>> > at
>>> >
>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>> > at
>>> >
>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>> > at
>>> >
>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>> > at
>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>> > at
>>> >
>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>> > at
>>> >
>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>> > at
>>> >
>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>> > at
>>> >
>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>> > at
>>> >
>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>> > at
>>> >
>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>> > at
>>> >
>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>> > at
>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>> > at
>>> > com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
>>> > at
>>> >
>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>>> > at
>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
>>> > at
>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
>>> > at
>>> >
>>> > com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
>>> > at
>>> >
>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>>> > at com.google.inject.Initializer.injectAll(Initializer.java:92)
>>> > at
>>> >
>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
>>> > ... 26 more
>>> >
>>> > I only have a vague clue on what could be wrong, but what really annoys
>>> > me
>>> > are the inconstant failings. So it seems to be a timing issue?
>>> > So any hints highly appreciated
>>> > -Nino
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: mybatis guice strange trouble

Simone Tripodi
Hi Nino,
can you start please eliminating

                bind(GeneralMapper.class).to(getGeneralMapper());

bind(CiscoStatisticsMapper.class).to(getCiscoStatisticsMapper());
                bind(AgentMapper.class).to(getAgentMapper());

because the Guice module will take care of installing the mappers? In
this way you're declaring the mappers twice...
Moreover you can optimize a little your code by replacing

                builder.addMapperClasses(getCiscoStatisticsMapper());
                builder.addMapperClasses(getAgentMapper());
                builder.addMapperClasses(getGeneralMapper());

with

                builder.addMapperClasses(getCiscoStatisticsMapper(),
getAgentMapper(), getGeneralMapper());

Let me know!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Tue, Nov 23, 2010 at 2:40 PM, Simone Tripodi
<[hidden email]> wrote:

> Hi Nino,
> thanks, I'll let you know ASAP, stay tuned!
> Simo
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
>
>
> On Tue, Nov 23, 2010 at 9:09 AM, nino martinez wael
> <[hidden email]> wrote:
>> sure for the failing test I am using CiscoV7Module, this has been a hard nut
>> to crack and any help are very appreciated, if you need more info please
>> ask:
>> http://pastebin.com/FL8pYFcp
>> I could'nt send the pasties directly to the group (was marked as spam by
>> spam assassin)
>> -Nino
>>
>>
>>>
>>> 2010/11/22 Simone Tripodi <[hidden email]>
>>>>
>>>> Hi Nino!!
>>>> can you post please your configuration? It would be easier to
>>>> understand where the problem could be.
>>>> Thanks in advance!
>>>> Simo
>>>>
>>>> http://people.apache.org/~simonetripodi/
>>>> http://www.99soft.org/
>>>>
>>>>
>>>>
>>>> On Mon, Nov 22, 2010 at 10:55 AM, nino martinez wael
>>>> <[hidden email]> wrote:
>>>> > Hi Guys
>>>> > Im have some really strange problems with inconstant failings of test.
>>>> > I
>>>> > have a test that usually fails and some times passes, when it fails it
>>>> > gives
>>>> > this error:
>>>> > com.google.inject.CreationException: Guice creation errors:
>>>> > 1) Error in custom provider, java.lang.NullPointerException
>>>> >   while locating org.mybatis.guice.environment.EnvironmentProvider
>>>> >   while locating org.apache.ibatis.mapping.Environment
>>>> >     for parameter 0 at
>>>> >
>>>> > org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
>>>> >   while locating org.mybatis.guice.configuration.ConfigurationProvider
>>>> >   while locating org.apache.ibatis.session.Configuration
>>>> >     for parameter 0 at
>>>> >
>>>> > org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
>>>> >   while locating org.mybatis.guice.SqlSessionFactoryProvider
>>>> >   while locating org.apache.ibatis.session.SqlSessionFactory
>>>> >     for parameter 0 at
>>>> >
>>>> > org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
>>>> >   while locating org.mybatis.guice.SqlSessionManagerProvider
>>>> >   while locating org.apache.ibatis.session.SqlSessionManager
>>>> >     for field at
>>>> >
>>>> > org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
>>>> >   at
>>>> >
>>>> > org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)
>>>> > 1 error
>>>> > at
>>>> >
>>>> > com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
>>>> > at
>>>> >
>>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
>>>> > at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
>>>> > at
>>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
>>>> > at
>>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
>>>> > at
>>>> >
>>>> > com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
>>>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> > at
>>>> >
>>>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>> > at
>>>> >
>>>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>> > at java.lang.reflect.Method.invoke(Method.java:597)
>>>> > at
>>>> >
>>>> > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>>>> > at
>>>> >
>>>> > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>>>> > at
>>>> >
>>>> > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>>>> > at
>>>> >
>>>> > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>>>> > at
>>>> >
>>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
>>>> > at
>>>> >
>>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>>>> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>>>> > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>>>> > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>>>> > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>>>> > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>>>> > at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>>>> > at
>>>> >
>>>> > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
>>>> > at
>>>> >
>>>> > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>>> > at
>>>> >
>>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>>>> > at
>>>> >
>>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>>>> > at
>>>> >
>>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>>>> > at
>>>> >
>>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>>>> > Caused by: java.lang.NullPointerException
>>>> > at
>>>> >
>>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>>>> > at com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
>>>> > at
>>>> >
>>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> > at
>>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> > at
>>>> >
>>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> > at
>>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> > at
>>>> >
>>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> > at
>>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> > at
>>>> >
>>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> > at
>>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> > at
>>>> >
>>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> > at
>>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> > at
>>>> > com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
>>>> > at
>>>> >
>>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>>>> > at
>>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
>>>> > at
>>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
>>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
>>>> > at
>>>> >
>>>> > com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
>>>> > at
>>>> >
>>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>>>> > at com.google.inject.Initializer.injectAll(Initializer.java:92)
>>>> > at
>>>> >
>>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
>>>> > ... 26 more
>>>> >
>>>> > I only have a vague clue on what could be wrong, but what really annoys
>>>> > me
>>>> > are the inconstant failings. So it seems to be a timing issue?
>>>> > So any hints highly appreciated
>>>> > -Nino
>>>
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: mybatis guice strange trouble

nino martinez wael
Hi Simone

Actually GeneralMapper.class and getGeneralMapper() is not the same, GeneralMapper is a super interface and getGeneralMapper() inherits from it. Reason why im doing it this way are that I am using 2 different databases, a MSSQL or Informix and the only things that differs are a few sql fragments, so I can reuse a lot more by using this approach, and if I do not bind directly to the super interface I won't get anything injected (since guice does not consider the child as injectable). When I discovered the error I was not using this approach, so I think we can rule it out.

I'll change the way that I add mapper classes.

So whats the next step? As I mentioned I have two tests, one hits mssql and the other informix the informix one works and the mssql are unstable. Both "drivers" works in production.

2010/11/23 Simone Tripodi <[hidden email]>
Hi Nino,
can you start please eliminating

               bind(GeneralMapper.class).to(getGeneralMapper());

bind(CiscoStatisticsMapper.class).to(getCiscoStatisticsMapper());
               bind(AgentMapper.class).to(getAgentMapper());

because the Guice module will take care of installing the mappers? In
this way you're declaring the mappers twice...
Moreover you can optimize a little your code by replacing

               builder.addMapperClasses(getCiscoStatisticsMapper());
               builder.addMapperClasses(getAgentMapper());
               builder.addMapperClasses(getGeneralMapper());

with

               builder.addMapperClasses(getCiscoStatisticsMapper(),
getAgentMapper(), getGeneralMapper());

Let me know!
On Tue, Nov 23, 2010 at 2:40 PM, Simone Tripodi
<[hidden email]> wrote:
> Hi Nino,
> thanks, I'll let you know ASAP, stay tuned!
> Simo
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
>
>
> On Tue, Nov 23, 2010 at 9:09 AM, nino martinez wael
> <[hidden email]> wrote:
>> sure for the failing test I am using CiscoV7Module, this has been a hard nut
>> to crack and any help are very appreciated, if you need more info please
>> ask:
>> http://pastebin.com/FL8pYFcp
>> I could'nt send the pasties directly to the group (was marked as spam by
>> spam assassin)
>> -Nino
>>
>>
>>>
>>> 2010/11/22 Simone Tripodi <[hidden email]>
>>>>
>>>> Hi Nino!!
>>>> can you post please your configuration? It would be easier to
>>>> understand where the problem could be.
>>>> Thanks in advance!
>>>> Simo
>>>>
>>>> http://people.apache.org/~simonetripodi/
>>>> http://www.99soft.org/
>>>>
>>>>
>>>>
>>>> On Mon, Nov 22, 2010 at 10:55 AM, nino martinez wael
>>>> <[hidden email]> wrote:
>>>> > Hi Guys
>>>> > Im have some really strange problems with inconstant failings of test.
>>>> > I
>>>> > have a test that usually fails and some times passes, when it fails it
>>>> > gives
>>>> > this error:
>>>> > com.google.inject.CreationException: Guice creation errors:
>>>> > 1) Error in custom provider, java.lang.NullPointerException
>>>> >   while locating org.mybatis.guice.environment.EnvironmentProvider
>>>> >   while locating org.apache.ibatis.mapping.Environment
>>>> >     for parameter 0 at
>>>> >
>>>> > org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
>>>> >   while locating org.mybatis.guice.configuration.ConfigurationProvider
>>>> >   while locating org.apache.ibatis.session.Configuration
>>>> >     for parameter 0 at
>>>> >
>>>> > org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
>>>> >   while locating org.mybatis.guice.SqlSessionFactoryProvider
>>>> >   while locating org.apache.ibatis.session.SqlSessionFactory
>>>> >     for parameter 0 at
>>>> >
>>>> > org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
>>>> >   while locating org.mybatis.guice.SqlSessionManagerProvider
>>>> >   while locating org.apache.ibatis.session.SqlSessionManager
>>>> >     for field at
>>>> >
>>>> > org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
>>>> >   at
>>>> >
>>>> > org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)
>>>> > 1 error
>>>> > at
>>>> >
>>>> > com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
>>>> > at
>>>> >
>>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
>>>> > at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
>>>> > at
>>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
>>>> > at
>>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
>>>> > at
>>>> >
>>>> > com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
>>>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> > at
>>>> >
>>>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>> > at
>>>> >
>>>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>> > at java.lang.reflect.Method.invoke(Method.java:597)
>>>> > at
>>>> >
>>>> > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>>>> > at
>>>> >
>>>> > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>>>> > at
>>>> >
>>>> > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>>>> > at
>>>> >
>>>> > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>>>> > at
>>>> >
>>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
>>>> > at
>>>> >
>>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>>>> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>>>> > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>>>> > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>>>> > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>>>> > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>>>> > at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>>>> > at
>>>> >
>>>> > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
>>>> > at
>>>> >
>>>> > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>>> > at
>>>> >
>>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>>>> > at
>>>> >
>>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>>>> > at
>>>> >
>>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>>>> > at
>>>> >
>>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>>>> > Caused by: java.lang.NullPointerException
>>>> > at
>>>> >
>>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>>>> > at com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
>>>> > at
>>>> >
>>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> > at
>>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> > at
>>>> >
>>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> > at
>>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> > at
>>>> >
>>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> > at
>>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> > at
>>>> >
>>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> > at
>>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> > at
>>>> >
>>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> > at
>>>> >
>>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> > at
>>>> >
>>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> > at
>>>> >
>>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> > at
>>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> > at
>>>> > com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
>>>> > at
>>>> >
>>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>>>> > at
>>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
>>>> > at
>>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
>>>> > at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
>>>> > at
>>>> >
>>>> > com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
>>>> > at
>>>> >
>>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>>>> > at com.google.inject.Initializer.injectAll(Initializer.java:92)
>>>> > at
>>>> >
>>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
>>>> > ... 26 more
>>>> >
>>>> > I only have a vague clue on what could be wrong, but what really annoys
>>>> > me
>>>> > are the inconstant failings. So it seems to be a timing issue?
>>>> > So any hints highly appreciated
>>>> > -Nino
>>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: mybatis guice strange trouble

Simone Tripodi
Hi Nino,
thanks for the explanation, now I better understood. I need to
investigate more on the problem, this evening I'll give some tries.
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Wed, Nov 24, 2010 at 8:26 AM, nino martinez wael
<[hidden email]> wrote:

> Hi Simone
> Actually GeneralMapper.class and getGeneralMapper() is not the same,
> GeneralMapper is a super interface and getGeneralMapper() inherits from it.
> Reason why im doing it this way are that I am using 2 different databases, a
> MSSQL or Informix and the only things that differs are a few sql fragments,
> so I can reuse a lot more by using this approach, and if I do not bind
> directly to the super interface I won't get anything injected (since guice
> does not consider the child as injectable). When I discovered the error I
> was not using this approach, so I think we can rule it out.
> I'll change the way that I add mapper classes.
> So whats the next step? As I mentioned I have two tests, one hits mssql and
> the other informix the informix one works and the mssql are unstable. Both
> "drivers" works in production.
>
> 2010/11/23 Simone Tripodi <[hidden email]>
>>
>> Hi Nino,
>> can you start please eliminating
>>
>>                bind(GeneralMapper.class).to(getGeneralMapper());
>>
>> bind(CiscoStatisticsMapper.class).to(getCiscoStatisticsMapper());
>>                bind(AgentMapper.class).to(getAgentMapper());
>>
>> because the Guice module will take care of installing the mappers? In
>> this way you're declaring the mappers twice...
>> Moreover you can optimize a little your code by replacing
>>
>>                builder.addMapperClasses(getCiscoStatisticsMapper());
>>                builder.addMapperClasses(getAgentMapper());
>>                builder.addMapperClasses(getGeneralMapper());
>>
>> with
>>
>>                builder.addMapperClasses(getCiscoStatisticsMapper(),
>> getAgentMapper(), getGeneralMapper());
>>
>> Let me know!
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>>
>>
>> On Tue, Nov 23, 2010 at 2:40 PM, Simone Tripodi
>> <[hidden email]> wrote:
>> > Hi Nino,
>> > thanks, I'll let you know ASAP, stay tuned!
>> > Simo
>> >
>> > http://people.apache.org/~simonetripodi/
>> > http://www.99soft.org/
>> >
>> >
>> >
>> > On Tue, Nov 23, 2010 at 9:09 AM, nino martinez wael
>> > <[hidden email]> wrote:
>> >> sure for the failing test I am using CiscoV7Module, this has been a
>> >> hard nut
>> >> to crack and any help are very appreciated, if you need more info
>> >> please
>> >> ask:
>> >> http://pastebin.com/FL8pYFcp
>> >> I could'nt send the pasties directly to the group (was marked as spam
>> >> by
>> >> spam assassin)
>> >> -Nino
>> >>
>> >>
>> >>>
>> >>> 2010/11/22 Simone Tripodi <[hidden email]>
>> >>>>
>> >>>> Hi Nino!!
>> >>>> can you post please your configuration? It would be easier to
>> >>>> understand where the problem could be.
>> >>>> Thanks in advance!
>> >>>> Simo
>> >>>>
>> >>>> http://people.apache.org/~simonetripodi/
>> >>>> http://www.99soft.org/
>> >>>>
>> >>>>
>> >>>>
>> >>>> On Mon, Nov 22, 2010 at 10:55 AM, nino martinez wael
>> >>>> <[hidden email]> wrote:
>> >>>> > Hi Guys
>> >>>> > Im have some really strange problems with inconstant failings of
>> >>>> > test.
>> >>>> > I
>> >>>> > have a test that usually fails and some times passes, when it fails
>> >>>> > it
>> >>>> > gives
>> >>>> > this error:
>> >>>> > com.google.inject.CreationException: Guice creation errors:
>> >>>> > 1) Error in custom provider, java.lang.NullPointerException
>> >>>> >   while locating org.mybatis.guice.environment.EnvironmentProvider
>> >>>> >   while locating org.apache.ibatis.mapping.Environment
>> >>>> >     for parameter 0 at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
>> >>>> >   while locating
>> >>>> > org.mybatis.guice.configuration.ConfigurationProvider
>> >>>> >   while locating org.apache.ibatis.session.Configuration
>> >>>> >     for parameter 0 at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
>> >>>> >   while locating org.mybatis.guice.SqlSessionFactoryProvider
>> >>>> >   while locating org.apache.ibatis.session.SqlSessionFactory
>> >>>> >     for parameter 0 at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
>> >>>> >   while locating org.mybatis.guice.SqlSessionManagerProvider
>> >>>> >   while locating org.apache.ibatis.session.SqlSessionManager
>> >>>> >     for field at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
>> >>>> >   at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)
>> >>>> > 1 error
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
>> >>>> > at
>> >>>> > com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
>> >>>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> >>>> > at java.lang.reflect.Method.invoke(Method.java:597)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>> >>>> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>> >>>> > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>> >>>> > at
>> >>>> > org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>> >>>> > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>> >>>> > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>> >>>> > at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>> >>>> > Caused by: java.lang.NullPointerException
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>> >>>> > at com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>> >>>> > at com.google.inject.Initializer.injectAll(Initializer.java:92)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
>> >>>> > ... 26 more
>> >>>> >
>> >>>> > I only have a vague clue on what could be wrong, but what really
>> >>>> > annoys
>> >>>> > me
>> >>>> > are the inconstant failings. So it seems to be a timing issue?
>> >>>> > So any hints highly appreciated
>> >>>> > -Nino
>> >>>
>> >>
>> >>
>> >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: mybatis guice strange trouble

nino martinez wael
ok thanks for helping :)

2010/11/24 Simone Tripodi <[hidden email]>
Hi Nino,
thanks for the explanation, now I better understood. I need to
investigate more on the problem, this evening I'll give some tries.
On Wed, Nov 24, 2010 at 8:26 AM, nino martinez wael
<[hidden email]> wrote:
> Hi Simone
> Actually GeneralMapper.class and getGeneralMapper() is not the same,
> GeneralMapper is a super interface and getGeneralMapper() inherits from it.
> Reason why im doing it this way are that I am using 2 different databases, a
> MSSQL or Informix and the only things that differs are a few sql fragments,
> so I can reuse a lot more by using this approach, and if I do not bind
> directly to the super interface I won't get anything injected (since guice
> does not consider the child as injectable). When I discovered the error I
> was not using this approach, so I think we can rule it out.
> I'll change the way that I add mapper classes.
> So whats the next step? As I mentioned I have two tests, one hits mssql and
> the other informix the informix one works and the mssql are unstable. Both
> "drivers" works in production.
>
> 2010/11/23 Simone Tripodi <[hidden email]>
>>
>> Hi Nino,
>> can you start please eliminating
>>
>>                bind(GeneralMapper.class).to(getGeneralMapper());
>>
>> bind(CiscoStatisticsMapper.class).to(getCiscoStatisticsMapper());
>>                bind(AgentMapper.class).to(getAgentMapper());
>>
>> because the Guice module will take care of installing the mappers? In
>> this way you're declaring the mappers twice...
>> Moreover you can optimize a little your code by replacing
>>
>>                builder.addMapperClasses(getCiscoStatisticsMapper());
>>                builder.addMapperClasses(getAgentMapper());
>>                builder.addMapperClasses(getGeneralMapper());
>>
>> with
>>
>>                builder.addMapperClasses(getCiscoStatisticsMapper(),
>> getAgentMapper(), getGeneralMapper());
>>
>> Let me know!
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>>
>>
>> On Tue, Nov 23, 2010 at 2:40 PM, Simone Tripodi
>> <[hidden email]> wrote:
>> > Hi Nino,
>> > thanks, I'll let you know ASAP, stay tuned!
>> > Simo
>> >
>> > http://people.apache.org/~simonetripodi/
>> > http://www.99soft.org/
>> >
>> >
>> >
>> > On Tue, Nov 23, 2010 at 9:09 AM, nino martinez wael
>> > <[hidden email]> wrote:
>> >> sure for the failing test I am using CiscoV7Module, this has been a
>> >> hard nut
>> >> to crack and any help are very appreciated, if you need more info
>> >> please
>> >> ask:
>> >> http://pastebin.com/FL8pYFcp
>> >> I could'nt send the pasties directly to the group (was marked as spam
>> >> by
>> >> spam assassin)
>> >> -Nino
>> >>
>> >>
>> >>>
>> >>> 2010/11/22 Simone Tripodi <[hidden email]>
>> >>>>
>> >>>> Hi Nino!!
>> >>>> can you post please your configuration? It would be easier to
>> >>>> understand where the problem could be.
>> >>>> Thanks in advance!
>> >>>> Simo
>> >>>>
>> >>>> http://people.apache.org/~simonetripodi/
>> >>>> http://www.99soft.org/
>> >>>>
>> >>>>
>> >>>>
>> >>>> On Mon, Nov 22, 2010 at 10:55 AM, nino martinez wael
>> >>>> <[hidden email]> wrote:
>> >>>> > Hi Guys
>> >>>> > Im have some really strange problems with inconstant failings of
>> >>>> > test.
>> >>>> > I
>> >>>> > have a test that usually fails and some times passes, when it fails
>> >>>> > it
>> >>>> > gives
>> >>>> > this error:
>> >>>> > com.google.inject.CreationException: Guice creation errors:
>> >>>> > 1) Error in custom provider, java.lang.NullPointerException
>> >>>> >   while locating org.mybatis.guice.environment.EnvironmentProvider
>> >>>> >   while locating org.apache.ibatis.mapping.Environment
>> >>>> >     for parameter 0 at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
>> >>>> >   while locating
>> >>>> > org.mybatis.guice.configuration.ConfigurationProvider
>> >>>> >   while locating org.apache.ibatis.session.Configuration
>> >>>> >     for parameter 0 at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
>> >>>> >   while locating org.mybatis.guice.SqlSessionFactoryProvider
>> >>>> >   while locating org.apache.ibatis.session.SqlSessionFactory
>> >>>> >     for parameter 0 at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
>> >>>> >   while locating org.mybatis.guice.SqlSessionManagerProvider
>> >>>> >   while locating org.apache.ibatis.session.SqlSessionManager
>> >>>> >     for field at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
>> >>>> >   at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)
>> >>>> > 1 error
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
>> >>>> > at
>> >>>> > com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
>> >>>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> >>>> > at java.lang.reflect.Method.invoke(Method.java:597)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>> >>>> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>> >>>> > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>> >>>> > at
>> >>>> > org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>> >>>> > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>> >>>> > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>> >>>> > at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>> >>>> > Caused by: java.lang.NullPointerException
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>> >>>> > at com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>> >>>> > at com.google.inject.Initializer.injectAll(Initializer.java:92)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
>> >>>> > ... 26 more
>> >>>> >
>> >>>> > I only have a vague clue on what could be wrong, but what really
>> >>>> > annoys
>> >>>> > me
>> >>>> > are the inconstant failings. So it seems to be a timing issue?
>> >>>> > So any hints highly appreciated
>> >>>> > -Nino
>> >>>
>> >>
>> >>
>> >
>
>

Reply | Threaded
Open this post in threaded view
|

Re: mybatis guice strange trouble

nino martinez wael
Simone any news?

2010/11/24 nino martinez wael <[hidden email]>
ok thanks for helping :)

2010/11/24 Simone Tripodi <[hidden email]>

Hi Nino,
thanks for the explanation, now I better understood. I need to
investigate more on the problem, this evening I'll give some tries.
On Wed, Nov 24, 2010 at 8:26 AM, nino martinez wael
<[hidden email]> wrote:
> Hi Simone
> Actually GeneralMapper.class and getGeneralMapper() is not the same,
> GeneralMapper is a super interface and getGeneralMapper() inherits from it.
> Reason why im doing it this way are that I am using 2 different databases, a
> MSSQL or Informix and the only things that differs are a few sql fragments,
> so I can reuse a lot more by using this approach, and if I do not bind
> directly to the super interface I won't get anything injected (since guice
> does not consider the child as injectable). When I discovered the error I
> was not using this approach, so I think we can rule it out.
> I'll change the way that I add mapper classes.
> So whats the next step? As I mentioned I have two tests, one hits mssql and
> the other informix the informix one works and the mssql are unstable. Both
> "drivers" works in production.
>
> 2010/11/23 Simone Tripodi <[hidden email]>
>>
>> Hi Nino,
>> can you start please eliminating
>>
>>                bind(GeneralMapper.class).to(getGeneralMapper());
>>
>> bind(CiscoStatisticsMapper.class).to(getCiscoStatisticsMapper());
>>                bind(AgentMapper.class).to(getAgentMapper());
>>
>> because the Guice module will take care of installing the mappers? In
>> this way you're declaring the mappers twice...
>> Moreover you can optimize a little your code by replacing
>>
>>                builder.addMapperClasses(getCiscoStatisticsMapper());
>>                builder.addMapperClasses(getAgentMapper());
>>                builder.addMapperClasses(getGeneralMapper());
>>
>> with
>>
>>                builder.addMapperClasses(getCiscoStatisticsMapper(),
>> getAgentMapper(), getGeneralMapper());
>>
>> Let me know!
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>>
>>
>> On Tue, Nov 23, 2010 at 2:40 PM, Simone Tripodi
>> <[hidden email]> wrote:
>> > Hi Nino,
>> > thanks, I'll let you know ASAP, stay tuned!
>> > Simo
>> >
>> > http://people.apache.org/~simonetripodi/
>> > http://www.99soft.org/
>> >
>> >
>> >
>> > On Tue, Nov 23, 2010 at 9:09 AM, nino martinez wael
>> > <[hidden email]> wrote:
>> >> sure for the failing test I am using CiscoV7Module, this has been a
>> >> hard nut
>> >> to crack and any help are very appreciated, if you need more info
>> >> please
>> >> ask:
>> >> http://pastebin.com/FL8pYFcp
>> >> I could'nt send the pasties directly to the group (was marked as spam
>> >> by
>> >> spam assassin)
>> >> -Nino
>> >>
>> >>
>> >>>
>> >>> 2010/11/22 Simone Tripodi <[hidden email]>
>> >>>>
>> >>>> Hi Nino!!
>> >>>> can you post please your configuration? It would be easier to
>> >>>> understand where the problem could be.
>> >>>> Thanks in advance!
>> >>>> Simo
>> >>>>
>> >>>> http://people.apache.org/~simonetripodi/
>> >>>> http://www.99soft.org/
>> >>>>
>> >>>>
>> >>>>
>> >>>> On Mon, Nov 22, 2010 at 10:55 AM, nino martinez wael
>> >>>> <[hidden email]> wrote:
>> >>>> > Hi Guys
>> >>>> > Im have some really strange problems with inconstant failings of
>> >>>> > test.
>> >>>> > I
>> >>>> > have a test that usually fails and some times passes, when it fails
>> >>>> > it
>> >>>> > gives
>> >>>> > this error:
>> >>>> > com.google.inject.CreationException: Guice creation errors:
>> >>>> > 1) Error in custom provider, java.lang.NullPointerException
>> >>>> >   while locating org.mybatis.guice.environment.EnvironmentProvider
>> >>>> >   while locating org.apache.ibatis.mapping.Environment
>> >>>> >     for parameter 0 at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
>> >>>> >   while locating
>> >>>> > org.mybatis.guice.configuration.ConfigurationProvider
>> >>>> >   while locating org.apache.ibatis.session.Configuration
>> >>>> >     for parameter 0 at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
>> >>>> >   while locating org.mybatis.guice.SqlSessionFactoryProvider
>> >>>> >   while locating org.apache.ibatis.session.SqlSessionFactory
>> >>>> >     for parameter 0 at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
>> >>>> >   while locating org.mybatis.guice.SqlSessionManagerProvider
>> >>>> >   while locating org.apache.ibatis.session.SqlSessionManager
>> >>>> >     for field at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
>> >>>> >   at
>> >>>> >
>> >>>> >
>> >>>> > org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)
>> >>>> > 1 error
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
>> >>>> > at
>> >>>> > com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
>> >>>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> >>>> > at java.lang.reflect.Method.invoke(Method.java:597)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>> >>>> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>> >>>> > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>> >>>> > at
>> >>>> > org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>> >>>> > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>> >>>> > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>> >>>> > at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>> >>>> > Caused by: java.lang.NullPointerException
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>> >>>> > at com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
>> >>>> > at
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
>> >>>> > at
>> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>> >>>> > at com.google.inject.Initializer.injectAll(Initializer.java:92)
>> >>>> > at
>> >>>> >
>> >>>> >
>> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
>> >>>> > ... 26 more
>> >>>> >
>> >>>> > I only have a vague clue on what could be wrong, but what really
>> >>>> > annoys
>> >>>> > me
>> >>>> > are the inconstant failings. So it seems to be a timing issue?
>> >>>> > So any hints highly appreciated
>> >>>> > -Nino
>> >>>
>> >>
>> >>
>> >
>
>


Reply | Threaded
Open this post in threaded view
|

Re: mybatis guice strange trouble

Simone Tripodi
Hi Nino,
unfortunately not, didn't have the time yesterday since I left the
office very late :(
I'll give a try this evening, hopefully
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Thu, Nov 25, 2010 at 3:22 PM, nino martinez wael
<[hidden email]> wrote:

> Simone any news?
>
> 2010/11/24 nino martinez wael <[hidden email]>
>>
>> ok thanks for helping :)
>>
>> 2010/11/24 Simone Tripodi <[hidden email]>
>>>
>>> Hi Nino,
>>> thanks for the explanation, now I better understood. I need to
>>> investigate more on the problem, this evening I'll give some tries.
>>> Simo
>>>
>>> http://people.apache.org/~simonetripodi/
>>> http://www.99soft.org/
>>>
>>>
>>>
>>> On Wed, Nov 24, 2010 at 8:26 AM, nino martinez wael
>>> <[hidden email]> wrote:
>>> > Hi Simone
>>> > Actually GeneralMapper.class and getGeneralMapper() is not the same,
>>> > GeneralMapper is a super interface and getGeneralMapper() inherits from
>>> > it.
>>> > Reason why im doing it this way are that I am using 2 different
>>> > databases, a
>>> > MSSQL or Informix and the only things that differs are a few sql
>>> > fragments,
>>> > so I can reuse a lot more by using this approach, and if I do not bind
>>> > directly to the super interface I won't get anything injected (since
>>> > guice
>>> > does not consider the child as injectable). When I discovered the error
>>> > I
>>> > was not using this approach, so I think we can rule it out.
>>> > I'll change the way that I add mapper classes.
>>> > So whats the next step? As I mentioned I have two tests, one hits mssql
>>> > and
>>> > the other informix the informix one works and the mssql are unstable.
>>> > Both
>>> > "drivers" works in production.
>>> >
>>> > 2010/11/23 Simone Tripodi <[hidden email]>
>>> >>
>>> >> Hi Nino,
>>> >> can you start please eliminating
>>> >>
>>> >>                bind(GeneralMapper.class).to(getGeneralMapper());
>>> >>
>>> >> bind(CiscoStatisticsMapper.class).to(getCiscoStatisticsMapper());
>>> >>                bind(AgentMapper.class).to(getAgentMapper());
>>> >>
>>> >> because the Guice module will take care of installing the mappers? In
>>> >> this way you're declaring the mappers twice...
>>> >> Moreover you can optimize a little your code by replacing
>>> >>
>>> >>                builder.addMapperClasses(getCiscoStatisticsMapper());
>>> >>                builder.addMapperClasses(getAgentMapper());
>>> >>                builder.addMapperClasses(getGeneralMapper());
>>> >>
>>> >> with
>>> >>
>>> >>                builder.addMapperClasses(getCiscoStatisticsMapper(),
>>> >> getAgentMapper(), getGeneralMapper());
>>> >>
>>> >> Let me know!
>>> >> Simo
>>> >>
>>> >> http://people.apache.org/~simonetripodi/
>>> >> http://www.99soft.org/
>>> >>
>>> >>
>>> >>
>>> >> On Tue, Nov 23, 2010 at 2:40 PM, Simone Tripodi
>>> >> <[hidden email]> wrote:
>>> >> > Hi Nino,
>>> >> > thanks, I'll let you know ASAP, stay tuned!
>>> >> > Simo
>>> >> >
>>> >> > http://people.apache.org/~simonetripodi/
>>> >> > http://www.99soft.org/
>>> >> >
>>> >> >
>>> >> >
>>> >> > On Tue, Nov 23, 2010 at 9:09 AM, nino martinez wael
>>> >> > <[hidden email]> wrote:
>>> >> >> sure for the failing test I am using CiscoV7Module, this has been a
>>> >> >> hard nut
>>> >> >> to crack and any help are very appreciated, if you need more info
>>> >> >> please
>>> >> >> ask:
>>> >> >> http://pastebin.com/FL8pYFcp
>>> >> >> I could'nt send the pasties directly to the group (was marked as
>>> >> >> spam
>>> >> >> by
>>> >> >> spam assassin)
>>> >> >> -Nino
>>> >> >>
>>> >> >>
>>> >> >>>
>>> >> >>> 2010/11/22 Simone Tripodi <[hidden email]>
>>> >> >>>>
>>> >> >>>> Hi Nino!!
>>> >> >>>> can you post please your configuration? It would be easier to
>>> >> >>>> understand where the problem could be.
>>> >> >>>> Thanks in advance!
>>> >> >>>> Simo
>>> >> >>>>
>>> >> >>>> http://people.apache.org/~simonetripodi/
>>> >> >>>> http://www.99soft.org/
>>> >> >>>>
>>> >> >>>>
>>> >> >>>>
>>> >> >>>> On Mon, Nov 22, 2010 at 10:55 AM, nino martinez wael
>>> >> >>>> <[hidden email]> wrote:
>>> >> >>>> > Hi Guys
>>> >> >>>> > Im have some really strange problems with inconstant failings
>>> >> >>>> > of
>>> >> >>>> > test.
>>> >> >>>> > I
>>> >> >>>> > have a test that usually fails and some times passes, when it
>>> >> >>>> > fails
>>> >> >>>> > it
>>> >> >>>> > gives
>>> >> >>>> > this error:
>>> >> >>>> > com.google.inject.CreationException: Guice creation errors:
>>> >> >>>> > 1) Error in custom provider, java.lang.NullPointerException
>>> >> >>>> >   while locating
>>> >> >>>> > org.mybatis.guice.environment.EnvironmentProvider
>>> >> >>>> >   while locating org.apache.ibatis.mapping.Environment
>>> >> >>>> >     for parameter 0 at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
>>> >> >>>> >   while locating
>>> >> >>>> > org.mybatis.guice.configuration.ConfigurationProvider
>>> >> >>>> >   while locating org.apache.ibatis.session.Configuration
>>> >> >>>> >     for parameter 0 at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
>>> >> >>>> >   while locating org.mybatis.guice.SqlSessionFactoryProvider
>>> >> >>>> >   while locating org.apache.ibatis.session.SqlSessionFactory
>>> >> >>>> >     for parameter 0 at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
>>> >> >>>> >   while locating org.mybatis.guice.SqlSessionManagerProvider
>>> >> >>>> >   while locating org.apache.ibatis.session.SqlSessionManager
>>> >> >>>> >     for field at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
>>> >> >>>> >   at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)
>>> >> >>>> > 1 error
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> > com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
>>> >> >>>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> >> >>>> > at java.lang.reflect.Method.invoke(Method.java:597)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>>> >> >>>> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>>> >> >>>> > at
>>> >> >>>> > org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> > org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>>> >> >>>> > at
>>> >> >>>> > org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>>> >> >>>> > at
>>> >> >>>> > org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>>> >> >>>> > at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>>> >> >>>> > Caused by: java.lang.NullPointerException
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>>> >> >>>> > at
>>> >> >>>> > com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>>> >> >>>> > at com.google.inject.Initializer.injectAll(Initializer.java:92)
>>> >> >>>> > at
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> >
>>> >> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
>>> >> >>>> > ... 26 more
>>> >> >>>> >
>>> >> >>>> > I only have a vague clue on what could be wrong, but what
>>> >> >>>> > really
>>> >> >>>> > annoys
>>> >> >>>> > me
>>> >> >>>> > are the inconstant failings. So it seems to be a timing issue?
>>> >> >>>> > So any hints highly appreciated
>>> >> >>>> > -Nino
>>> >> >>>
>>> >> >>
>>> >> >>
>>> >> >
>>> >
>>> >
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: mybatis guice strange trouble

Simone Tripodi
Hi Nino,
without having the access to the code it's quite hard to understand
why the injections fails :/ Can you run please the following piece of
code:

            for (Entry<Key<?>, Binding<?>> binding :
injector.getBindings().entrySet()) {
                System.err.println(binding.getKey() + " -> " +
binding.getValue());
            }

please paste this snip BEFORE invoking injector.injectMembers()/getInstance().
Then maybe the binding list will suggest us what is missing, that
problem is driving me crazy because everything looks fine!!!
Thanks in advance,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Thu, Nov 25, 2010 at 3:43 PM, Simone Tripodi
<[hidden email]> wrote:

> Hi Nino,
> unfortunately not, didn't have the time yesterday since I left the
> office very late :(
> I'll give a try this evening, hopefully
> Simo
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
>
>
> On Thu, Nov 25, 2010 at 3:22 PM, nino martinez wael
> <[hidden email]> wrote:
>> Simone any news?
>>
>> 2010/11/24 nino martinez wael <[hidden email]>
>>>
>>> ok thanks for helping :)
>>>
>>> 2010/11/24 Simone Tripodi <[hidden email]>
>>>>
>>>> Hi Nino,
>>>> thanks for the explanation, now I better understood. I need to
>>>> investigate more on the problem, this evening I'll give some tries.
>>>> Simo
>>>>
>>>> http://people.apache.org/~simonetripodi/
>>>> http://www.99soft.org/
>>>>
>>>>
>>>>
>>>> On Wed, Nov 24, 2010 at 8:26 AM, nino martinez wael
>>>> <[hidden email]> wrote:
>>>> > Hi Simone
>>>> > Actually GeneralMapper.class and getGeneralMapper() is not the same,
>>>> > GeneralMapper is a super interface and getGeneralMapper() inherits from
>>>> > it.
>>>> > Reason why im doing it this way are that I am using 2 different
>>>> > databases, a
>>>> > MSSQL or Informix and the only things that differs are a few sql
>>>> > fragments,
>>>> > so I can reuse a lot more by using this approach, and if I do not bind
>>>> > directly to the super interface I won't get anything injected (since
>>>> > guice
>>>> > does not consider the child as injectable). When I discovered the error
>>>> > I
>>>> > was not using this approach, so I think we can rule it out.
>>>> > I'll change the way that I add mapper classes.
>>>> > So whats the next step? As I mentioned I have two tests, one hits mssql
>>>> > and
>>>> > the other informix the informix one works and the mssql are unstable.
>>>> > Both
>>>> > "drivers" works in production.
>>>> >
>>>> > 2010/11/23 Simone Tripodi <[hidden email]>
>>>> >>
>>>> >> Hi Nino,
>>>> >> can you start please eliminating
>>>> >>
>>>> >>                bind(GeneralMapper.class).to(getGeneralMapper());
>>>> >>
>>>> >> bind(CiscoStatisticsMapper.class).to(getCiscoStatisticsMapper());
>>>> >>                bind(AgentMapper.class).to(getAgentMapper());
>>>> >>
>>>> >> because the Guice module will take care of installing the mappers? In
>>>> >> this way you're declaring the mappers twice...
>>>> >> Moreover you can optimize a little your code by replacing
>>>> >>
>>>> >>                builder.addMapperClasses(getCiscoStatisticsMapper());
>>>> >>                builder.addMapperClasses(getAgentMapper());
>>>> >>                builder.addMapperClasses(getGeneralMapper());
>>>> >>
>>>> >> with
>>>> >>
>>>> >>                builder.addMapperClasses(getCiscoStatisticsMapper(),
>>>> >> getAgentMapper(), getGeneralMapper());
>>>> >>
>>>> >> Let me know!
>>>> >> Simo
>>>> >>
>>>> >> http://people.apache.org/~simonetripodi/
>>>> >> http://www.99soft.org/
>>>> >>
>>>> >>
>>>> >>
>>>> >> On Tue, Nov 23, 2010 at 2:40 PM, Simone Tripodi
>>>> >> <[hidden email]> wrote:
>>>> >> > Hi Nino,
>>>> >> > thanks, I'll let you know ASAP, stay tuned!
>>>> >> > Simo
>>>> >> >
>>>> >> > http://people.apache.org/~simonetripodi/
>>>> >> > http://www.99soft.org/
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> > On Tue, Nov 23, 2010 at 9:09 AM, nino martinez wael
>>>> >> > <[hidden email]> wrote:
>>>> >> >> sure for the failing test I am using CiscoV7Module, this has been a
>>>> >> >> hard nut
>>>> >> >> to crack and any help are very appreciated, if you need more info
>>>> >> >> please
>>>> >> >> ask:
>>>> >> >> http://pastebin.com/FL8pYFcp
>>>> >> >> I could'nt send the pasties directly to the group (was marked as
>>>> >> >> spam
>>>> >> >> by
>>>> >> >> spam assassin)
>>>> >> >> -Nino
>>>> >> >>
>>>> >> >>
>>>> >> >>>
>>>> >> >>> 2010/11/22 Simone Tripodi <[hidden email]>
>>>> >> >>>>
>>>> >> >>>> Hi Nino!!
>>>> >> >>>> can you post please your configuration? It would be easier to
>>>> >> >>>> understand where the problem could be.
>>>> >> >>>> Thanks in advance!
>>>> >> >>>> Simo
>>>> >> >>>>
>>>> >> >>>> http://people.apache.org/~simonetripodi/
>>>> >> >>>> http://www.99soft.org/
>>>> >> >>>>
>>>> >> >>>>
>>>> >> >>>>
>>>> >> >>>> On Mon, Nov 22, 2010 at 10:55 AM, nino martinez wael
>>>> >> >>>> <[hidden email]> wrote:
>>>> >> >>>> > Hi Guys
>>>> >> >>>> > Im have some really strange problems with inconstant failings
>>>> >> >>>> > of
>>>> >> >>>> > test.
>>>> >> >>>> > I
>>>> >> >>>> > have a test that usually fails and some times passes, when it
>>>> >> >>>> > fails
>>>> >> >>>> > it
>>>> >> >>>> > gives
>>>> >> >>>> > this error:
>>>> >> >>>> > com.google.inject.CreationException: Guice creation errors:
>>>> >> >>>> > 1) Error in custom provider, java.lang.NullPointerException
>>>> >> >>>> >   while locating
>>>> >> >>>> > org.mybatis.guice.environment.EnvironmentProvider
>>>> >> >>>> >   while locating org.apache.ibatis.mapping.Environment
>>>> >> >>>> >     for parameter 0 at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
>>>> >> >>>> >   while locating
>>>> >> >>>> > org.mybatis.guice.configuration.ConfigurationProvider
>>>> >> >>>> >   while locating org.apache.ibatis.session.Configuration
>>>> >> >>>> >     for parameter 0 at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
>>>> >> >>>> >   while locating org.mybatis.guice.SqlSessionFactoryProvider
>>>> >> >>>> >   while locating org.apache.ibatis.session.SqlSessionFactory
>>>> >> >>>> >     for parameter 0 at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
>>>> >> >>>> >   while locating org.mybatis.guice.SqlSessionManagerProvider
>>>> >> >>>> >   while locating org.apache.ibatis.session.SqlSessionManager
>>>> >> >>>> >     for field at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
>>>> >> >>>> >   at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)
>>>> >> >>>> > 1 error
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
>>>> >> >>>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>> >> >>>> > at java.lang.reflect.Method.invoke(Method.java:597)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>>>> >> >>>> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>>>> >> >>>> > at
>>>> >> >>>> > org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> > org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>>>> >> >>>> > at
>>>> >> >>>> > org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>>>> >> >>>> > at
>>>> >> >>>> > org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>>>> >> >>>> > at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>>>> >> >>>> > Caused by: java.lang.NullPointerException
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>>>> >> >>>> > at
>>>> >> >>>> > com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>>>> >> >>>> > at com.google.inject.Initializer.injectAll(Initializer.java:92)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
>>>> >> >>>> > ... 26 more
>>>> >> >>>> >
>>>> >> >>>> > I only have a vague clue on what could be wrong, but what
>>>> >> >>>> > really
>>>> >> >>>> > annoys
>>>> >> >>>> > me
>>>> >> >>>> > are the inconstant failings. So it seems to be a timing issue?
>>>> >> >>>> > So any hints highly appreciated
>>>> >> >>>> > -Nino
>>>> >> >>>
>>>> >> >>
>>>> >> >>
>>>> >> >
>>>> >
>>>> >
>>>
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: mybatis guice strange trouble

nino martinez wael
Hi Simone

I know it's very hard looking at the code without the full code. I'll paste your snip in on monday.. This has also being driving me crazy, since it works sometimes and sometimes not, and using the informix driver it always works (now there may be some subtle difference between the ms sql and informix one).

You havent been able to replicate anything so far right?

regards Nino

2010/11/26 Simone Tripodi <[hidden email]>
Hi Nino,
without having the access to the code it's quite hard to understand
why the injections fails :/ Can you run please the following piece of
code:

           for (Entry<Key<?>, Binding<?>> binding :
injector.getBindings().entrySet()) {
               System.err.println(binding.getKey() + " -> " +
binding.getValue());
           }

please paste this snip BEFORE invoking injector.injectMembers()/getInstance().
Then maybe the binding list will suggest us what is missing, that
problem is driving me crazy because everything looks fine!!!
On Thu, Nov 25, 2010 at 3:43 PM, Simone Tripodi
<[hidden email]> wrote:
> Hi Nino,
> unfortunately not, didn't have the time yesterday since I left the
> office very late :(
> I'll give a try this evening, hopefully
> Simo
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
>
>
> On Thu, Nov 25, 2010 at 3:22 PM, nino martinez wael
> <[hidden email]> wrote:
>> Simone any news?
>>
>> 2010/11/24 nino martinez wael <[hidden email]>
>>>
>>> ok thanks for helping :)
>>>
>>> 2010/11/24 Simone Tripodi <[hidden email]>
>>>>
>>>> Hi Nino,
>>>> thanks for the explanation, now I better understood. I need to
>>>> investigate more on the problem, this evening I'll give some tries.
>>>> Simo
>>>>
>>>> http://people.apache.org/~simonetripodi/
>>>> http://www.99soft.org/
>>>>
>>>>
>>>>
>>>> On Wed, Nov 24, 2010 at 8:26 AM, nino martinez wael
>>>> <[hidden email]> wrote:
>>>> > Hi Simone
>>>> > Actually GeneralMapper.class and getGeneralMapper() is not the same,
>>>> > GeneralMapper is a super interface and getGeneralMapper() inherits from
>>>> > it.
>>>> > Reason why im doing it this way are that I am using 2 different
>>>> > databases, a
>>>> > MSSQL or Informix and the only things that differs are a few sql
>>>> > fragments,
>>>> > so I can reuse a lot more by using this approach, and if I do not bind
>>>> > directly to the super interface I won't get anything injected (since
>>>> > guice
>>>> > does not consider the child as injectable). When I discovered the error
>>>> > I
>>>> > was not using this approach, so I think we can rule it out.
>>>> > I'll change the way that I add mapper classes.
>>>> > So whats the next step? As I mentioned I have two tests, one hits mssql
>>>> > and
>>>> > the other informix the informix one works and the mssql are unstable.
>>>> > Both
>>>> > "drivers" works in production.
>>>> >
>>>> > 2010/11/23 Simone Tripodi <[hidden email]>
>>>> >>
>>>> >> Hi Nino,
>>>> >> can you start please eliminating
>>>> >>
>>>> >>                bind(GeneralMapper.class).to(getGeneralMapper());
>>>> >>
>>>> >> bind(CiscoStatisticsMapper.class).to(getCiscoStatisticsMapper());
>>>> >>                bind(AgentMapper.class).to(getAgentMapper());
>>>> >>
>>>> >> because the Guice module will take care of installing the mappers? In
>>>> >> this way you're declaring the mappers twice...
>>>> >> Moreover you can optimize a little your code by replacing
>>>> >>
>>>> >>                builder.addMapperClasses(getCiscoStatisticsMapper());
>>>> >>                builder.addMapperClasses(getAgentMapper());
>>>> >>                builder.addMapperClasses(getGeneralMapper());
>>>> >>
>>>> >> with
>>>> >>
>>>> >>                builder.addMapperClasses(getCiscoStatisticsMapper(),
>>>> >> getAgentMapper(), getGeneralMapper());
>>>> >>
>>>> >> Let me know!
>>>> >> Simo
>>>> >>
>>>> >> http://people.apache.org/~simonetripodi/
>>>> >> http://www.99soft.org/
>>>> >>
>>>> >>
>>>> >>
>>>> >> On Tue, Nov 23, 2010 at 2:40 PM, Simone Tripodi
>>>> >> <[hidden email]> wrote:
>>>> >> > Hi Nino,
>>>> >> > thanks, I'll let you know ASAP, stay tuned!
>>>> >> > Simo
>>>> >> >
>>>> >> > http://people.apache.org/~simonetripodi/
>>>> >> > http://www.99soft.org/
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> > On Tue, Nov 23, 2010 at 9:09 AM, nino martinez wael
>>>> >> > <[hidden email]> wrote:
>>>> >> >> sure for the failing test I am using CiscoV7Module, this has been a
>>>> >> >> hard nut
>>>> >> >> to crack and any help are very appreciated, if you need more info
>>>> >> >> please
>>>> >> >> ask:
>>>> >> >> http://pastebin.com/FL8pYFcp
>>>> >> >> I could'nt send the pasties directly to the group (was marked as
>>>> >> >> spam
>>>> >> >> by
>>>> >> >> spam assassin)
>>>> >> >> -Nino
>>>> >> >>
>>>> >> >>
>>>> >> >>>
>>>> >> >>> 2010/11/22 Simone Tripodi <[hidden email]>
>>>> >> >>>>
>>>> >> >>>> Hi Nino!!
>>>> >> >>>> can you post please your configuration? It would be easier to
>>>> >> >>>> understand where the problem could be.
>>>> >> >>>> Thanks in advance!
>>>> >> >>>> Simo
>>>> >> >>>>
>>>> >> >>>> http://people.apache.org/~simonetripodi/
>>>> >> >>>> http://www.99soft.org/
>>>> >> >>>>
>>>> >> >>>>
>>>> >> >>>>
>>>> >> >>>> On Mon, Nov 22, 2010 at 10:55 AM, nino martinez wael
>>>> >> >>>> <[hidden email]> wrote:
>>>> >> >>>> > Hi Guys
>>>> >> >>>> > Im have some really strange problems with inconstant failings
>>>> >> >>>> > of
>>>> >> >>>> > test.
>>>> >> >>>> > I
>>>> >> >>>> > have a test that usually fails and some times passes, when it
>>>> >> >>>> > fails
>>>> >> >>>> > it
>>>> >> >>>> > gives
>>>> >> >>>> > this error:
>>>> >> >>>> > com.google.inject.CreationException: Guice creation errors:
>>>> >> >>>> > 1) Error in custom provider, java.lang.NullPointerException
>>>> >> >>>> >   while locating
>>>> >> >>>> > org.mybatis.guice.environment.EnvironmentProvider
>>>> >> >>>> >   while locating org.apache.ibatis.mapping.Environment
>>>> >> >>>> >     for parameter 0 at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
>>>> >> >>>> >   while locating
>>>> >> >>>> > org.mybatis.guice.configuration.ConfigurationProvider
>>>> >> >>>> >   while locating org.apache.ibatis.session.Configuration
>>>> >> >>>> >     for parameter 0 at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
>>>> >> >>>> >   while locating org.mybatis.guice.SqlSessionFactoryProvider
>>>> >> >>>> >   while locating org.apache.ibatis.session.SqlSessionFactory
>>>> >> >>>> >     for parameter 0 at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
>>>> >> >>>> >   while locating org.mybatis.guice.SqlSessionManagerProvider
>>>> >> >>>> >   while locating org.apache.ibatis.session.SqlSessionManager
>>>> >> >>>> >     for field at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
>>>> >> >>>> >   at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)
>>>> >> >>>> > 1 error
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
>>>> >> >>>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>> >> >>>> > at java.lang.reflect.Method.invoke(Method.java:597)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>>>> >> >>>> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>>>> >> >>>> > at
>>>> >> >>>> > org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> > org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>>>> >> >>>> > at
>>>> >> >>>> > org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>>>> >> >>>> > at
>>>> >> >>>> > org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>>>> >> >>>> > at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>>>> >> >>>> > Caused by: java.lang.NullPointerException
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>>>> >> >>>> > at
>>>> >> >>>> > com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>>>> >> >>>> > at com.google.inject.Initializer.injectAll(Initializer.java:92)
>>>> >> >>>> > at
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> >
>>>> >> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
>>>> >> >>>> > ... 26 more
>>>> >> >>>> >
>>>> >> >>>> > I only have a vague clue on what could be wrong, but what
>>>> >> >>>> > really
>>>> >> >>>> > annoys
>>>> >> >>>> > me
>>>> >> >>>> > are the inconstant failings. So it seems to be a timing issue?
>>>> >> >>>> > So any hints highly appreciated
>>>> >> >>>> > -Nino
>>>> >> >>>
>>>> >> >>
>>>> >> >>
>>>> >> >
>>>> >
>>>> >
>>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: mybatis guice strange trouble

Simone Tripodi
Hi Nino,
unfortunately not, without the full code it's really hard to reproduce
the problem.
BTW, is it a project you're developing for your company? If you could
provide me an access I can help you. Send me a DM if this option would
be available.
Have a nice evening,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Fri, Nov 26, 2010 at 6:24 PM, nino martinez wael
<[hidden email]> wrote:

> Hi Simone
> I know it's very hard looking at the code without the full code. I'll paste
> your snip in on monday.. This has also being driving me crazy, since it
> works sometimes and sometimes not, and using the informix driver it always
> works (now there may be some subtle difference between the ms sql and
> informix one).
> You havent been able to replicate anything so far right?
> regards Nino
>
> 2010/11/26 Simone Tripodi <[hidden email]>
>>
>> Hi Nino,
>> without having the access to the code it's quite hard to understand
>> why the injections fails :/ Can you run please the following piece of
>> code:
>>
>>            for (Entry<Key<?>, Binding<?>> binding :
>> injector.getBindings().entrySet()) {
>>                System.err.println(binding.getKey() + " -> " +
>> binding.getValue());
>>            }
>>
>> please paste this snip BEFORE invoking
>> injector.injectMembers()/getInstance().
>> Then maybe the binding list will suggest us what is missing, that
>> problem is driving me crazy because everything looks fine!!!
>> Thanks in advance,
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>>
>>
>> On Thu, Nov 25, 2010 at 3:43 PM, Simone Tripodi
>> <[hidden email]> wrote:
>> > Hi Nino,
>> > unfortunately not, didn't have the time yesterday since I left the
>> > office very late :(
>> > I'll give a try this evening, hopefully
>> > Simo
>> >
>> > http://people.apache.org/~simonetripodi/
>> > http://www.99soft.org/
>> >
>> >
>> >
>> > On Thu, Nov 25, 2010 at 3:22 PM, nino martinez wael
>> > <[hidden email]> wrote:
>> >> Simone any news?
>> >>
>> >> 2010/11/24 nino martinez wael <[hidden email]>
>> >>>
>> >>> ok thanks for helping :)
>> >>>
>> >>> 2010/11/24 Simone Tripodi <[hidden email]>
>> >>>>
>> >>>> Hi Nino,
>> >>>> thanks for the explanation, now I better understood. I need to
>> >>>> investigate more on the problem, this evening I'll give some tries.
>> >>>> Simo
>> >>>>
>> >>>> http://people.apache.org/~simonetripodi/
>> >>>> http://www.99soft.org/
>> >>>>
>> >>>>
>> >>>>
>> >>>> On Wed, Nov 24, 2010 at 8:26 AM, nino martinez wael
>> >>>> <[hidden email]> wrote:
>> >>>> > Hi Simone
>> >>>> > Actually GeneralMapper.class and getGeneralMapper() is not the
>> >>>> > same,
>> >>>> > GeneralMapper is a super interface and getGeneralMapper() inherits
>> >>>> > from
>> >>>> > it.
>> >>>> > Reason why im doing it this way are that I am using 2 different
>> >>>> > databases, a
>> >>>> > MSSQL or Informix and the only things that differs are a few sql
>> >>>> > fragments,
>> >>>> > so I can reuse a lot more by using this approach, and if I do not
>> >>>> > bind
>> >>>> > directly to the super interface I won't get anything injected
>> >>>> > (since
>> >>>> > guice
>> >>>> > does not consider the child as injectable). When I discovered the
>> >>>> > error
>> >>>> > I
>> >>>> > was not using this approach, so I think we can rule it out.
>> >>>> > I'll change the way that I add mapper classes.
>> >>>> > So whats the next step? As I mentioned I have two tests, one hits
>> >>>> > mssql
>> >>>> > and
>> >>>> > the other informix the informix one works and the mssql are
>> >>>> > unstable.
>> >>>> > Both
>> >>>> > "drivers" works in production.
>> >>>> >
>> >>>> > 2010/11/23 Simone Tripodi <[hidden email]>
>> >>>> >>
>> >>>> >> Hi Nino,
>> >>>> >> can you start please eliminating
>> >>>> >>
>> >>>> >>                bind(GeneralMapper.class).to(getGeneralMapper());
>> >>>> >>
>> >>>> >> bind(CiscoStatisticsMapper.class).to(getCiscoStatisticsMapper());
>> >>>> >>                bind(AgentMapper.class).to(getAgentMapper());
>> >>>> >>
>> >>>> >> because the Guice module will take care of installing the mappers?
>> >>>> >> In
>> >>>> >> this way you're declaring the mappers twice...
>> >>>> >> Moreover you can optimize a little your code by replacing
>> >>>> >>
>> >>>> >>
>> >>>> >>  builder.addMapperClasses(getCiscoStatisticsMapper());
>> >>>> >>                builder.addMapperClasses(getAgentMapper());
>> >>>> >>                builder.addMapperClasses(getGeneralMapper());
>> >>>> >>
>> >>>> >> with
>> >>>> >>
>> >>>> >>
>> >>>> >>  builder.addMapperClasses(getCiscoStatisticsMapper(),
>> >>>> >> getAgentMapper(), getGeneralMapper());
>> >>>> >>
>> >>>> >> Let me know!
>> >>>> >> Simo
>> >>>> >>
>> >>>> >> http://people.apache.org/~simonetripodi/
>> >>>> >> http://www.99soft.org/
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> On Tue, Nov 23, 2010 at 2:40 PM, Simone Tripodi
>> >>>> >> <[hidden email]> wrote:
>> >>>> >> > Hi Nino,
>> >>>> >> > thanks, I'll let you know ASAP, stay tuned!
>> >>>> >> > Simo
>> >>>> >> >
>> >>>> >> > http://people.apache.org/~simonetripodi/
>> >>>> >> > http://www.99soft.org/
>> >>>> >> >
>> >>>> >> >
>> >>>> >> >
>> >>>> >> > On Tue, Nov 23, 2010 at 9:09 AM, nino martinez wael
>> >>>> >> > <[hidden email]> wrote:
>> >>>> >> >> sure for the failing test I am using CiscoV7Module, this has
>> >>>> >> >> been a
>> >>>> >> >> hard nut
>> >>>> >> >> to crack and any help are very appreciated, if you need more
>> >>>> >> >> info
>> >>>> >> >> please
>> >>>> >> >> ask:
>> >>>> >> >> http://pastebin.com/FL8pYFcp
>> >>>> >> >> I could'nt send the pasties directly to the group (was marked
>> >>>> >> >> as
>> >>>> >> >> spam
>> >>>> >> >> by
>> >>>> >> >> spam assassin)
>> >>>> >> >> -Nino
>> >>>> >> >>
>> >>>> >> >>
>> >>>> >> >>>
>> >>>> >> >>> 2010/11/22 Simone Tripodi <[hidden email]>
>> >>>> >> >>>>
>> >>>> >> >>>> Hi Nino!!
>> >>>> >> >>>> can you post please your configuration? It would be easier to
>> >>>> >> >>>> understand where the problem could be.
>> >>>> >> >>>> Thanks in advance!
>> >>>> >> >>>> Simo
>> >>>> >> >>>>
>> >>>> >> >>>> http://people.apache.org/~simonetripodi/
>> >>>> >> >>>> http://www.99soft.org/
>> >>>> >> >>>>
>> >>>> >> >>>>
>> >>>> >> >>>>
>> >>>> >> >>>> On Mon, Nov 22, 2010 at 10:55 AM, nino martinez wael
>> >>>> >> >>>> <[hidden email]> wrote:
>> >>>> >> >>>> > Hi Guys
>> >>>> >> >>>> > Im have some really strange problems
>> >>>> >> >>>> > with inconstant failings
>> >>>> >> >>>> > of
>> >>>> >> >>>> > test.
>> >>>> >> >>>> > I
>> >>>> >> >>>> > have a test that usually fails and some times passes, when
>> >>>> >> >>>> > it
>> >>>> >> >>>> > fails
>> >>>> >> >>>> > it
>> >>>> >> >>>> > gives
>> >>>> >> >>>> > this error:
>> >>>> >> >>>> > com.google.inject.CreationException: Guice creation errors:
>> >>>> >> >>>> > 1) Error in custom provider, java.lang.NullPointerException
>> >>>> >> >>>> >   while locating
>> >>>> >> >>>> > org.mybatis.guice.environment.EnvironmentProvider
>> >>>> >> >>>> >   while locating org.apache.ibatis.mapping.Environment
>> >>>> >> >>>> >     for parameter 0 at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
>> >>>> >> >>>> >   while locating
>> >>>> >> >>>> > org.mybatis.guice.configuration.ConfigurationProvider
>> >>>> >> >>>> >   while locating org.apache.ibatis.session.Configuration
>> >>>> >> >>>> >     for parameter 0 at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
>> >>>> >> >>>> >   while locating
>> >>>> >> >>>> > org.mybatis.guice.SqlSessionFactoryProvider
>> >>>> >> >>>> >   while locating
>> >>>> >> >>>> > org.apache.ibatis.session.SqlSessionFactory
>> >>>> >> >>>> >     for parameter 0 at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
>> >>>> >> >>>> >   while locating
>> >>>> >> >>>> > org.mybatis.guice.SqlSessionManagerProvider
>> >>>> >> >>>> >   while locating
>> >>>> >> >>>> > org.apache.ibatis.session.SqlSessionManager
>> >>>> >> >>>> >     for field at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
>> >>>> >> >>>> >   at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)
>> >>>> >> >>>> > 1 error
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
>> >>>> >> >>>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> >>>> >> >>>> > Method)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> >>>> >> >>>> > at java.lang.reflect.Method.invoke(Method.java:597)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>> >>>> >> >>>> > at
>> >>>> >> >>>> > org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>> >>>> >> >>>> > at
>> >>>> >> >>>> > org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>> >>>> >> >>>> > Caused by: java.lang.NullPointerException
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>> >>>> >> >>>> > at
>> >>>> >> >>>> > com.google.inject.Initializer.injectAll(Initializer.java:92)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
>> >>>> >> >>>> > ... 26 more
>> >>>> >> >>>> >
>> >>>> >> >>>> > I only have a vague clue on what could be wrong, but what
>> >>>> >> >>>> > really
>> >>>> >> >>>> > annoys
>> >>>> >> >>>> > me
>> >>>> >> >>>> > are the inconstant failings. So it seems to be a timing
>> >>>> >> >>>> > issue?
>> >>>> >> >>>> > So any hints highly appreciated
>> >>>> >> >>>> > -Nino
>> >>>> >> >>>
>> >>>> >> >>
>> >>>> >> >>
>> >>>> >> >
>> >>>> >
>> >>>> >
>> >>>
>> >>
>> >>
>> >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: mybatis guice strange trouble

nino martinez wael
Yes its a project for the company, though access is a little bit troublesome, and you would need to be on our wan to run the failing test, so I'd suggest we wait a bit with this..

However your idea with showing the different bindings was a good idea , it produced this (on the working test, it never makes it on the failing test, see source code snip latter in the mail) :

Key[type=com.google.inject.Injector, annotation=[none]] -> ProviderInstanceBinding[key=Key[type=com.google.inject.Injector, annotation=[none]], source=[unknown source], scope=Scopes.NO_SCOPE, provider=Provider<Injector>]
Key[type=java.util.logging.Logger, annotation=[none]] -> ProviderInstanceBinding[key=Key[type=java.util.logging.Logger, annotation=[none]], source=[unknown source], scope=Scopes.NO_SCOPE, provider=Provider<Logger>]
Key[type=java.lang.String, annotation=@com.google.inject.name.Named(value=mybatis.JDBC.driver)] -> InstanceBinding[key=Key[type=java.lang.String, annotation=@com.google.inject.name.Named(value=mybatis.JDBC.driver)], source=com.netdesign.dao.cisco.general.uccx.CiscoUCCXModule.configure(CiscoUCCXModule.java:46), instance=com.microsoft.sqlserver.jdbc.SQLServerDriver]
Key[type=java.lang.String, annotation=@com.google.inject.name.Named(value=mybatis.JDBC.username)] -> InstanceBinding[key=Key[type=java.lang.String, annotation=@com.google.inject.name.Named(value=mybatis.JDBC.username)], source=com.netdesign.dao.cisco.general.uccx.CiscoUCCXModule.configure(CiscoUCCXModule.java:46), instance=testwallboard]
Key[type=java.lang.String, annotation=@com.google.inject.name.Named(value=mybatis.JDBC.urlB)] -> InstanceBinding[key=Key[type=java.lang.String, annotation=@com.google.inject.name.Named(value=mybatis.JDBC.urlB)], source=com.netdesign.dao.cisco.general.uccx.CiscoUCCXModule.configure(CiscoUCCXModule.java:46), instance=]
Key[type=java.lang.String, annotation=@com.google.inject.name.Named(value=mybatis.environment.id)] -> InstanceBinding[key=Key[type=java.lang.String, annotation=@com.google.inject.name.Named(value=mybatis.environment.id)], source=com.netdesign.dao.cisco.general.uccx.CiscoUCCXModule.configure(CiscoUCCXModule.java:46), instance=production]
Key[type=java.lang.String, annotation=@com.google.inject.name.Named(value=mybatis.JDBC.urlA)] -> InstanceBinding[key=Key[type=java.lang.String, annotation=@com.google.inject.name.Named(value=mybatis.JDBC.urlA)], source=com.netdesign.dao.cisco.general.uccx.CiscoUCCXModule.configure(CiscoUCCXModule.java:46), instance=jdbc:sqlserver://192.168.43.160;instanceName=CRSSQL;databaseName=db_CRA;user=testwallboard;password=testwallboard;]
Key[type=java.lang.String, annotation=@com.google.inject.name.Named(value=mybatis.JDBC.password)] -> InstanceBinding[key=Key[type=java.lang.String, annotation=@com.google.inject.name.Named(value=mybatis.JDBC.password)], source=com.netdesign.dao.cisco.general.uccx.CiscoUCCXModule.configure(CiscoUCCXModule.java:46), instance=testwallboard]
Key[type=java.lang.String, annotation=@com.google.inject.name.Named(value=mybatis.JDBC.autoCommit)] -> InstanceBinding[key=Key[type=java.lang.String, annotation=@com.google.inject.name.Named(value=mybatis.JDBC.autoCommit)], source=com.netdesign.dao.cisco.general.uccx.CiscoUCCXModule.configure(CiscoUCCXModule.java:46), instance=true]
Key[type=org.apache.ibatis.session.SqlSessionManager, annotation=[none]] -> ProviderKeyBinding[key=Key[type=org.apache.ibatis.session.SqlSessionManager, annotation=[none]], source=org.mybatis.guice.AbstractMyBatisModule.configure(AbstractMyBatisModule.java:43), scope=eager singleton, provider=Key[type=org.mybatis.guice.session.SqlSessionManagerProvider, annotation=[none]]]
Key[type=javax.sql.DataSource, annotation=[none]] -> ProviderKeyBinding[key=Key[type=javax.sql.DataSource, annotation=[none]], source=org.mybatis.guice.MyBatisModule.configure(MyBatisModule.java:137), scope=Scopes.NO_SCOPE, provider=Key[type=com.netdesign.dao.cisco.v7.uccx.ioc.CiscoV7DataSourceProvider, annotation=[none]]]
Key[type=org.apache.ibatis.transaction.TransactionFactory, annotation=[none]] -> LinkedKeyBinding[key=Key[type=org.apache.ibatis.transaction.TransactionFactory, annotation=[none]], source=org.mybatis.guice.MyBatisModule.configure(MyBatisModule.java:138), scope=Scopes.SINGLETON, target=Key[type=org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory, annotation=[none]]]
Key[type=org.apache.ibatis.mapping.Environment, annotation=[none]] -> ProviderKeyBinding[key=Key[type=org.apache.ibatis.mapping.Environment, annotation=[none]], source=org.mybatis.guice.MyBatisModule.configure(MyBatisModule.java:139), scope=Scopes.NO_SCOPE, provider=Key[type=org.mybatis.guice.environment.EnvironmentProvider, annotation=[none]]]
Key[type=org.apache.ibatis.session.Configuration, annotation=[none]] -> ProviderKeyBinding[key=Key[type=org.apache.ibatis.session.Configuration, annotation=[none]], source=org.mybatis.guice.MyBatisModule.configure(MyBatisModule.java:140), scope=Scopes.NO_SCOPE, provider=Key[type=org.mybatis.guice.configuration.ConfigurationProvider, annotation=[none]]]
Key[type=org.apache.ibatis.reflection.factory.ObjectFactory, annotation=[none]] -> LinkedKeyBinding[key=Key[type=org.apache.ibatis.reflection.factory.ObjectFactory, annotation=[none]], source=org.mybatis.guice.MyBatisModule.configure(MyBatisModule.java:150), scope=Scopes.SINGLETON, target=Key[type=org.apache.ibatis.reflection.factory.DefaultObjectFactory, annotation=[none]]]
Key[type=org.apache.ibatis.session.SqlSessionFactory, annotation=[none]] -> ProviderKeyBinding[key=Key[type=org.apache.ibatis.session.SqlSessionFactory, annotation=[none]], source=org.mybatis.guice.MyBatisModule.configure(MyBatisModule.java:151), scope=Scopes.NO_SCOPE, provider=Key[type=org.mybatis.guice.session.SqlSessionFactoryProvider, annotation=[none]]]
Key[type=java.util.Set<java.util.Map.java.util.Map$Entry<java.lang.Class<?>, com.google.inject.Provider<org.apache.ibatis.type.TypeHandler>>>, annotation=[none]] -> ProviderInstanceBinding[key=Key[type=java.util.Set<java.util.Map.java.util.Map$Entry<java.lang.Class<?>, com.google.inject.Provider<org.apache.ibatis.type.TypeHandler>>>, annotation=[none]], source=org.mybatis.guice.MyBatisModule.configure(MyBatisModule.java:162), scope=Scopes.NO_SCOPE, provider=Multibinder<java.util.Map.java.util.Map$Entry<java.lang.Class<?>, com.google.inject.Provider<org.apache.ibatis.type.TypeHandler>>>]
Key[type=java.util.Map<java.lang.Class<?>, com.google.inject.Provider<org.apache.ibatis.type.TypeHandler>>, annotation=[none]] -> ProviderInstanceBinding[key=Key[type=java.util.Map<java.lang.Class<?>, com.google.inject.Provider<org.apache.ibatis.type.TypeHandler>>, annotation=[none]], source=org.mybatis.guice.MyBatisModule.configure(MyBatisModule.java:162), scope=Scopes.NO_SCOPE, provider=com.google.inject.multibindings.MapBinder$RealMapBinder$1@56f631]
Key[type=java.util.Map<java.lang.Class<?>, org.apache.ibatis.type.TypeHandler>, annotation=[none]] -> ProviderInstanceBinding[key=Key[type=java.util.Map<java.lang.Class<?>, org.apache.ibatis.type.TypeHandler>, annotation=[none]], source=org.mybatis.guice.MyBatisModule.configure(MyBatisModule.java:162), scope=Scopes.NO_SCOPE, provider=com.google.inject.multibindings.MapBinder$RealMapBinder$2@13d28e3]
Key[type=java.util.Map.java.util.Map$Entry<java.lang.Class<?>, com.google.inject.Provider<org.apache.ibatis.type.TypeHandler>>, annotation=@com.google.inject.multibindings.Element(setName=,uniqueId=2)] -> InstanceBinding[key=Key[type=java.util.Map.java.util.Map$Entry<java.lang.Class<?>, com.google.inject.Provider<org.apache.ibatis.type.TypeHandler>>, annotation=@com.google.inject.multibindings.Element(setName=,uniqueId=2)], source=org.mybatis.guice.MyBatisModule.configure(MyBatisModule.java:165), instance=MapEntry(class com.netdesign.domain.AgentStatus, Provider<org.apache.ibatis.type.TypeHandler>)]
Key[type=org.apache.ibatis.type.TypeHandler, annotation=@com.google.inject.multibindings.Element(setName=,uniqueId=1)] -> LinkedKeyBinding[key=Key[type=org.apache.ibatis.type.TypeHandler, annotation=@com.google.inject.multibindings.Element(setName=,uniqueId=1)], source=org.mybatis.guice.MyBatisModule.configure(MyBatisModule.java:165), scope=Scopes.SINGLETON, target=Key[type=com.netdesign.dao.cisco.general.AgentStatusTypeHandler, annotation=[none]]]
Key[type=java.util.Set<java.lang.Class<?>>, annotation=@org.mybatis.guice.configuration.Mappers] -> InstanceBinding[key=Key[type=java.util.Set<java.lang.Class<?>>, annotation=@org.mybatis.guice.configuration.Mappers], source=org.mybatis.guice.MyBatisModule.configure(MyBatisModule.java:179), instance=[interface com.netdesign.dao.cisco.v7.uccx.CiscoStatisticsMapper, interface com.netdesign.dao.cisco.v7.uccx.AgentMapper, interface com.netdesign.dao.cisco.v7.uccx.GeneralMapper]]
Key[type=com.netdesign.dao.cisco.v7.uccx.CiscoStatisticsMapper, annotation=[none]] -> ProviderInstanceBinding[key=Key[type=com.netdesign.dao.cisco.v7.uccx.CiscoStatisticsMapper, annotation=[none]], source=org.mybatis.guice.AbstractMyBatisModule.bindMapper(AbstractMyBatisModule.java:69), scope=Scopes.SINGLETON, provider=org.mybatis.guice.mappers.MapperProvider@1359c1b]
Key[type=com.netdesign.dao.cisco.v7.uccx.AgentMapper, annotation=[none]] -> ProviderInstanceBinding[key=Key[type=com.netdesign.dao.cisco.v7.uccx.AgentMapper, annotation=[none]], source=org.mybatis.guice.AbstractMyBatisModule.bindMapper(AbstractMyBatisModule.java:69), scope=Scopes.SINGLETON, provider=org.mybatis.guice.mappers.MapperProvider@9be79a]
Key[type=com.netdesign.dao.cisco.v7.uccx.GeneralMapper, annotation=[none]] -> ProviderInstanceBinding[key=Key[type=com.netdesign.dao.cisco.v7.uccx.GeneralMapper, annotation=[none]], source=org.mybatis.guice.AbstractMyBatisModule.bindMapper(AbstractMyBatisModule.java:69), scope=Scopes.SINGLETON, provider=org.mybatis.guice.mappers.MapperProvider@18235ed]
Key[type=com.netdesign.dao.cisco.general.GeneralMapper, annotation=[none]] -> LinkedKeyBinding[key=Key[type=com.netdesign.dao.cisco.general.GeneralMapper, annotation=[none]], source=com.netdesign.dao.cisco.general.uccx.CiscoUCCXModule.configure(CiscoUCCXModule.java:60), scope=Scopes.NO_SCOPE, target=Key[type=com.netdesign.dao.cisco.v7.uccx.GeneralMapper, annotation=[none]]]
Key[type=com.netdesign.dao.cisco.general.CiscoStatisticsMapper, annotation=[none]] -> LinkedKeyBinding[key=Key[type=com.netdesign.dao.cisco.general.CiscoStatisticsMapper, annotation=[none]], source=com.netdesign.dao.cisco.general.uccx.CiscoUCCXModule.configure(CiscoUCCXModule.java:61), scope=Scopes.NO_SCOPE, target=Key[type=com.netdesign.dao.cisco.v7.uccx.CiscoStatisticsMapper, annotation=[none]]]
Key[type=com.netdesign.dao.cisco.general.AgentMapper, annotation=[none]] -> LinkedKeyBinding[key=Key[type=com.netdesign.dao.cisco.general.AgentMapper, annotation=[none]], source=com.netdesign.dao.cisco.general.uccx.CiscoUCCXModule.configure(CiscoUCCXModule.java:62), scope=Scopes.NO_SCOPE, target=Key[type=com.netdesign.dao.cisco.v7.uccx.AgentMapper, annotation=[none]]]
Key[type=com.netdesign.domain.WallBoardDataProvider, annotation=[none]] -> LinkedKeyBinding[key=Key[type=com.netdesign.domain.WallBoardDataProvider, annotation=[none]], source=com.netdesign.dao.cisco.general.uccx.CiscoUCCXModule.configure(CiscoUCCXModule.java:63), scope=Scopes.NO_SCOPE, target=Key[type=com.netdesign.dao.cisco.v7.uccx.CiscoUCCX7WallBoardDataProvider, annotation=[none]]]


source for the code:

@Before
public void setupInjectionAndReturnProvider() {
mockery = new Mockery();

String msSql = "x.x.x.x;instanceName=CRSSQL;databaseName=db_CRA";
Injector injector = Guice.createInjector(new MockModule(mockery,
new CiscoUCCX7WallBoardDataProvider(), msSql, "x",
"x"));
CiscoV7Module ciscoV7Module = new CiscoV7Module();
ciscoV7Module.setCoreDaoService(injector
.getInstance(CoreDaoService.class));
System.err.println(" -> NEW TEST ");
for (Entry<Key<?>, Binding<?>> binding : injector.getBindings()
.entrySet()) {
System.err.println(binding.getKey() + " -> " + binding.getValue());
}
injector = injector.createChildInjector(ciscoV7Module);
for (Entry<Key<?>, Binding<?>> binding : injector.getBindings()
.entrySet()) {
System.err.println(binding.getKey() + " -> " + binding.getValue());
}
wallBoardDataProvider = injector
.getInstance(WallBoardDataProvider.class);

}



2010/11/26 Simone Tripodi <[hidden email]>
Hi Nino,
unfortunately not, without the full code it's really hard to reproduce
the problem.
BTW, is it a project you're developing for your company? If you could
provide me an access I can help you. Send me a DM if this option would
be available.
Have a nice evening,
On Fri, Nov 26, 2010 at 6:24 PM, nino martinez wael
<[hidden email]> wrote:
> Hi Simone
> I know it's very hard looking at the code without the full code. I'll paste
> your snip in on monday.. This has also being driving me crazy, since it
> works sometimes and sometimes not, and using the informix driver it always
> works (now there may be some subtle difference between the ms sql and
> informix one).
> You havent been able to replicate anything so far right?
> regards Nino
>
> 2010/11/26 Simone Tripodi <[hidden email]>
>>
>> Hi Nino,
>> without having the access to the code it's quite hard to understand
>> why the injections fails :/ Can you run please the following piece of
>> code:
>>
>>            for (Entry<Key<?>, Binding<?>> binding :
>> injector.getBindings().entrySet()) {
>>                System.err.println(binding.getKey() + " -> " +
>> binding.getValue());
>>            }
>>
>> please paste this snip BEFORE invoking
>> injector.injectMembers()/getInstance().
>> Then maybe the binding list will suggest us what is missing, that
>> problem is driving me crazy because everything looks fine!!!
>> Thanks in advance,
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>>
>>
>> On Thu, Nov 25, 2010 at 3:43 PM, Simone Tripodi
>> <[hidden email]> wrote:
>> > Hi Nino,
>> > unfortunately not, didn't have the time yesterday since I left the
>> > office very late :(
>> > I'll give a try this evening, hopefully
>> > Simo
>> >
>> > http://people.apache.org/~simonetripodi/
>> > http://www.99soft.org/
>> >
>> >
>> >
>> > On Thu, Nov 25, 2010 at 3:22 PM, nino martinez wael
>> > <[hidden email]> wrote:
>> >> Simone any news?
>> >>
>> >> 2010/11/24 nino martinez wael <[hidden email]>
>> >>>
>> >>> ok thanks for helping :)
>> >>>
>> >>> 2010/11/24 Simone Tripodi <[hidden email]>
>> >>>>
>> >>>> Hi Nino,
>> >>>> thanks for the explanation, now I better understood. I need to
>> >>>> investigate more on the problem, this evening I'll give some tries.
>> >>>> Simo
>> >>>>
>> >>>> http://people.apache.org/~simonetripodi/
>> >>>> http://www.99soft.org/
>> >>>>
>> >>>>
>> >>>>
>> >>>> On Wed, Nov 24, 2010 at 8:26 AM, nino martinez wael
>> >>>> <[hidden email]> wrote:
>> >>>> > Hi Simone
>> >>>> > Actually GeneralMapper.class and getGeneralMapper() is not the
>> >>>> > same,
>> >>>> > GeneralMapper is a super interface and getGeneralMapper() inherits
>> >>>> > from
>> >>>> > it.
>> >>>> > Reason why im doing it this way are that I am using 2 different
>> >>>> > databases, a
>> >>>> > MSSQL or Informix and the only things that differs are a few sql
>> >>>> > fragments,
>> >>>> > so I can reuse a lot more by using this approach, and if I do not
>> >>>> > bind
>> >>>> > directly to the super interface I won't get anything injected
>> >>>> > (since
>> >>>> > guice
>> >>>> > does not consider the child as injectable). When I discovered the
>> >>>> > error
>> >>>> > I
>> >>>> > was not using this approach, so I think we can rule it out.
>> >>>> > I'll change the way that I add mapper classes.
>> >>>> > So whats the next step? As I mentioned I have two tests, one hits
>> >>>> > mssql
>> >>>> > and
>> >>>> > the other informix the informix one works and the mssql are
>> >>>> > unstable.
>> >>>> > Both
>> >>>> > "drivers" works in production.
>> >>>> >
>> >>>> > 2010/11/23 Simone Tripodi <[hidden email]>
>> >>>> >>
>> >>>> >> Hi Nino,
>> >>>> >> can you start please eliminating
>> >>>> >>
>> >>>> >>                bind(GeneralMapper.class).to(getGeneralMapper());
>> >>>> >>
>> >>>> >> bind(CiscoStatisticsMapper.class).to(getCiscoStatisticsMapper());
>> >>>> >>                bind(AgentMapper.class).to(getAgentMapper());
>> >>>> >>
>> >>>> >> because the Guice module will take care of installing the mappers?
>> >>>> >> In
>> >>>> >> this way you're declaring the mappers twice...
>> >>>> >> Moreover you can optimize a little your code by replacing
>> >>>> >>
>> >>>> >>
>> >>>> >>  builder.addMapperClasses(getCiscoStatisticsMapper());
>> >>>> >>                builder.addMapperClasses(getAgentMapper());
>> >>>> >>                builder.addMapperClasses(getGeneralMapper());
>> >>>> >>
>> >>>> >> with
>> >>>> >>
>> >>>> >>
>> >>>> >>  builder.addMapperClasses(getCiscoStatisticsMapper(),
>> >>>> >> getAgentMapper(), getGeneralMapper());
>> >>>> >>
>> >>>> >> Let me know!
>> >>>> >> Simo
>> >>>> >>
>> >>>> >> http://people.apache.org/~simonetripodi/
>> >>>> >> http://www.99soft.org/
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> On Tue, Nov 23, 2010 at 2:40 PM, Simone Tripodi
>> >>>> >> <[hidden email]> wrote:
>> >>>> >> > Hi Nino,
>> >>>> >> > thanks, I'll let you know ASAP, stay tuned!
>> >>>> >> > Simo
>> >>>> >> >
>> >>>> >> > http://people.apache.org/~simonetripodi/
>> >>>> >> > http://www.99soft.org/
>> >>>> >> >
>> >>>> >> >
>> >>>> >> >
>> >>>> >> > On Tue, Nov 23, 2010 at 9:09 AM, nino martinez wael
>> >>>> >> > <[hidden email]> wrote:
>> >>>> >> >> sure for the failing test I am using CiscoV7Module, this has
>> >>>> >> >> been a
>> >>>> >> >> hard nut
>> >>>> >> >> to crack and any help are very appreciated, if you need more
>> >>>> >> >> info
>> >>>> >> >> please
>> >>>> >> >> ask:
>> >>>> >> >> http://pastebin.com/FL8pYFcp
>> >>>> >> >> I could'nt send the pasties directly to the group (was marked
>> >>>> >> >> as
>> >>>> >> >> spam
>> >>>> >> >> by
>> >>>> >> >> spam assassin)
>> >>>> >> >> -Nino
>> >>>> >> >>
>> >>>> >> >>
>> >>>> >> >>>
>> >>>> >> >>> 2010/11/22 Simone Tripodi <[hidden email]>
>> >>>> >> >>>>
>> >>>> >> >>>> Hi Nino!!
>> >>>> >> >>>> can you post please your configuration? It would be easier to
>> >>>> >> >>>> understand where the problem could be.
>> >>>> >> >>>> Thanks in advance!
>> >>>> >> >>>> Simo
>> >>>> >> >>>>
>> >>>> >> >>>> http://people.apache.org/~simonetripodi/
>> >>>> >> >>>> http://www.99soft.org/
>> >>>> >> >>>>
>> >>>> >> >>>>
>> >>>> >> >>>>
>> >>>> >> >>>> On Mon, Nov 22, 2010 at 10:55 AM, nino martinez wael
>> >>>> >> >>>> <[hidden email]> wrote:
>> >>>> >> >>>> > Hi Guys
>> >>>> >> >>>> > Im have some really strange problems
>> >>>> >> >>>> > with inconstant failings
>> >>>> >> >>>> > of
>> >>>> >> >>>> > test.
>> >>>> >> >>>> > I
>> >>>> >> >>>> > have a test that usually fails and some times passes, when
>> >>>> >> >>>> > it
>> >>>> >> >>>> > fails
>> >>>> >> >>>> > it
>> >>>> >> >>>> > gives
>> >>>> >> >>>> > this error:
>> >>>> >> >>>> > com.google.inject.CreationException: Guice creation errors:
>> >>>> >> >>>> > 1) Error in custom provider, java.lang.NullPointerException
>> >>>> >> >>>> >   while locating
>> >>>> >> >>>> > org.mybatis.guice.environment.EnvironmentProvider
>> >>>> >> >>>> >   while locating org.apache.ibatis.mapping.Environment
>> >>>> >> >>>> >     for parameter 0 at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.mybatis.guice.configuration.ConfigurationProvider.<init>(ConfigurationProvider.java:62)
>> >>>> >> >>>> >   while locating
>> >>>> >> >>>> > org.mybatis.guice.configuration.ConfigurationProvider
>> >>>> >> >>>> >   while locating org.apache.ibatis.session.Configuration
>> >>>> >> >>>> >     for parameter 0 at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.mybatis.guice.SqlSessionFactoryProvider.<init>(SqlSessionFactoryProvider.java:45)
>> >>>> >> >>>> >   while locating
>> >>>> >> >>>> > org.mybatis.guice.SqlSessionFactoryProvider
>> >>>> >> >>>> >   while locating
>> >>>> >> >>>> > org.apache.ibatis.session.SqlSessionFactory
>> >>>> >> >>>> >     for parameter 0 at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.mybatis.guice.SqlSessionManagerProvider.<init>(SqlSessionManagerProvider.java:35)
>> >>>> >> >>>> >   while locating
>> >>>> >> >>>> > org.mybatis.guice.SqlSessionManagerProvider
>> >>>> >> >>>> >   while locating
>> >>>> >> >>>> > org.apache.ibatis.session.SqlSessionManager
>> >>>> >> >>>> >     for field at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.mybatis.guice.MapperProvider.sqlSessionManager(MapperProvider.java:42)
>> >>>> >> >>>> >   at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.mybatis.guice.MyBatisModule.bindMapperProvider(MyBatisModule.java:272)
>> >>>> >> >>>> > 1 error
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:144)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorImpl.createChildInjector(InjectorImpl.java:151)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.netdesign.connectionTest.setupInjectionAndReturnProvider(connectionTest.java:70)
>> >>>> >> >>>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> >>>> >> >>>> > Method)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> >>>> >> >>>> > at java.lang.reflect.Method.invoke(Method.java:597)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>> >>>> >> >>>> > at
>> >>>> >> >>>> > org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>> >>>> >> >>>> > at
>> >>>> >> >>>> > org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>> >>>> >> >>>> > Caused by: java.lang.NullPointerException
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstantFactory.get(ConstantFactory.java:39)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
>> >>>> >> >>>> > at com.google.inject.Scopes$1$1.get(Scopes.java:54)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.BoundProviderFactory.get(BoundProviderFactory.java:56)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.Initializer$InjectableReference.get(Initializer.java:145)
>> >>>> >> >>>> > at
>> >>>> >> >>>> > com.google.inject.Initializer.injectAll(Initializer.java:92)
>> >>>> >> >>>> > at
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> >
>> >>>> >> >>>> > com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171)
>> >>>> >> >>>> > ... 26 more
>> >>>> >> >>>> >
>> >>>> >> >>>> > I only have a vague clue on what could be wrong, but what
>> >>>> >> >>>> > really
>> >>>> >> >>>> > annoys
>> >>>> >> >>>> > me
>> >>>> >> >>>> > are the inconstant failings. So it seems to be a timing
>> >>>> >> >>>> > issue?
>> >>>> >> >>>> > So any hints highly appreciated
>> >>>> >> >>>> > -Nino
>> >>>> >> >>>
>> >>>> >> >>
>> >>>> >> >>
>> >>>> >> >
>> >>>> >
>> >>>> >
>> >>>
>> >>
>> >>
>> >
>
>