2013-08-28 7 views
0

내가 DFS 웹 서비스를 호출하는 간단한 자바 프로그램을 개발하기 위해 노력하고 내가이 런타임 오류 얻을 : 내가 프로젝트를 빌드하고 설치 받는다는을 사용하고의 ClassNotFoundException :은 OSGi에 ObjectServiceDescriptor

Caused by: com.emc.documentum.fs.rt.impl.servicemodel.ServiceModelException: Service descriptor class not found: "java.lang.ClassNotFoundException: com.emc.documentum.fs.services.core.client.ObjectServiceDescriptor". 
at com.emc.documentum.fs.rt.impl.servicemodel.JavaBeanTreeFactory.getDescriptor(JavaBeanTreeFactory.java:218) 
at com.emc.documentum.fs.rt.impl.servicemodel.JavaBeanTreeFactory.getModule(JavaBeanTreeFactory.java:41) 
at com.emc.documentum.fs.rt.context.ServiceFactory.makeServiceUrl(ServiceFactory.java:332) 
at com.emc.documentum.fs.rt.context.ServiceFactory.getRemoteService(ServiceFactory.java:143) 
at com.emc.documentum.fs.rt.context.ServiceFactory.getRemoteService(ServiceFactory.java:197) 
at info.hartmann.dfs.impl.Handler.init(Handler.java:112) 

을 그것을 Adobe CQ5의 OSGi 컨테이너에 넣으십시오. 이클립스의 일반적인 Java 애플리케이션에서이 동일한 코드를 시도해 보았습니다.

이상한 점은이 클래스 ObjectServiceDescriptor 에 있는데, 이는 메이븐 종속성을 통해 포함하는 .jar 라이브러리 중 하나입니다. jar 이름은 emc-dfs-services-remote-1.0.jar입니다. maven에서 생성 한 .jar 파일을 열면 emc-dfs-services-remote-1.0.jar이 표시됩니다.

프로젝트 컴파일은 문제없이 진행하지만, 런타임 동안 나는이 줄에 오류가 발생합니다 :

IObjectService objectService = serviceFactory.getRemoteService(com.emc.documentum.fs.services.core.client.IObjectService.class, serviceContext, module, host); 

내 pom.xml 파일은 다음과 같습니다. 보시다시피, 필자는 Imported-Packages에서 패키지 중 일부를 선택적으로 선언합니다. 이 작업을 수행하지 않으면 내 번들을 컴파일 할 수는 있지만 시작할 수는 없습니다. 이러한 패키지를 선택 사항으로 선언하는 것이 문제가 될 수 있습니까?

<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/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>CXF-example-ievgen</groupId> 
    <artifactId>CXF-example-ievgen</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>bundle</packaging> 
    <name>Ievgeng sample bundle</name> 


    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.sling</groupId> 
       <artifactId>maven-sling-plugin</artifactId> 
       <executions> 
        <execution> 
         <id>install-bundle</id> 
         <goals> 
          <goal>install</goal> 
         </goals> 
        </execution> 
       </executions> 
       <configuration> 
        <slingUrl>http://192.168.56.101:4502/system/console</slingUrl> 
        <user>user</user> 
        <password>password</password> 
       </configuration> 
      </plugin> 

      <plugin> 
       <groupId>org.apache.felix</groupId> 
       <artifactId>maven-scr-plugin</artifactId> 
       <version>1.7.2</version> 
       <executions> 
        <execution> 
         <id>generate-scr-scrdescriptor</id> 
         <goals> 
          <goal>scr</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 

      <plugin> 
       <groupId>org.apache.felix</groupId> 
       <artifactId>maven-bundle-plugin</artifactId> 
       <version>2.1.0</version> 
       <extensions>true</extensions> 
       <executions> 
        <execution> 
         <id>wrap-my-dependency</id> 
         <goals> 
          <goal>wrap</goal> 
         </goals> 
         <configuration> 
          <wrapImportPackage>;</wrapImportPackage> 
         </configuration> 
        </execution> 
       </executions> 
       <configuration> 
        <instructions> 
         <Export-Package>info.hartmann.dfs.api</Export-Package> 
         <Private-Package>info.hartmann.dfs.impl 

         </Private-Package> 
         <!-- bundle supplied resource prefixes --> 
         <Include-Resource>{maven-resources}</Include-Resource> 

         <!-- Do not inline jars, include as jar files --> 
         <Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency> 
         <Embed-Transitive>true</Embed-Transitive> 

         <!-- use _exportcontents instead of Export-Package to avoid conflict with Embed-Dependency an inline=true --> 
         <!-- <_exportcontents> --> 
         <!-- org.apache.cxf.*;version=${project.version} --> 
         <!-- </_exportcontents> --> 

         <!-- declare optional dependencies --> 
         <Import-Package> 
         com.documentum.fc.client.search;resolution:=optional, 
         com.documentum.fc.client.impl.session;resolution:=optional, 
         com.documentum.fc.common;resolution:=optional, 
         com.documentum.fc.client;resolution:=optional, 
         com.documentum.com;resolution:=optional, 
         com.documentum.ci;resolution:=optional, 
         com.documentum.ucf.*;resolution:=optional, 
         com.documentum.operations.*;resolution:=optional, 
         com.documentum.registry;resolution:=optional, 
         com.documentum.xerces_2_8_0.xerces.impl.dv.util;resolution:=optional, 
         org.slf4j.*;resolution:=optional, 
         org.osgi.*;resolution:=optional, 
         com.emc.documentum.kerberos.*;resolution:=optional, 
         javax.xml.registry.*;resolution:=optional, 
         jp.co.swiftinc.relax.*;resolution:=optional, 
         junit.framework;resolution:=optional, 
         org.apache.xerces.*;resolution:=optional, 
         org.apache.xml.*;resolution:=optional, 
         sun.io;resolution:=optional, 
         sun.misc;resolution:=optional, 
         sun.nio.cs;resolution:=optional, 
         sun.security.action;resolution:=optional, 
         com.sun.tools.javadoc;resolution:=optional, 
         org.apache.regexp;resolution:=optional, 
         org.apache.tools.*;resolution:=optional, 
         org.apache.xerces.*;resolution:=optional, 
         org.apache.xml.*;resolution:=optional, 
         org.aspectj.bea.jvm;resolution:=optional, 
         org.eclipse.jface.text;resolution:=optional, 
         org.eclipse.osgi.framework.*;resolution:=optional, 
         org.eclipse.osgi.internal.profile;resolution:=optional, 
         org.eclipse.osgi.service.*;resolution:=optional, 
         org.eclipse.osgi.util;resolution:=optional, 
         org.eclipse.update.configurator;resolution:=optional, 
         * 
         </Import-Package> 
        </instructions> 
       </configuration> 
      </plugin> 





     </plugins> 
     <pluginManagement> 
      <plugins> 
       <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> 
       <plugin> 
        <groupId>org.eclipse.m2e</groupId> 
        <artifactId>lifecycle-mapping</artifactId> 
        <version>1.0.0</version> 
        <configuration> 
         <lifecycleMappingMetadata> 
          <pluginExecutions> 
           <pluginExecution> 
            <pluginExecutionFilter> 
             <groupId> 
org.apache.felix 
             </groupId> 
             <artifactId> 
maven-scr-plugin 
             </artifactId> 
             <versionRange> 
[1.7.2,) 
             </versionRange> 
             <goals> 
              <goal>scr</goal> 
             </goals> 
            </pluginExecutionFilter> 
            <action> 
             <ignore/> 
            </action> 
           </pluginExecution> 

          </pluginExecutions> 
         </lifecycleMappingMetadata> 
        </configuration> 
       </plugin> 
      </plugins> 
     </pluginManagement> 

    </build> 



    <dependencies> 
     <dependency> 
      <groupId>activation</groupId> 
      <artifactId>activation</artifactId> 
      <!-- actually it is version 1.1 but i didnt get how to resolve error --> 
      <version>1.0</version> 
      <scope>runtime</scope>  
     </dependency> 
     <dependency> 
      <groupId>aspectj</groupId> 
      <artifactId>aspectjrt</artifactId> 
      <version>1.5.2a</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.emc</groupId> 
      <artifactId>emc-collaboration</artifactId> 
      <version>1.0</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>commons-io</groupId> 
      <artifactId>commons-io</artifactId> 
      <version>1.2</version> 
      <scope>runtime</scope> 
     </dependency> 
     <dependency> 
      <groupId>commons-lang</groupId> 
      <artifactId>commons-lang</artifactId> 
      <version>2.4</version> 
      <scope>runtime</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.emc</groupId> 
      <artifactId>emc-admin-services-remote</artifactId> 
      <version>1.0</version> 
      <scope>compile</scope> 
      <!--<systemPath>${project.basedir}/src/main/resources/emc-admin-services-remote.jar</systemPath>--> 
     </dependency> 
     <dependency> 
      <groupId>com.emc</groupId> 
      <artifactId>emc-bpm-services-remote</artifactId> 
      <version>1.0</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.emc</groupId> 
      <artifactId>emc-ci-services-remote</artifactId> 
      <version>1.0</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.emc</groupId> 
      <artifactId>emc-dfs-rt-remote</artifactId> 
      <version>1.0</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.emc</groupId> 
      <artifactId>emc-dfs-services-remote</artifactId> 
      <version>1.0</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.emc</groupId> 
      <artifactId>emc-search-services-remote</artifactId> 
      <version>1.0</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.sun.xml.fastinfoset</groupId> 
      <artifactId>FastInfoset</artifactId> 
      <version>1.2</version> 
     </dependency>  
     <dependency> 
      <groupId>com.emc</groupId> 
      <artifactId>http</artifactId> 
      <version>1.0</version> 
      <scope>runtime</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.sun.xml.bind</groupId> 
      <artifactId>jaxb1-impl</artifactId> 
      <version>2.1.4</version> 
      <scope>runtime</scope> 
     </dependency> 
     <dependency> 
      <groupId>javax.xml</groupId> 
      <artifactId>jaxb-api</artifactId> 
      <version>2.0</version> 
      <scope>runtime</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.sun.xml.bind</groupId> 
      <artifactId>jaxb-impl</artifactId> 
      <version>2.1.11</version> 
      <scope>runtime</scope> 
     </dependency> 
     <dependency> 
      <groupId>javax.xml</groupId> 
      <artifactId>jaxws-api</artifactId> 
      <version>2.1</version> 
     </dependency> 
     <dependency> 
      <groupId>com.sun.xml.ws</groupId> 
      <artifactId>jaxws-rt</artifactId> 
      <version>2.1.7</version> 
     </dependency>   
     <dependency> 
      <groupId>javax.xml.bind</groupId> 
      <artifactId>jsr173_api</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>javax.jws</groupId> 
      <artifactId>jsr181-api</artifactId> 
      <version>1.0</version> 
     </dependency>   
     <dependency> 
      <groupId>javax.annotation</groupId> 
      <artifactId>jsr250-api</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>org.jvnet</groupId> 
      <artifactId>mimepull</artifactId> 
      <version>1.4</version> 
     </dependency> 
     <dependency> 
      <groupId>com.sun.org.apache.xml.internal</groupId> 
      <artifactId>resolver</artifactId> 
      <version>20050927</version> 
      <scope>runtime</scope> 
     </dependency> 
     <dependency> 
      <groupId>javax.xml</groupId> 
      <artifactId>saaj-api</artifactId> 
      <version>1.3</version> 
     </dependency>   
     <dependency> 
      <groupId>com.sun.xml.messaging.saaj</groupId> 
      <artifactId>saaj-impl</artifactId> 
      <version>1.3.3</version> 
     </dependency> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>servlet-api</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>com.sun.xml.stream</groupId> 
      <artifactId>sjsxp</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>org.jvnet.staxex</groupId> 
      <artifactId>stax-ex</artifactId> 
      <version>1.0</version> 
      <scope>runtime</scope> 
      <!--<systemPath>${project.basedir}/src/main/resources/stax-ex.jar</systemPath>--> 
     </dependency> 
     <dependency> 
      <groupId>com.sun.xml.stream.buffer</groupId> 
      <artifactId>streambuffer</artifactId> 
      <version>0.8</version> 
     </dependency> 
     <dependency> 
      <groupId>xerces</groupId> 
      <artifactId>xercesImpl</artifactId> 
      <version>2.5.0</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.felix</groupId> 
      <artifactId>org.apache.felix.scr.annotations</artifactId> 
      <version>1.6.0</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.osgi</groupId> 
      <artifactId>org.osgi.core</artifactId> 
      <version>4.0.0</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.sling</groupId> 
      <artifactId>org.apache.sling.commons.osgi</artifactId> 
      <version>2.0.2-incubator</version> 
      <type>bundle</type> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.felix</groupId> 
      <artifactId>org.osgi.compendium</artifactId> 
      <version>1.4.0</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.sling</groupId> 
      <artifactId>org.apache.sling.commons.log</artifactId> 
      <version>2.0.6</version> 
      <scope>provided</scope> 
     </dependency> 
    </dependencies> 
</project> 

번들 클래스 패스은 OSGi 콘솔에 설치 한 후 :

Bundle Classpath ., sjsxp-1.0.jar, emc-collaboration-1.0.jar, FastInfoset-1.2.jar, 
aspectjrt-1.5.2a.jar,stax-api-1.0.jar,jsr250-api-1.0.jar,activation-1.0.jar, 
resolver-20050927.jar,streambuffer-0.8.jar,jsr181-api-1.0.jar, 
jsr173_api-1.0.jar,jaxb1-impl-2.1.4.jar, emc-dfs-rt-remote-1.0.jar, 
commons-lang-2.4.jar,commons-io-1.2.jar,stax-ex-1.0.jar,saaj-impl-1.3.3.jar, 
jaxws-rt-2.1.7.jar,xercesImpl-2.5.0.jar,jaxb-api-2.0.jar,mimepull-1.4.jar, 
emc-bpm-services-remote-1.0.jar,emc-search-services-remote-1.0.jar,activation-1.1.jar,http-1.0.jar, 
jaxb-impl-2.1.11.jar,jaxws-api-2.1.jar,emc-ci-services-remote-1.0.jar, 
emc-admin-services-remote-1.0.jar, emc-dfs-services-remote-1.0.jar,servlet-api-1.0.jar,saaj-api-1.3.jar 

내 자바 코드 : 여기 비슷한 문제를 본 적이

public void init() throws Exception { 
    ContextFactory contextFactory = ContextFactory.getInstance(); 
    serviceContext = contextFactory.newContext(); 
    RepositoryIdentity repositoryIdentity = new RepositoryIdentity(); 

    repositoryIdentity.setRepositoryName(repository); 
    repositoryIdentity.setUserName(user); 
    repositoryIdentity.setPassword(pass); 
    serviceContext.addIdentity(repositoryIdentity); 

    ServiceFactory serviceFactory = ServiceFactory.getInstance(); 
//ERROR is thrown here: 
    objectService = serviceFactory.getRemoteService(IObjectService.class, serviceContext, module, host); 
    queryService = serviceFactory.getRemoteService(IQueryService.class, serviceContext, module, host); 
    } 

가 : https://community.emc.com/thread/82798는하지만 솔루션 제공이 didn를 ' 도와 줘. 나는 타입 com.emc.documentum.fs.services.core.client.IObjectService의 클래스 (그리고 COM을 만드는 오전 있는지 확인하십시오 만들기보다 높은 1.5

  • 에 JRE 버전을 변경

    • 했습니다. ebc.documentum.fs.services.core.impl.IObjectService).
    • 보다 완벽하게 매개 변수화 된 버전의 getRemoteService로 시도하면 호출시 모호성이 제거됩니다.
    • 다른 많은 것들을, 별도의 번들에 모든 외부 병을 설치하고 그들을 가져 오는 것.

    필자는 Eclipse 프로젝트에서 사용한 프로젝트에 모든 .jars 파일을 포함 시켰기 때문에 필자가 알아낼 수는 없지만 동일하게 작동해야한다. 그렇지?

    감사합니다.

    편집 : I가 수출 패키지를 변경하려고했습니다. info.hartmann.dfs.api, com.emc.documentum * 즉, 나는 모든 Documentum의 패키지를 수출했습니다. 위의 목록에 오류가 사라진, 그러나 나는 새로운 하나를 가지고 : 그것은 한 단계 또는 한 단계 뒤에 저를 이동하면

    Caused by: com.emc.documentum.fs.rt.impl.servicemodel.ServiceModelException: Service descriptor file not found: "services-core-service-model.xml". 
    at com.emc.documentum.fs.rt.impl.servicemodel.JavaBeanTreeFactory.getModuleByName(JavaBeanTreeFactory.java:65) 
    at com.emc.documentum.fs.rt.impl.servicemodel.JavaBeanTreeFactory.getModule(JavaBeanTreeFactory.java:42) 
    at com.emc.documentum.fs.rt.context.ServiceFactory.makeServiceUrl(ServiceFactory.java:332) 
    at com.emc.documentum.fs.rt.context.ServiceFactory.getRemoteService(ServiceFactory.java:143) 
    at com.emc.documentum.fs.rt.context.ServiceFactory.getRemoteService(ServiceFactory.java:197) 
    at info.hartmann.dfs.impl.Handler.init(Handler.java:112) 
    

    Unfortunatelly, 난 몰라.

  • +0

    당신이 다음 줄에 동일한 오류를받을 수 있나요 패키지를 가져

    확인 충분하지? –

    +0

    또한, 원격 .jars를 사용할 때'... client.ObjectServiceDescriptor'를 찾고있는 것이 이상한가요? 둘 다 포함 해 보았습니까? –

    +0

    @unicron, IQueeryService를 사용하여 다음 줄에 java.lang.ClassNotFoundException 오류가 발생합니다 : com.emc.documentum.fs.services.core.client.QueryServiceDescriptor " – Ievgen

    답변

    0

    사용자 번들에 com.emc.documentum.fs.services.core.client.ObjectServiceDescriptor의 배선이 누락 된 것 같습니다. 그냥 클래스 경로에있는 것은 JavaBeanTreeFactory 번들 IQueryService를 사용하여, com.emc.documentum.fs.services.core.client

    관련 문제