简体   繁体   English

java.util.MissingResourceException:找不到基本名称消息包,语言环境en_US Floreant POS

[英]java.util.MissingResourceException: Can't find bundle for base name messages, locale en_US Floreant POS

I have downloaded the FLoreant POS open source code, using mvn clean install it got build successfully. 我已经下载了FLoreant POS开源代码,并使用mvn clean install成功构建了该代码。 But when I am trying to run the application its not able to read the messages.properties file even though everything is in classpath below is the structure of project and classpath snapshot. 但是,当我尝试运行该应用程序时,即使下面的类路径中的所有内容都是项目和类路径快照的结构,也无法读取messages.properties文件。 not getting any clue why input Stream is coming as null in code 没有任何线索为什么输入流在代码中为空

private static class ResourceControl extends ResourceBundle.Control {
        @Override
        public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IllegalAccessException,
                InstantiationException, IOException {
            String bundlename = toBundleName(baseName, locale);
            String resName = toResourceName(bundlename, "properties"); //$NON-NLS-1$
            InputStream stream = loader.getResourceAsStream(resName);
            return new PropertyResourceBundle(new InputStreamReader(stream, "UTF-8")); //$NON-NLS-1$
        }

    }

在此处输入图片说明

在此处输入图片说明

maven build plugin code Maven构建插件代码

<scm>
    <connection>scm:svn:http://svn.code.sf.net/p/floreantpos/code/trunk</connection>
</scm>

<build>
    <sourceDirectory>src</sourceDirectory>
    <finalName>floreantpos</finalName>
    <resources>
        <resource>
            <directory>src</directory>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </resource>
        <resource>
            <directory>resources</directory>
        </resource>
        <resource>
            <directory>filters</directory>
            <filtering>true</filtering>
            <includes>
                <include>*.properties</include>
            </includes>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>buildnumber-maven-plugin</artifactId>
            <version>1.3</version>
            <executions>
                <execution>
                    <phase>validate</phase>
                    <goals>
                        <goal>create</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <doCheck>false</doCheck>
                <doUpdate>false</doUpdate>
                <providerImplementations>
                    <svn>javasvn</svn>
                </providerImplementations>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.google.code.maven-scm-provider-svnjava</groupId>
                    <artifactId>maven-scm-provider-svnjava</artifactId>
                    <version>2.1.1</version>
                </dependency>
                <dependency>
                    <groupId>org.tmatesoft.svnkit</groupId>
                    <artifactId>svnkit</artifactId>
                    <version>1.8.5</version>
                </dependency>
            </dependencies>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.3.1</version>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <classpathPrefix>lib/</classpathPrefix>
                        <mainClass>com.floreantpos.main.Main</mainClass>
                    </manifest>
                    <manifestEntries>
                        <Class-Path>config/ i18n/</Class-Path>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.4</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <descriptor>resources/META-INF/mvn-assembly.xml</descriptor>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <id>prepare</id>
                    <phase>validate</phase>
                    <configuration>
                        <target>
                            <echo message="prepare phase" />
                            <unzip src="database/derby-server/posdb.zip" dest="${project.build.directory}" />
                        </target>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
                <execution>
                    <phase>package</phase>
                    <configuration>
                        <target>
                            <zip destfile="${project.build.directory}/${project.build.finalName}-1.4-build${buildNumber}.zip" basedir="${project.build.directory}/${project.build.finalName}-bin/${project.build.finalName}"></zip>
                        </target>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. -->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        org.apache.maven.plugins
                                    </groupId>
                                    <artifactId>
                                        maven-antrun-plugin
                                    </artifactId>
                                    <versionRange>
                                        [1.6,)
                                    </versionRange>
                                    <goals>
                                        <goal>run</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

Just copy "i18n" directory from src to target/floreantpos-bin directory. 只需将src中的“ i18n”目录复制到target / floreantpos-bin目录。 Run your application from target/floreantpos-bin directory using 使用以下命令从target / floreantpos-bin目录运行您的应用程序

 java -jar floreantpos.jar 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.util.MissingResourceException:找不到基本名称消息的bundle,locale en_US - java.util.MissingResourceException: Can't find bundle for base name messages, locale en_US 原因:java.util.MissingResourceException:找不到基本名称为LocalStrings,语言环境为en_US的捆绑软件 - Caused by: java.util.MissingResourceException: Can't find bundle for base name LocalStrings, locale en_US java.util.MissingResourceException:找不到基本名称'property_file name'的捆绑包,语言环境en_US - java.util.MissingResourceException: Can't find bundle for base name 'property_file name', locale en_US Spring MQTT:java.util.MissingResourceException:找不到基本名称 org.eclipse.paho.client.mqttv3.internal.nls.logcat,区域设置 en_US 的包 - Spring MQTT: java.util.MissingResourceException: Can't find bundle for base name org.eclipse.paho.client.mqttv3.internal.nls.logcat, locale en_US java.util.MissingResourceException:找不到基本名称为com.sun.org.apache.xerces.internal.impl.msg.SAXMessages的包,语言环境为en_US - java.util.MissingResourceException: Can't find bundle for base name com.sun.org.apache.xerces.internal.impl.msg.SAXMessages, locale en_US IntelliJ:向类路径添加资源,但仍然给我“ java.util.MissingResourceException:找不到包…语言环境en_US” - IntelliJ: Adding resources to the class path, but still gives me “java.util.MissingResourceException: Can't find bundle… locale en_US” java.util.MissingResourceException:找不到基本名称为ResBundle的包,语言环境为en_GB - java.util.MissingResourceException: Can't find bundle for base name ResBundle, locale en_GB java.util.MissingResourceException:找不到基本名称配置,语言环境的捆绑包 - java.util.MissingResourceException: Can't find bundle for base name config, locale en java.util.MissingResourceException:找不到基本名称视图,语言环境的捆绑包 - java.util.MissingResourceException: Can't find bundle for base name views, locale en MissingResourceException:无法找到基本名称sun.util.logging.resources.logging,locale en_US的包 - MissingResourceException: Can't find bundle for base name sun.util.logging.resources.logging, locale en_US
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM