2014-09-29 2 views
0

들어오는 메시지를 처리하는 JIRA 플러그인을 만들고 있습니다. 저는 Jericho를 사용하여 메일의 HTML 정보를 구문 분석합니다. Eclipse에서 "atlas-compile/run/debug"를 수행하는 동안 누락 된 라이브러리에 대한 오류 메시지가 표시되지 않습니다. Jericho JAR의 "Source"클래스를 사용하여 플러그인이 조치를 취해야하는 경우 다음 오류가 발생합니다.Jira Plugin 실행시 누락 된 클래스

[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.xml 파일과 골드 피처 - 플러그인을 추가이

에 어떤 도움이나 입력에 대한 행복 할 것 .classpath

에 speified 위치에서 사용할 수 있습니다. 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-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> 
+0

@ScottDudley가 두 파일을 추가했습니다. – frankster1001

답변

0

동일한 문제가 있지만 다른 프레임 워크가 있습니다. 모두 여기에 있습니다 https://developer.atlassian.com/display/DOCS/Managing+Dependencies 잘못된 ClassLoader가 사용되었습니다. MyClass.class.getClassLoader()를 호출하여 올바른 클래스를 얻을 수 있습니다. 클래스 중 하나를 선택합니다. 또는 해당 기사 (또는 기타)를 읽고 Propper (구성) 솔루션을 검색하십시오.