2016-09-01 1 views
0

다음은 프로젝트의 mvn clean install을 수행 할 때 발생하는 오류입니다. AEM 6.1에서 WCMUse를 사용하려고하는 간단한 AEM 응용 프로그램입니다.간단한 AEM 응용 프로그램에서 WCMUsePojo를 사용할 때 java.lang.VerifyError

[ERROR] Failed to execute goal org.apache.felix:maven-scr-plugin:1.7.4:scr (gene 
rate-scr-descriptor) on project myproject-bundle: Execution generate-scr-descrip 
tor of goal org.apache.felix:maven-scr-plugin:1.7.4:scr failed: An API incompati 
bility was encountered while executing org.apache.felix:maven-scr-plugin:1.7.4:s 
cr: java.lang.VerifyError: Constructor must call super() or this() before return 

[ERROR] Exception Details: 
[ERROR] Location: 
[ERROR] com/adobe/cq/sightly/WCMUsePojo.<init>()V @1: return 
[ERROR] Reason: 
[ERROR] Error exists in the bytecode 
[ERROR] Bytecode: 
[ERROR] 0x0000000: 2ab1 
[ERROR] 
[ERROR] ----------------------------------------------------- 
[ERROR] realm = plugin>org.apache.felix:maven-scr-plugin:1.7.4 
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy 
[ERROR] urls[0] = file:/D:/Maven_Repo/org/apache/felix/maven-scr-plugin/1.7.4/ma 
ven-scr-plugin-1.7.4.jar 
[ERROR] urls[1] = file:/D:/Maven_Repo/org/apache/maven/maven-archiver/2.2/maven- 
archiver-2.2.jar 
[ERROR] urls[2] = file:/D:/Maven_Repo/org/codehaus/plexus/plexus-utils/1.0.4/ple 
xus-utils-1.0.4.jar 
[ERROR] urls[3] = file:/D:/Maven_Repo/junit/junit/3.8.1/junit-3.8.1.jar 
[ERROR] urls[4] = file:/D:/Maven_Repo/org/codehaus/plexus/plexus-archiver/1.0-al 
pha-7/plexus-archiver-1.0-alpha-7.jar 
[ERROR] urls[5] = file:/D:/Maven_Repo/org/apache/felix/org.apache.felix.scr.gene 
rator/1.1.4/org.apache.felix.scr.generator-1.1.4.jar 
[ERROR] urls[6] = file:/D:/Maven_Repo/com/thoughtworks/qdox/qdox/1.12/qdox-1.12. 
jar 
[ERROR] urls[7] = file:/D:/Maven_Repo/asm/asm-all/3.1/asm-all-3.1.jar 
[ERROR] Number of foreign imports: 1 
[ERROR] import: Entry[import from realm ClassRealm[project>my-group-id:myprojec 
t-bundle:1.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]] 
[ERROR] 
[ERROR] ----------------------------------------------------- 
[ERROR] -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit 
ch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please rea 
d the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContaine 
rException 

다음은 WCMUsePojo를 사용하는 코드입니다.

package com.mycompany.myproject.controllers; 
import com.adobe.cq.sightly.WCMUsePojo;; 
public class TestController extends WCMUsePojo{ 

    @Override 
    public void activate() throws Exception { 
     // TODO Auto-generated method stub 
     testMethod(); 
    } 

    void testMethod() 
    { 
     System.out.println("test method"); 
    } 

} 

확장 WCMUsePojo를 제거하면 오류가 발생하지 않으며 빌드가 정상적으로 실행됩니다.

는 내가 사용되는 치어를 검색 :

<?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> 
    <!-- ====================================================================== --> 
    <!-- P A R E N T P R O J E C T D E S C R I P T I O N --> 
    <!-- ====================================================================== --> 
    <parent> 
     <groupId>my-group-id</groupId> 
     <artifactId>myproject</artifactId> 
     <version>1.0-SNAPSHOT</version> 
    </parent> 

    <!-- ====================================================================== --> 
    <!-- P R O J E C T D E S C R I P T I O N --> 
    <!-- ====================================================================== --> 

    <artifactId>myproject-bundle</artifactId> 
    <packaging>bundle</packaging> 
    <name>My Project Bundle</name> 

    <dependencies> 

     <dependency> 
      <groupId>org.osgi</groupId> 
      <artifactId>org.osgi.compendium</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.osgi</groupId> 
      <artifactId>org.osgi.core</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.felix</groupId> 
      <artifactId>org.apache.felix.scr.annotations</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>biz.aQute</groupId> 
      <artifactId>bndlib</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-api</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>servlet-api</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>javax.jcr</groupId> 
      <artifactId>jcr</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.sling</groupId> 
      <artifactId>org.apache.sling.api</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.sling</groupId> 
      <artifactId>org.apache.sling.jcr.api</artifactId> 
     </dependency>   
     <dependency> 
      <groupId>com.adobe.aem</groupId> 
      <artifactId>uber-jar</artifactId> 
      <version>6.1.0</version> 
      <classifier>obfuscated-apis</classifier> 
      <scope>provided</scope> 
     </dependency> 
    </dependencies> 

    <!-- ====================================================================== --> 
    <!-- B U I L D D E F I N I T I O N --> 
    <!-- ====================================================================== --> 
    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.felix</groupId> 
       <artifactId>maven-scr-plugin</artifactId> 
       <executions> 
        <execution> 
         <id>generate-scr-descriptor</id> 
         <goals> 
          <goal>scr</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.felix</groupId> 
       <artifactId>maven-bundle-plugin</artifactId> 
       <extensions>true</extensions> 
       <configuration> 
        <instructions> 
         <Bundle-SymbolicName>my-group-id.myproject-bundle</Bundle-SymbolicName> 
        </instructions> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.sling</groupId> 
       <artifactId>maven-sling-plugin</artifactId> 
       <configuration> 
        <slingUrl>http://${crx.host}:${crx.port}/apps/myproject/install</slingUrl> 
        <usePut>true</usePut> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-javadoc-plugin</artifactId> 
       <configuration> 
        <excludePackageNames> 
         *.impl 
        </excludePackageNames> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 

    <profiles> 
     <profile> 
      <id>auto-deploy</id> 
      <build> 
       <plugins> 
        <!-- Use the sling plugin to automatically deploy the bundle to the 
         JCR tree --> 
        <plugin> 
         <groupId>org.apache.sling</groupId> 
         <artifactId>maven-sling-plugin</artifactId> 
         <executions> 
          <execution> 
           <id>install-bundle</id> 
           <goals> 
            <goal>install</goal> 
           </goals> 
           <configuration> 
            <slingUrl>http://${cq.host}:${cq.port}</slingUrl> 
            <slingUrlSuffix>/apps/myproject/install</slingUrlSuffix> 
            <user>${cq.user}</user> 
            <password>${cq.password}</password> 
            <usePut>true</usePut> 
            <failOnError>true</failOnError> 
           </configuration> 
          </execution> 
         </executions> 
        </plugin> 

       </plugins> 

      </build> 
     </profile> 
    </profiles> 
</project> 
+0

에 종속물로 com.adobe.cq.sightly.cq-wcm-sightly-extension 번들 만 필요하며 생성자 인'public WCMUsePojo()'를 추가하십시오. – VAr

+0

@VAr 시도했습니다. mvn이 새로 설치하는 동안 같은 오류가 발생했습니다 – shanky442

답변

0

이 WcmUsePojo 클래스이며, 동안이 볼 인터페이스 없습니다 주로 때문에 종속 클래스의 인터페이스를 제공 난독 동네 짱 - 항아리입니다 발행물. 이 문제를 해결할 수있는 한 가지 방법은 어도비에 대한 난해한 항아리를 얻고 그것을 사용하는 것입니다. 또 다른 방법은 명시 적으로 종속성을 당신의 포옴에 추가하는 것입니다. 번들 콘솔에서 버전 번호 및 기타 세부 사항을 확인할 수 있습니다. 귀하의 경우 POM

+0

어도비 저장소에 눈에 보이는 확장 jar 파일을 찾을 수 없습니다. '프로젝트에 목표를 실행하지 못했습니다. myproject-bundle : 프로젝트 my-group-id에 대한 보류를 해결할 수 없습니다 : myproject-bundle : 번들 : 1.0-SNAPSHOT : 수 n ot 이슈 찾기 com.adobe.cq.sightly : cq-wcm-sightly-extension : jar : 1.2.30의 예후 있음 be (http://repo.adobe.com/nexus/content/groups/public/) -> [ 도움말 1]' – shanky442

+0

은 pom의 저장소를 으로 업데이트했습니다. http : // repo.adobe.com/nexus/content/repositories/ releases/com/adobe/aem/aem-api/6.0.0.1 /'여전히 동일합니다. 오류 – shanky442

관련 문제