NoSuchConstructorException
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 630
- Forks
- 132
- PR merge metrics
- No merged PRs in 30d
Description
net.greghaines.jesque.utils.NoSuchConstructorException: class=com.xxx.xxx.xxxx.TestAction args=[6]
at net.greghaines.jesque.utils.ReflectionUtils.findConstructor(ReflectionUtils.java:205) ~[jesque-2.1.3.jar:na]
at net.greghaines.jesque.utils.ReflectionUtils.createObject(ReflectionUtils.java:147) ~[jesque-2.1.3.jar:na]
at net.greghaines.jesque.utils.JesqueUtils.materializeJob(JesqueUtils.java:415) ~[jesque-2.1.3.jar:na]
at net.greghaines.jesque.worker.MapBasedJobFactory.materializeJob(MapBasedJobFactory.java:49) ~[jesque-2.1.3.jar:na]
at net.greghaines.jesque.worker.WorkerImpl.process(WorkerImpl.java:605) [jesque-2.1.3.jar:na]
at net.greghaines.jesque.worker.WorkerImpl.poll(WorkerImpl.java:449) [jesque-2.1.3.jar:na]
at net.greghaines.jesque.worker.WorkerImpl.run(WorkerImpl.java:220) [jesque-2.1.3.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_221]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_221]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_221]
There is a public TestAction(long id); constructor there actually, so I track code into net.greghaines.jesque.utils.ReflectionUtils.findConstructor, and found this:
if (typeDiffWeight < minTypeDiffWeight) { // right here, should be `<=` ?
// Choose this constructor if it represents the closest match.
constructorToUse = candidate;
minTypeDiffWeight = typeDiffWeight;
ambiguousConstructors = null;
} else if (constructorToUse != null && typeDiffWeight == minTypeDiffWeight) {
if (ambiguousConstructors == null) {
ambiguousConstructors = new LinkedHashSet<Constructor<?>>();
ambiguousConstructors.add(constructorToUse);
}
ambiguousConstructors.add(candidate);
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with net.greghaines.jesque.utils.ReflectionUtils.findConstructor at the reported line, then follow the stack trace through createObject and materializeJob. Reproduce the lookup using TestAction(long) with args=[6] and verify how equal type-difference weights are handled; done when the valid constructor is selected without NoSuchConstructorException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100