2

私は IntelliJ プラグインに取り組んでおり、Apache httpcore-4.2.1.jar を使用しています。Jetbrains が Confluence ページで述べているように、プラグイン構造のドキュメントに従い、この構造を使用しています。

.IntelliJIDEAx0
plugins
    Sample
        lib
            libfoo.jar
            libbar.jar
        classes
            com/foo/.....
            ...
            ...
        META-INF
            plugin.xml 

私のディレクトリ構造はこれです

c:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.0.1
plugins
    myplugin
        lib
            commons-codec-1.6.jar
            commons-logging-1.1.1.jar
            httpclient-4.2.1-atlassian-2.jar
            httpcore-4.2.1.jar
            jackson-core-asl-1.9.12.jar
            jackson-mapper-asl-1.9.12.jar
            list.txt
            myplugin.jar
                META-INF
                    plugin.xml
                com/..... #classes here

次に、myplugin.jar を使用してハードドライブから IntelliJ/Settings/Plugins/Install 経由でこのプラグインをインストールしました。

再起動後、この例外が発生しました

org/apache/http/protocol/HttpContext [Plugin: maca.myplugin]: org/apache/http/protocol/HttpContext [Plugin: maca.myplugin]
com.intellij.diagnostic.PluginException: org/apache/http/protocol/HttpContext [Plugin: maca.myplugin]
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.a(ComponentManagerImpl.java:470)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.a(ComponentManagerImpl.java:435)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.access$000(ComponentManagerImpl.java:421)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.a(ComponentManagerImpl.java:102)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.initComponents(ComponentManagerImpl.java:346)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:86)
    at com.intellij.openapi.project.impl.ProjectImpl.init(ProjectImpl.java:307)
    at com.intellij.openapi.project.impl.ProjectManagerImpl.a(ProjectManagerImpl.java:279)
    at com.intellij.openapi.project.impl.ProjectManagerImpl.access$300(ProjectManagerImpl.java:81)
    at com.intellij.openapi.project.impl.ProjectManagerImpl$9.compute(ProjectManagerImpl.java:529)
    at com.intellij.openapi.project.impl.ProjectManagerImpl$9.compute(ProjectManagerImpl.java:525)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$4.run(ProgressManagerImpl.java:275)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:501)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:310)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:191)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:232)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:181)
    at com.intellij.openapi.application.impl.ApplicationImpl$8$1.run(ApplicationImpl.java:692)
    at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:465)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:153)
Caused by: java.lang.NoClassDefFoundError: org/apache/http/protocol/HttpContext
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.a(ComponentManagerImpl.java:445)
    ... 25 more
Caused by: java.lang.ClassNotFoundException: org.apache.http.protocol.HttpContext PluginClassLoader[maca.myplugin, 0.1]
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:77)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    ... 28 more

IntelliJ はプラグインのクラスローダーのクラスパスに他のライブラリを配置していないようで、その理由がわかりません。

誰か助けてくれませんか?

ありがとう

4

0 に答える 0