Baeldung/spring-security-registration

wont run after packaging war

BinduBirol opened this issue · 0 comments

The project runs fine on STS. but the jar wont run.

web - 2022-05-03 17:26:12,572 [main] ERROR o.s.b.w.e.t.TomcatStarter - Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'secSecurityConfig': Unsatisfied dependency expressed through field 'myAuthenticationSuccessHandler'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myAuthenticationSuccessHandler': Unsatisfied dependency expressed through field 'deviceService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'deviceService' defined in URL [jar:file:/C:/Users/JGTDSL-BB/git/spring-security-registration/target/spring-security-login-and-registration.war!/WEB-INF/classes!/com/baeldung/service/DeviceService.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'GeoIPCity' defined in class path resource [com/baeldung/spring/LoginNotificationConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.maxmind.geoip2.DatabaseReader]: Factory method 'databaseReader' threw exception; nested exception is java.io.FileNotFoundException: class path resource [maxmind/GeoLite2-City.mmdb] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/C:/Users/JGTDSL-BB/git/spring-security-registration/target/spring-security-login-and-registration.war!/WEB-INF/classes!/maxmind/GeoLite2-City.mmdb

Also tried using the codes to a new project using mysql. Same Unsatisfied dependency error occurs. Is there any way to build the war properly?