Липсва клас при изпълнение на Jira Plugin

Създавам плъгин JIRA, който обработва входящите съобщения. Използвам Jericho за анализ на HTML информацията на имейлите. В eclipse и докато правя "atlas-compile/run/debug" не получавам никакви съобщения за грешка за липсващи библиотеки. Веднага щом плъгинът трябва да предприеме действие с помощта на класа „Източник“ на Jericho JAR, срещам следната грешка.

[INFO] [talledLocalContainer] java.lang.NoClassDefFoundError: net/htmlparser/jericho/Source
[INFO] [talledLocalContainer] at a2j.ExtractHTMLContent.extractMailContent(ExtractHTMLContent.java:63)
[INFO] [talledLocalContainer] at a2j.Handler.handleMessage(Handler.java:109)
[INFO] [talledLocalContainer] at com.atlassian.jira.service.services.mail.MailFetcherService$1.process(MailFetcherService.java:413)
[INFO] [talledLocalContainer] at com.atlassian.jira.service.services.mail.MailFetcherService$MessageProviderImpl.getAndProcessMail(MailFetcherService.java:306)
[INFO] [talledLocalContainer] at com.atlassian.jira.service.services.mail.MailFetcherService.runImpl(MailFetcherService.java:401)
[INFO] [talledLocalContainer] at com.atlassian.jira.service.services.file.AbstractMessageHandlingService.run(AbstractMessageHandlingService.java:261)
[INFO] [talledLocalContainer] at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:66)
[INFO] [talledLocalContainer] at com.atlassian.jira.service.ServiceRunner.runService(ServiceRunner.java:75)
[INFO] [talledLocalContainer] at com.atlassian.jira.service.ServiceRunner.runServiceId(ServiceRunner.java:53)
[INFO] [talledLocalContainer] at com.atlassian.jira.service.ServiceRunner.runJob(ServiceRunner.java:36)
[INFO] [talledLocalContainer] at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:135)
[INFO] [talledLocalContainer] at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:101)
[INFO] [talledLocalContainer] at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:80)
[INFO] [talledLocalContainer] at com.atlassian.scheduler.quartz1.Quartz1Job.execute(Quartz1Job.java:32)
[INFO] [talledLocalContainer] at org.quartz.core.JobRunShell.run(JobRunShell.java:223)
[INFO] [talledLocalContainer] at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
[INFO] [talledLocalContainer] Caused by: java.lang.ClassNotFoundException: net.htmlparser.jericho.Source
[INFO] [talledLocalContainer] at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772)
[INFO] [talledLocalContainer] at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)
[INFO] [talledLocalContainer] at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690)
[INFO] [talledLocalContainer] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
[INFO] [talledLocalContainer] ... 16 more

Бурканът и pom са налични на местоположението, посочено в .classpath

Ще се радвам на всяка помощ или принос по този въпрос

Добавяне на pom.xml и atlassian-plugin.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">

    <modelVersion>4.0.0</modelVersion>
    <groupId></groupId>
    <artifactId>a2j</artifactId>
    <version>1.0</version>

    <organization>
       <name></name>
       <url></url>
    </organization>

    <name>Mail Handler Plugin</name>
    <description>This A2J Plugin for Atlassian JIRA.</description>
    <packaging>atlassian-plugin</packaging>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>         
            <groupId>com.atlassian.jira</groupId>         
            <artifactId>jira-mail-plugin</artifactId>         
            <version>${jira.version}</version>         
            <scope>provided</scope>     
        </dependency>     
        <dependency>         
            <groupId>com.atlassian.mail</groupId>         
            <artifactId>atlassian-mail</artifactId>         
            <version>2.1</version>         
            <scope>provided</scope>     
        </dependency>
        <dependency>         
            <groupId>javax.mail</groupId>         
            <artifactId>mail</artifactId>         
            <version>1.4.4</version>         
            <scope>provided</scope>     
        </dependency>
        <dependency>
            <groupId>net.htmlparser.jericho</groupId>
            <artifactId>jericho-html</artifactId>
            <version>3.3</version>
        </dependency>

        <!-- WIRED TEST RUNNER DEPENDENCIES -->
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-testrunner</artifactId>
            <version>${plugin.testrunner.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>1.1.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.2.2-atlassian-1</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.version}</productDataVersion>

                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <properties>
        <jira.version>6.3.6</jira.version>
        <amps.version>5.0.4</amps.version>
        <plugin.testrunner.version>1.2.0</plugin.testrunner.version>
        <!-- TestKit version 5.x for JIRA 5.x, 6.x for JIRA 6.x -->
        <testkit.version>5.2.26</testkit.version>
    </properties>

</project>

atlassian-плъгин

<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-   version="2">
    <plugin-info>
        <description>${project.description}</description>
        <version>${project.version}</version>
        <vendor name="${project.organization.name}" url="${project.organization.url}" />
        <param name="plugin-icon">images/pluginIcon.png</param>
        <param name="plugin-logo">images/pluginLogo.png</param>
    </plugin-info>

    <!-- add our i18n resource -->
    <resource type="i18n" name="i18n" location="a2j"/>

    <!-- add our web resources -->
    <web-resource key="a2j-resources" name="a2j Web Resources">
        <dependency>com.atlassian.auiplugin:ajs</dependency>

        <resource type="download" name="a2j.css" location="/css/a2j.css"/>
        <resource type="download" name="a2j.js" location="/js/a2j.js"/>
        <resource type="download" name="images/" location="/images"/>

        <context>a2j</context>
    </web-resource>

    <!-- publish our component -->
    <component key="issue-data-manager" class="a2j.IssueDataManager"/>
    <message-handler i18n-name-key="handler.name"
        key="handler" 
        class="a2j.Handler"
        add-edit-url="/secure/admin/EditHandlerDetailsUsingParams!default.jspa"
        weight="0"/>

    <!-- import from the product container -->
     <component-import key="applicationProperties"     interface="com.atlassian.sal.api.ApplicationProperties" />

</atlassian-plugin>

person frankster1001    schedule 29.09.2014    source източник
comment
@ScottDudley добави двата файла   -  person frankster1001    schedule 29.09.2014


Отговори (1)


Изправени сме пред същия проблем, но с друга рамка. Всичко е тук https://developer.atlassian.com/display/DOCS/Managing+Dependencies Използва се неправилен ClassLoader. Можете да получите правилен, като извикате MyClass.class.getClassLoader() на всеки от вашия клас. Или прочетете тази статия (или други) и потърсете подходящо (конфигурационно) решение.

person He Rompo Lbu    schedule 19.11.2014