org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaEntityRepository': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Unsupported id class! Only class java.math.BigInteger,class org.bson.types.ObjectId,class java.lang.String are supported!

Spring JIRA | Mark Dopheide | 5 years ago
  1. 0

    // Spring Roo 1.2.0.BUILD-SNAPSHOT log opened at 2011-11-05 23:08:41 project --topLevelPackage com.test3 --projectName test3 --java 6 persistence setup --provider HIBERNATE --database POSTGRES --userName admin --password password mongo setup entity jpa --class ~.domain.JpaEntity --activeRecord false entity mongo --class ~.domain.MongoEntity field string --fieldName name repository mongo --interface ~.repository.MongoEntityRepository --entity ~.domain.MongoEntity repository jpa --interface ~.repository.JpaEntityRepository --entity ~.domain.JpaEntity web mvc setup web mvc all --package ~.web {code} SEVERE: The web application [/test2] created a ThreadLocal with key of type [null] (value [com.mongodb.DBTCPConnector$1@77ad4513]) and a value of type [com.mongodb.DBTCPConnector.MyPort] (value [com.mongodb.DBTCPConnector$MyPort@10921fc7]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak. 2011-11-06 00:54:38,974 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaEntityRepository': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Unsupported id class! Only class java.math.BigInteger,class org.bson.types.ObjectId,class java.lang.String are supported! at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1429) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135) Caused by: java.lang.IllegalArgumentException: Unsupported id class! Only class java.math.BigInteger,class org.bson.types.ObjectId,class java.lang.String are supported! at org.springframework.data.mongodb.repository.support.MongoRepositoryFactory.validate(MongoRepositoryFactory.java:143) at org.springframework.data.repository.core.support.RepositoryFactorySupport.validate(RepositoryFactorySupport.java:221) at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:129) at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:114) at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:38) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142) ... 26 more {code}

    Spring JIRA | 5 years ago | Mark Dopheide
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaEntityRepository': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Unsupported id class! Only class java.math.BigInteger,class org.bson.types.ObjectId,class java.lang.String are supported!
  2. 0

    // Spring Roo 1.2.0.BUILD-SNAPSHOT log opened at 2011-11-05 23:08:41 project --topLevelPackage com.test3 --projectName test3 --java 6 persistence setup --provider HIBERNATE --database POSTGRES --userName admin --password password mongo setup entity jpa --class ~.domain.JpaEntity --activeRecord false entity mongo --class ~.domain.MongoEntity field string --fieldName name repository mongo --interface ~.repository.MongoEntityRepository --entity ~.domain.MongoEntity repository jpa --interface ~.repository.JpaEntityRepository --entity ~.domain.JpaEntity web mvc setup web mvc all --package ~.web {code} SEVERE: The web application [/test2] created a ThreadLocal with key of type [null] (value [com.mongodb.DBTCPConnector$1@77ad4513]) and a value of type [com.mongodb.DBTCPConnector.MyPort] (value [com.mongodb.DBTCPConnector$MyPort@10921fc7]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak. 2011-11-06 00:54:38,974 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaEntityRepository': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Unsupported id class! Only class java.math.BigInteger,class org.bson.types.ObjectId,class java.lang.String are supported! at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1429) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135) Caused by: java.lang.IllegalArgumentException: Unsupported id class! Only class java.math.BigInteger,class org.bson.types.ObjectId,class java.lang.String are supported! at org.springframework.data.mongodb.repository.support.MongoRepositoryFactory.validate(MongoRepositoryFactory.java:143) at org.springframework.data.repository.core.support.RepositoryFactorySupport.validate(RepositoryFactorySupport.java:221) at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:129) at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:114) at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:38) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142) ... 26 more {code}

    Spring JIRA | 5 years ago | Mark Dopheide
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaEntityRepository': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Unsupported id class! Only class java.math.BigInteger,class org.bson.types.ObjectId,class java.lang.String are supported!
  3. 0

    While doing some load test, I got this exception from mongodb. {noformat} 2012-11-16 16:09:41.031 [WARN] org.springframework.jms.listener.DefaultMessageListenerContainer - Execution of JMS message listener failed, and no ErrorHandler has been set. java.lang.IllegalArgumentException: can't serialize class java.math.BigInteger at org.bson.BasicBSONEncoder.putNumber(BasicBSONEncoder.java:373) at org.bson.BasicBSONEncoder._putObjectField(BasicBSONEncoder.java:218) at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:174) at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:120) at com.mongodb.DefaultDBEncoder.writeObject(DefaultDBEncoder.java:27) at com.mongodb.OutMessage.putObject(OutMessage.java:267) at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:240) at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:205) at com.mongodb.DBCollection.insert(DBCollection.java:57) at com.mongodb.DBCollection.insert(DBCollection.java:100) at com.dreamworks.pam.logging.dao.mongodb.LogEntryDAOImpl.createLogEntry(LogEntryDAOImpl.java:88) at com.dreamworks.pam.logging.services.impl.LogEntryServiceImpl.createLogEntry(LogEntryServiceImpl.java:85) at com.dreamworks.pam.logging.services.jms.LogEntryMessageListener.onMessage(LogEntryMessageListener.java:67) at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562) at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500) at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:326) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:264) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1071) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:965) at java.lang.Thread.run(Thread.java:619) {noformat} Our script generated the same data with different "_id", "id" and "created" and most of them were inserted into database fine. This exception only happened sporadically.

    JIRA | 4 years ago | Gina Chen
    java.lang.IllegalArgumentException: can't serialize class java.math.BigInteger
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    No suitable constructor found for class java.math.BigInteger

    GitHub | 1 year ago | ghost
    java.lang.IllegalArgumentException: No suitable constructor found for class java.math.BigInteger. Available constructors: [public java.math.BigInteger(byte[]), public java.math.BigInteger(int,byte[]), public java.math.BigInteger(java.lang.String,int), public java.math.BigInteger(java.lang.String), public java.math.BigInteger(int,java.util.Random), public java.math.BigInteger(int,int,java.util.Random)]
  6. 0

    GitHub comment 70#133955962

    GitHub | 1 year ago | google-code-exporter
    java.lang.IllegalArgumentException: No suitable constructor found for class java.math.BigInteger. Available constructors: [public java.math.BigInteger(byte[]), public java.math.BigInteger(int,byte[]), public java.math.BigInteger(java.lang.String,int), public java.math.BigInteger(java.lang.String), public java.math.BigInteger(int,java.util.Random), public java.math.BigInteger(int,int,java.util.Random)]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Unsupported id class! Only class java.math.BigInteger,class org.bson.types.ObjectId,class java.lang.String are supported!

      at org.springframework.data.mongodb.repository.support.MongoRepositoryFactory.validate()
    2. Spring Data MongoDB - Core
      MongoRepositoryFactory.validate
      1. org.springframework.data.mongodb.repository.support.MongoRepositoryFactory.validate(MongoRepositoryFactory.java:143)
      1 frame
    3. Spring Data Core
      RepositoryFactoryBeanSupport.getObject
      1. org.springframework.data.repository.core.support.RepositoryFactorySupport.validate(RepositoryFactorySupport.java:221)
      2. org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:129)
      3. org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:114)
      4. org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:38)
      4 frames
    4. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
      2. org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
      3. org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
      4. org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1429)
      5. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      6. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
      7. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
      7 frames
    5. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
      2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
      2 frames
    6. Spring
      ContextLoaderListener.contextInitialized
      1. org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
      2. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
      3. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
      3 frames
    7. Glassfish Core
      StandardContext.listenerStart
      1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
      1 frame