标签: bundle

MissingResourceException - 找不到基本名称的包

我知道在stackoverflow和其他论坛上有很多关于这个错误的问题和答案.但我还是找不到解决方案......

出于速度原因,我有一个实用程序类,它根据提供的语言环境加载所有静态数据映射(例如几个月).

所以这个实用程序类看起来像这样:

public static final String GLOBAL_MESSAGES = "globalMessages";

private static Map<Integer,Month> monthsMap;

private ResourceBundle getResourceBundle(Locale locale) {
    ResourceBundle rb = ResourceBundle.getBundle(GLOBAL_MESSAGES, locale);
    return rb;
}

private Map<Integer,Month> getMonths() {
    if(monthsMap == null) {
        setMonths();
    }
    return monthsMap;
}

private void setMonths() {
    try {
        monthsMap = getFactory().getDAO().getAllMonths();
    } catch (SQLException e) {
        logger.error(e);
    } catch (EmptyResultException e) {
        logger.error(e);
    }
}

public Map<Integer,Month> getMonths(Locale locale) {
    if(locale == null) {
        return monthsMap;
    } else {
        if(this.locale != locale) …
Run Code Online (Sandbox Code Playgroud)

java locale bundle struts2 properties

8
推荐指数
1
解决办法
4万
查看次数

启动OSGi包

我尝试在Eclipse中运行OSGi插件.它是空捆绑,但是eclipse总是发给我错误有我的控制台消息 http://pastebin.com/dqQfpQhd有 什么问题?

java osgi bundle equinox

8
推荐指数
2
解决办法
1万
查看次数

尝试在嵌入式依赖项的Maven中构建OSGi包.似乎无法从BND类路径中排除传递依赖项

基本上,我的Web服务必须可以作为单个OSGi jar包进行部署.因此:

  1. bundle必须包含所有编译和运行时maven依赖项.
  2. 它还必须包含依赖于这些依赖项的所有非可选依赖项(即传递依赖项).

I'm attempting to use the maven-bundle-plugin to accomplish this. I've used Embed-Dependency to get all my compile and runtime dependencies in the bundle, and I've used Embed-Transitive to embed all the transitive dependencies. I then figured out how to use excludeDependencies to exclude Maven dependencies from the BND classpath (they are moved to Private-Package in the Manifest), but for the life of me I can't figure out how to get it to exclude the transitive dependencies. …

osgi bundle maven transitive-dependency

8
推荐指数
1
解决办法
1万
查看次数

无法启动osgi bundle因为导入无法解决

我已经制作了一个小型API Bundle和一个应该使用API​​的服务包.

在我的maven pom.xml文件中,我在正确的版本中添加了对我的api包的依赖,如下所示:

<dependency>
  <groupId>at.foobar.osgi.api</groupId>
  <artifactId>foobarapi</artifactId>
  <version>1.0</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

我正在使用maven-bundle插件来创建捆绑包,因为我mvn clean install以前用jar文件创建.Manifest看起来像这样(服务):

Manifest-Version: 1.0
Private-Package: at.foobar.osgi.producer
Built-By: foobar
Tool: Bnd-0.0.238
Bundle-Name: foobarproducer
Created-By: Apache Maven Bundle Plugin
Bundle-Version: 1.0
Build-Jdk: 1.6.0_26
Bnd-LastModified: 1332185439257
Bundle-ManifestVersion: 2
Bundle-Activator: at.foobar.osgi.producer.Activator
Import-Package: at.foobar.osgi.api,org.osgi.framework;version="1.4"
Bundle-SymbolicName: at.foobar.osgi.producer.foobarproducer
Run Code Online (Sandbox Code Playgroud)

这对我来说似乎没问题.进口就在那里,所以一切都应该没问题.

现在我启动了equinox并安装了API和生产者包.然后我启动API,这很好.但是,当我想启动Producer服务时,我收到此错误:

org.osgi.framework.BundleException: The bundle "at.foobar.osgi.producer.foobarproducer_1.0.0 [4]" could not be resolved. Reason: Missing Constraint: Import-Package: at.foobar.osgi.api; version="0.0.0"
Run Code Online (Sandbox Code Playgroud)

看来框架找不到api,但是它的安装和启动?

java osgi bundle maven

8
推荐指数
1
解决办法
2万
查看次数

来自getExtras()的NullPointerException

我正在创建一个将数据从一个活动传输到另一个活动的意图,如下所示:

Intent intent = new Intent(this, ActivityHighScore.class);
    intent.putExtra("USERNAME", username);
    intent.putExtra("PLAYERMOVES", playerMoves);

    this.startActivity(intent);
Run Code Online (Sandbox Code Playgroud)

然后我想检查活动开始时是否存在所有这些数据,因为它可以从其他来源启动而不设置此数据.我正在使用这个声明:

        Bundle bundle = getIntent().getExtras();

    if (!bundle.getString("USERNAME").equals(null) && bundle.getInt("PLAYERMOVES") != 0){
        String username = bundle.getString("USERNAME");
        int playerMoves = bundle.getInt("PLAYERMOVES");
        addHighScore(username, playerMoves);

    }   
Run Code Online (Sandbox Code Playgroud)

但这导致了一个无效的pointerexception,我完全确定如何.我以为我正在处理Strings和.equals(),但我认为......任何帮助都会非常感激.谢谢.

android bundle nullpointerexception android-intent

8
推荐指数
1
解决办法
1万
查看次数

ClassCastException发生在onRestoreInstanceState中

ClassCastException随机发生以恢复onRestoreInstanceState()中的Vector.通常,恢复向量很好,但有时会发生异常.

我认为它发生在活动进入后台并被破坏但我不确定.

有任何想法吗?谢谢.

Stack<LocationInfo> mLocationInfoVector;

@Override
protected void onSaveInstanceState(Bundle outState) {
    outState.putSerializable("locationInfos", mLocationInfoVector);

    super.onSaveInstanceState(outState);
}

@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
    if (savedInstanceState.getSerializable("locationInfos") != null) {
        @SuppressWarnings("unchecked")
        mLocationInfoVector= (Stack<LocationInfo>) savedInstanceState.getSerializable("locationInfos");
    }

    super.onRestoreInstanceState(savedInstanceState);
}
Run Code Online (Sandbox Code Playgroud)

添加:

我忘了附上异常日志.那是

java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Stack
Run Code Online (Sandbox Code Playgroud)

android bundle serializable

8
推荐指数
2
解决办法
1275
查看次数

ASP.NET ScriptBundle不适用于.min.js?

我可以使用下面的ASP.NET MVC成功地包含带有ScriptBundle的jquery库

bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-1.7.1.js"));
Run Code Online (Sandbox Code Playgroud)

但是,如果我更改为最小化库,我无法从浏览器中获取它

bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-1.7.1.min.js"));
Run Code Online (Sandbox Code Playgroud)

代码有什么问题吗?

javascript asp.net-mvc bundle

8
推荐指数
2
解决办法
9607
查看次数

无法使用本机捆绑包exe启动JavaFX应用程序

我创建了一个JavaFX应用程序,并使用Ant创建了它的本机包.当我尝试使用双击创建的包中的Jar启动应用程序时,它成功启动了我的应用程序.但是,当我尝试双击MyApplication.exe(比如说)时,它会抛出JavaFX Launcher Error"运行Application时出现异常".

我比较了两个jre,有很多缺少jar,exe,dll和我发现的一些属性文件.

我有这些环境设置 -

JAVA_HOME -- C:\Program Files\Java\jdk1.7.0_10
JREFX_HOME -- C:\Program Files\Oracle\JavaFX 2.2 Runtime
Path contains an entry of C:\Program Files\Java\jdk1.7.0_10\bin
Run Code Online (Sandbox Code Playgroud)

在我的build.xml中使用JAVA_HOME和JREFX_HOME来获取ant-javafx.jar和jfxrt.jar -

${env.JAVA_HOME}/lib/ant-javafx.jar
${env.JREFX_HOME}/lib/jfxrt.jar
Run Code Online (Sandbox Code Playgroud)

我创建包的步骤是 -

<target name="CreatingExe" depends="SignedJar">
            <fx:deploy width="800" height="600" nativeBundles="all" outdir="${OutputPath}" outfile="${app.name}">
                <fx:info title="${app.title}"/>
                    <fx:application name="${app.title}" mainClass="${main.class}"/>
                    <fx:resources>
                        <fx:fileset dir="${OutputPath}" includes="*.jar"/>
                <fx:fileset dir="${WorkingFolder}/temp"/>
            </fx:resources>
         </fx:deploy>
 </target>
Run Code Online (Sandbox Code Playgroud)

build.xml中还需要什么才能使应用程序正确启动exe?

谢谢

java ant deployment bundle javafx-2

8
推荐指数
1
解决办法
7704
查看次数

更改应用程序名称后更改了Bundle标识符

有点卡在这里,

我更改了我的应用程序的名称,将在设备上的图标下显示的位,包标识符对吗?我想向我的应用程序提交更新,但现在我的包标识符不同,并且没有可选择验证/分发的代码签名标识配置文件.如果标识符不同,我该如何提交我的应用程序?

真的很困惑

任何帮助将非常感激

谢谢

xcode bundle identifier ios

8
推荐指数
1
解决办法
5406
查看次数

将网站部署到应用程序时的mvc捆绑和相对css映像

要将相对图像路径转换为绝对路径,有很多问题需要在stackoverflow中提出并回答,如下所示:

MVC4 StyleBundle无法解析图像

建议添加new CssRewriteUrlTransform()如下:

bundles.Add(new StyleBundle("~/Content/css/jquery-ui/bundle")
       .Include("~/Content/css/jquery-ui/*.css", new CssRewriteUrlTransform()));
Run Code Online (Sandbox Code Playgroud)

这实际上已经救过我了.但是现在我将我的网站部署到应用程序(不是网站的根目录),仍然存在一个问题:

申请是:

http://localhost/sample/
Run Code Online (Sandbox Code Playgroud)

但图片网址如下:

http://localhost/css/imgs/spirit.png
Run Code Online (Sandbox Code Playgroud)

虽然它应该是:

 http://localhost/sample/css/imgs/spirit.png
Run Code Online (Sandbox Code Playgroud)

虽然捆绑的CSS链接本身是正确和有效的.

css asp.net bundle asp.net-mvc-4 bundling-and-minification

8
推荐指数
1
解决办法
3118
查看次数