org.springframework.data.mapping.model.MappingInstantiationException: Could not instantiate bean class [com.mycompany.catalog.Transaction]: Illegal arguments for constructor; nested exception is java.lang.IllegalArgumentException: argument type mismatch

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Spring JIRA by Ludovic Praud, 1 year ago
Could not instantiate bean class [com.mycompany.catalog.Transaction]: Illegal arguments for constructor; nested exception is java.lang.IllegalArgumentException: argument type mismatch
via Spring JIRA by Ludovic Praud, 1 year ago
Could not instantiate bean class [com.mycompany.catalog.Transaction]: Illegal arguments for constructor; nested exception is java.lang.IllegalArgumentException: argument type mismatch
via GitHub by idea2-pepito
, 1 year ago
Failed to instantiate com.idea2.db.entities.views.View using constructor public com.idea2.db.entities.views.View() with arguments
via Spring JIRA by Michael Angstadt, 1 year ago
Failed to instantiate com.mongotest.Pet using constructor public com.mongotest.Pet(java.lang.String) with arguments John
via Spring JIRA by Michael Angstadt, 1 year ago
Failed to instantiate com.mongotest.Pet using constructor public com.mongotest.Pet(java.lang.String) with arguments John
via Stack Overflow by Ben Baumgold
, 2 years ago
Could not instantiate bean class [com.recorder.SpringSourceTest$ArrayContainer]: Illegal arguments for constructor; nested exception is java.lang.IllegalArgumentException: argument type mismatch
org.springframework.data.mapping.model.MappingInstantiationException: Could not instantiate bean class [com.mycompany.catalog.Transaction]: Illegal arguments for constructor; nested exception is java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
at org.springframework.data.convert.ReflectionEntityInstantiator.createInstance(ReflectionEntityInstantiator.java:75)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:230)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:210)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:174)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:170)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:73)
at org.springframework.data.mongodb.core.MongoTemplate$ReadDbObjectCallback.doWith(MongoTemplate.java:1718)
at org.springframework.data.mongodb.core.MongoTemplate.executeFindMultiInternal(MongoTemplate.java:1441)
at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1244)
at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1233)
at org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:471)
at com.mycompany.catalog.repositories.AbstractRepositoryCustomMongo.findByQueryPageable(AbstractRepositoryCustomMongo.java:35)
at com.mycompany.catalog.repositories.TransactionRepositoryCustomMongo.findByProduct(TransactionRepositoryCustomMongo.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:334)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at com.mycompany.catalog.repositories.TransactionRepositoryTest.testFindByProduct(TransactionRepositoryTest.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
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.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
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.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 2 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
21 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
24 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.