-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux io problem #221
Comments
Hey, @rayacode. Please include a link to the article you're referring to so we can look into this. |
there is no article, i tested on actual debian 12 local vps, by using apache2 as proxy server, and spring boot app(tomcat) of this project behind the apache2 server. there are some changes of mine to the project to fit to what i want, but not related to the issue. |
We're considering this article: https://www.baeldung.com/spring-security-restrict-authentication-by-geography This issue will remain open until we look into this. |
oh i see what you mean by article, i actually didn't read those completely, this repo is nice code template for the security of the web apps, i found it this way not by learning with articles... . |
the application as systemctl service in debian 12
give error at two files
LoginNotificationConfig.java
SecSecurityConfig.java
error as:
root@debian:/opt# journalctl -u NoBios.service -e Dec 25 12:16:28 debian java[12609]: Caused by: o.s.b.f.BeanCreationException: Error creating bean with name 'GeoIPCity' defined in class path resource [ir/artlake/NoBios/spring/LoginNotificationConfig.class]: > Dec 25 12:16:28 debian java[12609]: at o.s.b.f.s.ConstructorResolver.instantiate(ConstructorResolver.java:654) Dec 25 12:16:28 debian java[12609]: at o.s.b.f.s.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:488) Dec 25 12:16:28 debian java[12609]: at o.s.b.f.s.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1332) Dec 25 12:16:28 debian java[12609]: at o.s.b.f.s.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1162) Dec 25 12:16:28 debian java[12609]: at o.s.b.f.s.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) Dec 25 12:16:28 debian java[12609]: ... 10 frames truncated Dec 25 12:16:28 debian java[12609]: ... 98 common frames omitted Dec 25 12:16:28 debian java[12609]: Caused by: o.s.b.BeanInstantiationException: Failed to instantiate [com.maxmind.geoip2.DatabaseReader]: Factory method 'databaseReader' threw exception with message: class p> Dec 25 12:16:28 debian java[12609]: at o.s.b.f.s.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:171) Dec 25 12:16:28 debian java[12609]: at o.s.b.f.s.ConstructorResolver.instantiate(ConstructorResolver.java:650) Dec 25 12:16:28 debian java[12609]: ... 112 common frames omitted Dec 25 12:16:28 debian java[12609]: Caused by: j.i.FileNotFoundException: class path resource [maxmind/GeoLite2-City.mmdb] cannot be resolved to absolute file path because it does not reside in the file system> Dec 25 12:16:28 debian java[12609]: at o.s.u.ResourceUtils.getFile(ResourceUtils.java:217) Dec 25 12:16:28 debian java[12609]: at o.s.u.ResourceUtils.getFile(ResourceUtils.java:180) Dec 25 12:16:28 debian java[12609]: at i.a.N.s.LoginNotificationConfig.databaseReader(LoginNotificationConfig.java:23) Dec 25 12:16:28 debian java[12609]: at i.a.N.s.LoginNotificationConfig$$SpringCGLIB$$0.CGLIB$databaseReader$0(<generated>) Dec 25 12:16:28 debian java[12609]: at i.a.N.s.LoginNotificationConfig$$SpringCGLIB$$FastClass$$1.invoke(<generated>) Dec 25 12:16:28 debian java[12609]: ... 8 frames truncated Dec 25 12:16:28 debian java[12609]: ... 113 common frames omitted Dec 25 12:16:28 debian systemd[1]: NoBios.service: Main process exited, code=exited, status=1/FAILURE Dec 25 12:16:28 debian systemd[1]: NoBios.service: Failed with result 'exit-code'. Dec 25 12:16:28 debian systemd[1]: NoBios.service: Consumed 18.129s CPU time.
Error resolved by changing the code of GeoCity and GeoCountry to:
` @bean(name="GeoIPCity")
public DatabaseReader databaseReader() throws IOException{
Resource resource = new ClassPathResource("maxmind/GeoLite2-City.mmdb");
InputStream databaseStream = resource.getInputStream();
return new DatabaseReader.Builder(databaseStream).build();
@Bean(name = "GeoIPCountry") public DatabaseReader databaseReader() throws IOException, GeoIp2Exception { Resource resource = new ClassPathResource("maxmind/GeoLite2-City.mmdb"); InputStream databaseStream = resource.getInputStream(); return new DatabaseReader.Builder(databaseStream).build(); }
The text was updated successfully, but these errors were encountered: