Facing issue for NoClassDefFoundError
- Dominant language
- CoffeeScript
- Stars
- 16.1k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Hi Team,
we have added maven dependency & version is 1.2.6. & we are just using following code snippet when we try to measure strength of password we are getting error. we are using java 1.6. so is it issue?
Code snippet:
Zxcvbn zxcvbn = new Zxcvbn();
Strength localizStrength = zxcvbn.measure(password);
int zxcvbnScore = localizStrength.getScore();
logger.info("Score Of Password:"+ zxcvbnScore);
switch ( zxcvbnScore )
{
case 4:
logger.info("Password Strength is Very Strong");
break;
case 3:
logger.info("Password Strength is Strong");
break;
case 2:
logger.info("Password Strength is Good");
break;
case 1:
logger.error("Password Strength is Weak");
Feedback feedback = localizStrength.getFeedback();
List localizedSuggestions = feedback.getSuggestions();
String localizedWarning = feedback.getWarning();
System.out.println("localizedSuggestions:="+ localizedSuggestions);
System.out.println("LocalizedWarnings:="+localizedWarning);
result.add(rule);
break;
default:
logger.error("Password Strength is very Weak");
Feedback feedback1 = localizStrength.getFeedback();
List localizedSuggestions1 = feedback1.getSuggestions();
String localizedWarning1 = feedback1.getWarning();
System.out.println("localizedSuggestions:="+ localizedSuggestions1);
System.out.println("LocalizedWarnings:="+localizedWarning1);
result.add(rule);
break;
Error Trace:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.nulabinc.zxcvbn.Matching
at com.nulabinc.zxcvbn.Zxcvbn.createMatching(Zxcvbn.java:45)
at com.nulabinc.zxcvbn.Zxcvbn.measure(Zxcvbn.java:32)
at com.nulabinc.zxcvbn.Zxcvbn.measure(Zxcvbn.java:15)
at com.riskmetrics.wb.service.impl.PasswordServiceImpl.validate(PasswordServiceImpl.java:123)
at com.riskmetrics.apollo.spring.controller.PasswordController.validatePassword(PasswordController.java:412)
at com.riskmetrics.apollo.spring.controller.PasswordController.validate(PasswordController.java:71)
at sun.reflect.GeneratedMethodAccessor652.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
... 79 more
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the failure with Java 1.6 and dependency version 1.2.6, then inspect com.nulabinc.zxcvbn.Zxcvbn at Zxcvbn.java:45 and the Matching class initialization shown in the trace. Done means identifying whether the failure is caused by the Java runtime or dependency setup and recording a verified compatibility fix or limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- coffeescript, java
- Domain
- security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100