27
Дек
2017

java.util.MissingResourceException: Can’t find bundle for base name property/database/database.properties, locale ru_RU

public class DBManager {
    private final static DBManager INSTANCE = new DBManager();
    private ResourceBundle bundle = null;

    private DBManager() {
    }

    public void initialize() throws IOException {
        bundle = ResourceBundle.getBundle("property/database/database.properties");
    }

    public static DBManager getInstance() {
        return INSTANCE;
    }

    public String getValue(String key) {
        return bundle.getString(key);
    }
}


java.util.MissingResourceException: Can't find bundle for base name property/database/database.properties, locale ru_RU

    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:773)
    at by.runets.buber.infrastructure.connection.DBManager.initialize(DBManager.java:14)
    at by.runets.buber.infrastructure.connection.ConnectionPool.initialize(ConnectionPool.java:31)
    at by.runets.buber.infrastructure.connection.ConnectionPool.<init>(ConnectionPool.java:24)
    at by.runets.buber.infrastructure.connection.ConnectionPool.getInstance(ConnectionPool.java:65)
    at by.runets.buber.dao.TestConnectionPool.testConnectionPool(TestConnectionPool.java:13)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
    at org.testng.TestRunner.privateRun(TestRunner.java:756)
    at org.testng.TestRunner.run(TestRunner.java:610)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
    at org.testng.SuiteRunner.run(SuiteRunner.java:289)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1218)
    at org.testng.TestNG.runSuites(TestNG.java:1133)
    at org.testng.TestNG.run(TestNG.java:1104)
    at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)

Пытаюсь получить доступ к файлу конфиграции БД. введите сюда описание изображения

Также в программе юзаются другие файлы с локализацией, мб это как-то влияет.

Источник: https://ru.stackoverflow.com/questions/764212/java-util-missingresourceexception-cant-find-bundle-for-base-name-property-dat

Тебе может это понравится...

Добавить комментарий