2017-03-08 4 views
-1

아래와 같이 Felix 콘솔 (내 서비스 구현)에서 구성 대화 상자를 채우는 OSGI 클래스를 작성하려고합니다. 하지만 내가 실행하려고하면 mvn clean install -PautoInstallPackage 아래의 오류가 점점. 어떤 도움을 주셔서 감사합니다.OSGI 클래스 컴파일에서 @Activate 오류를 찾을 수 없습니다.

[ERROR]가 목표 org.apache.maven.plugins 실행하지 못했습니다

: 받는다는 - 컴파일러 플러그인 : 3.2 : 프로젝트 osgiexample.core에 (기본 컴파일)을 컴파일 : 컴파일 실패

을 [ ERROR] /E://osgiexample/core/src/main/java/osgiexample/core/serviceimpl/TestServiceImpl.java:[40,10] 찾을 수없는 기호

[ERROR] 기호 : 클래스

활성화

[오류] 위치 :

@Component(immediate=true, label="TEST Service", description="Hello There - This is a Service component", metatype=true) 
@Service(value=TestService.class) 

public class TestServiceImpl implements TestService { 

@Property(value="http://testservice/myservice?wsdl") 
static final String SERVICE_ENDPOINT_URL = "service.endpoint.url"; 

private String serviceEndpointUrl; 

    @Override 
    public String getData() { 
     // TODO Auto-generated method stub 
     return null; 
    } 

    @Activate 
    public void activate(final Map<String, Object> props) { 
    System.out.println("Calling Activate Method"); 
    this.serviceEndpointUrl = (String)props.get(SERVICE_ENDPOINT_URL); 
    System.out.println("ServiceEndpointUrl:" + this.serviceEndpointUrl); 
} 
} 
+0

코드가 컴파일되지 않습니다. 'Activate' 어노테이션 가져 오기가 누락 된 것 같습니다. – toniedzwiedz

+0

@Krish 클래스에'import org.apache.felix.scr.annotations.Activate;'가 있습니까? – VAr

+0

@VAr & toniedzwiedz는 포인터에 대한 수입 감사를 놓쳤습니다. 그것은 나의 컴파일 문제를 흐리게했다. – krish

답변

0

이 문제를

수입 org.apache.felix.scr.annotations.Activate를 해결해야 활성화 주석 import 문 아래에있는 추가 osgiexample.core.serviceimpl.TestServiceImpl 클래스;