0

プロパティ ファイルを読み込もうとしていますが、次のエラーが発生し続けます。

スレッド「メイン」での例外 java.util.MissingResourceException: 基本名 D:\bdtej04694\Mis documentos\NetBeansProjects\SMS_Clientes_Menores\dist\lib\help.properties のバンドルが見つかりません。java.util.ResourceBundle.throwMissingResourceException のロケール es_VE (ResourceBundle.java:1499) で java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322) で java.util.ResourceBundle.getBundle(ResourceBundle.java:721) で

これを作ろうとしている

    private static PropertyResourceBundle slInfo = null;
    //and in another method i'm doing this
    String directory = System.getProperty("user.dir");
            slInfo = (PropertyResourceBundle)ResourceBundle.getBundle(directory+"\\dist\\lib\\help.properties"); 
//I put it on a different folder, just in case i want to make changes in the connection strings inside the properties files, without build the project again in netbeans

私はウェブ上で(そして明らかに、このページで)検索しましたが、私の問題に合った答えが見つかりません

前もって感謝します

4

1 に答える 1

0

プロパティファイルのパスに問題があるようです

D:\bdtej04694\Mis documentos\NetBeansProjects\SMS_Clientes_Menores\dist\lib\help.properties

プロパティファイルのパスにスペースを入れないようにしてください。ここにスペースがあります

あなたについてのコメント:

以下のようにパスを変更します

String tempPath =  directory+"\\dist\\lib\\help.properties";
String finalPath = tempPath.replace("\\", "/");

このfinalPathを使用します

于 2015-02-12T18:34:22.373 に答える