아래와 같이 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);
}
}
코드가 컴파일되지 않습니다. 'Activate' 어노테이션 가져 오기가 누락 된 것 같습니다. – toniedzwiedz
@Krish 클래스에'import org.apache.felix.scr.annotations.Activate;'가 있습니까? – VAr
@VAr & toniedzwiedz는 포인터에 대한 수입 감사를 놓쳤습니다. 그것은 나의 컴파일 문제를 흐리게했다. – krish