小编pre*_*res的帖子

声纳问题:删除 String(byte[]) 的使用

我遇到了一个反复出现的声纳问题“删除构造函数“String(byte[])”的使用。示例之一是以下代码:

 byte[] d = c.doFinal(e);
 return new String(d);
Run Code Online (Sandbox Code Playgroud)

我不知道为什么会出现这种情况。欢迎任何帮助。谢谢。

arrays string byte sonarqube

7
推荐指数
1
解决办法
6850
查看次数

无法启动捆绑包-缺少要求(osgi.wiring.package)

我是Apache karaf和OSGI的新手。我试图编写并运行一个非常简单的捆绑软件。但是启动该捆绑包时出现此错误:

错误执行命令:错误执行捆绑软件命令:无法解决karaf [86](R 86.0):缺少要求[karaf [86](R 86.0)] osgi.wiring.package; (osgi.wiring.package = bundle)未解决的要求:[[karaf [86](R 86.0)] osgi.wiring.package; (osgi.wiring.package = bundle)]

我的pom是:4.0.0

<groupId>com</groupId>
<artifactId>karaf</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>

<name>karaf Bundle</name>
<description>
    karaf OSGi bundle project.
</description>

<properties>
    <maven-bundle-plugin.version>2.5.4</maven-bundle-plugin.version>
    <osgi.version>6.0.0</osgi.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.core</artifactId>
        <version>${osgi.version}</version>

        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>${maven-bundle-plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                    <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                    <Bundle-Version>${project.version}</Bundle-Version>
                    <Bundle-Activator>bundle.Activator</Bundle-Activator>
                    <Export-Package>
                        bundle*;version=${project.version}
                    </Export-Package>
                    <Import-Package>
                         org.osgi.framework,*
                    </Import-Package>
                </instructions>
            </configuration>
        </plugin>
    </plugins>
</build>
Run Code Online (Sandbox Code Playgroud)

我的manifest.mf文件在这里。

> Manifest-Version: 1.0
Bnd-LastModified: 1394131053386
Bundle-Copyright: Copyright (c) OSGi Alliance (2000, 2014). All Rights …
Run Code Online (Sandbox Code Playgroud)

osgi maven apache-felix apache-karaf osgi-bundle

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