Maven BundleException:无法缓存bundle

时间:2013-10-11 09:19:21

标签: java eclipse maven dcm4che

我正在尝试启动基于maven的项目,在启动时我总是遇到以下异常:

Cannot install bundle: weasis-dicom-explorer-0.5.14 (org.osgi.framework.BundleException: Unable to cache bundle: file:/org/weasis/dicom/weasis-dicom-explorer/0.5.14/weasis-dicom-explorer-0.5.14.jar - java.io.FileNotFoundException: \org\weasis\dicom\weasis-dicom-explorer\0.5.14\weasis-dicom-explorer-0.5.14.jar (The system cannot find the path specified))
org.osgi.framework.BundleException: Unable to cache bundle: file:/org/weasis/dicom/weasis-dicom-explorer/0.5.14/weasis-dicom-explorer-0.5.14.jar
    at org.apache.felix.framework.Felix.installBundle(Felix.java:2858)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:165)
    at org.weasis.launcher.AutoProcessor.installBundle(AutoProcessor.java:551)
    at org.weasis.launcher.AutoProcessor.processAutoProperties(AutoProcessor.java:335)
    at org.weasis.launcher.AutoProcessor.process(AutoProcessor.java:102)
    at org.weasis.launcher.WebStartLoader.setFelix(WebStartLoader.java:203)
    at org.weasis.launcher.WeasisLauncher.launch(WeasisLauncher.java:343)
    at org.weasis.launcher.WeasisLauncher.main(WeasisLauncher.java:200)
Caused by: java.io.FileNotFoundException: \org\weasis\dicom\weasis-dicom-explorer\0.5.14\weasis-dicom-explorer-0.5.14.jar (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:120)
    at java.io.FileInputStream.<init>(FileInputStream.java:79)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
    at org.apache.felix.framework.util.SecureAction.getURLConnectionInputStream(SecureAction.java:524)
    at org.apache.felix.framework.cache.JarRevision.initialize(JarRevision.java:165)
    at org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:77)
    at org.apache.felix.framework.cache.BundleArchive.createRevisionFromLocation(BundleArchive.java:878)
    at org.apache.felix.framework.cache.BundleArchive.reviseInternal(BundleArchive.java:550)
    at org.apache.felix.framework.cache.BundleArchive.<init>(BundleArchive.java:153)
    at org.apache.felix.framework.cache.BundleCache.create(BundleCache.java:277)
    at org.apache.felix.framework.Felix.installBundle(Felix.java:2854)
    ... 7 more
Cannot install native bundle: jai-lib-windows-x86-1.1.4-b03
Cannot install bundle: slf4j-api-1.6.4 (org.osgi.framework.BundleException: Unable to cache bundle: file:/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4.jar - java.io.FileNotFoundException: \org\slf4j\slf4j-api\1.6.4\slf4j-api-1.6.4.jar (The system cannot find the path specified))
org.osgi.framework.BundleException: Unable to cache bundle: file:/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4.jar
    at org.apache.felix.framework.Felix.installBundle(Felix.java:2858)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:165)
    at org.weasis.launcher.AutoProcessor.installBundle(AutoProcessor.java:551)
    at org.weasis.launcher.AutoProcessor.processAutoProperties(AutoProcessor.java:335)
    at org.weasis.launcher.AutoProcessor.process(AutoProcessor.java:102)
    at org.weasis.launcher.WebStartLoader.setFelix(WebStartLoader.java:203)
    at org.weasis.launcher.WeasisLauncher.launch(WeasisLauncher.java:343)
    at org.weasis.launcher.WeasisLauncher.main(WeasisLauncher.java:200)

我的pom.xml示例模型:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <parent>
        <artifactId>weasis-parent</artifactId>
        <groupId>org.weasis</groupId>
        <version>1.14</version>
        <relativePath>../weasis-parent/pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.weasis.launcher</groupId>
    <artifactId>weasis-launcher</artifactId>
    <!-- The weasis launcher is not OSGI bundle, it is a simple jar -->
    <packaging>jar</packaging>
    <name>Weasis Launcher (Felix) [${project.artifactId}]</name>
    <version>0.5.14</version>
    <licenses>
        <license>
            <name>Eclipse Public License v1.0</name>
            <url>http://www.eclipse.org/legal/epl-v10.html</url>
            <distribution>repo</distribution>
        </license>
        <license>
            <!-- WeasisLauncher and AutoProcessor classes are derived from the Apache Felix launcher -->
            <name>Apache 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <profiles>
        <profile>
            <id>jarsign</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-jarsigner-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <!-- Dependencies below are provided for debugging Weasis from IDE (by launching WeasisLauncher) -->
    <dependencies>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.framework</artifactId>
            <version>4.2.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr</artifactId>
            <version>1.6.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.metatype</artifactId>
            <version>1.0.6</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.prefs</artifactId>
            <version>1.0.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.weasis.thirdparty.javax.jnlp</groupId>
            <artifactId>javaws</artifactId>
            <version>1.6.0-17</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.bundlerepository</artifactId>
            <version>1.6.6</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.configadmin</artifactId>
            <version>1.6.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.gogo.command</artifactId>
            <version>0.12.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.weasis.thirdparty.com.sun.media</groupId>
            <artifactId>jai-lib-linux-x86</artifactId>
            <version>1.1.4-b03</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.weasis.thirdparty.com.sun.media</groupId>
            <artifactId>jai-lib-linux-x86-64</artifactId>
            <version>1.1.4-b03</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.weasis.thirdparty.com.sun.media</groupId>
            <artifactId>jai-lib-windows-x86</artifactId>
            <version>1.1.4-b03</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.weasis.thirdparty.com.sun.media</groupId>
            <artifactId>vecmath</artifactId>
            <version>1.5.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.weasis.thirdparty</groupId>
            <artifactId>tilecachetool</artifactId>
            <version>1.0.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.weasis.thirdparty</groupId>
            <artifactId>substance</artifactId>
            <version>7.2.1</version>
        </dependency>
    </dependencies>
</project>

1 个答案:

答案 0 :(得分:0)

尝试在eclipse中的Run配置中将maven的本地存储库位置作为vm参数。例如:

-Dmaven.localRepository = “/家/ poonam / .m2目录/储存库”