2013-12-08 6 views
1

BndTools를 사용하여 서블릿을 빌드하려고합니다. 나는이 자습서 다음 : http://www.ralfebert.de/archive/java/osgi_server/아파치 펠릭스 화이트 보드 (OSGi)를 사용하여 서블릿을 생성 할 때의 문제

을하지만 .. 나는 :(일 서블릿을 얻을 수 을 문제는 아파치 펠릭스 화이트 보드 번들 디버그 메시지를 제공한다는 것입니다 :.에서 javax.servlet 서블릿 서비스를 무시 . 서블릿, 별명이 없거나 빈

내가 시간 시간 동안 주위 봤 적이 있지만 나는이 문제에 어떤 답을 얻을 수 을 내가 로컬 호스트에 액세스하려고하면

:. 8080 다음과 같은 메시지가 내가 얻을 :

/에 액세스하는 중 문제가 발생했습니다. 이유 :

,
NOT_FOUND 

여기 내 서블릿의 코드입니다 : 내가 놓치고 또는 내가 뭔가 잘못하고있는 중이 야 무엇

package com.example.helloworld; 

import java.io.IOException; 

import javax.servlet.*; 
import javax.servlet.http.*; 

import aQute.bnd.annotation.component.Component; 

@Component(provide=Servlet.class, properties = { "alias=/" }) 
public class HelloWorldServlet extends HttpServlet { 

    @Override 
    public void doGet(HttpServletRequest req, HttpServletResponse resp) 
      throws ServletException, IOException { 
     resp.getWriter().append("Hello World!"); 
    } 

} 

?

-buildpath: osgi.core,\ 
    osgi.cmpn,\ 
    biz.aQute.bnd.annotation,\ 
    junit.osgi,\ 
    org.apache.felix.http.jetty 
-sub: *.bnd 
-runfw: org.apache.felix.framework;version='[4.0.3,4.0.3]' 

을 내가 BndTools의 최신 버전을 사용하고 있기 때문에, 나는 더 이상는 .bnd 파일에서 모든 것을 관리 할 수 ​​없습니다 :

여기 내 bnd.bnd 파일의 소스입니다. 그래서 여기 또한 내 run.runbnd 파일의 소스입니다 :

-runfw: org.apache.felix.framework;version='[4,5)' 
-runee: JavaSE-1.6 
-runsystemcapabilities: ${native_capability} 

-resolve.effective: active 



-runrequires: osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.command)',\ 
    osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.runtime)',\ 
    osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.shell)',\ 
    osgi.identity;filter:='(osgi.identity=org.apache.felix.http.jetty)',\ 
    osgi.identity;filter:='(osgi.identity=org.apache.felix.webconsole)',\ 
    osgi.identity;filter:='(osgi.identity=org.apache.felix.http.whiteboard)' 
-runbundles: org.apache.felix.gogo.command,\ 
    org.apache.felix.gogo.runtime,\ 
    org.apache.felix.gogo.shell,\ 
    osgi.cmpn,\ 
    org.apache.felix.http.jetty,\ 
    org.apache.felix.http.whiteboard,\ 
    com.example.helloworld.org.example;version=latest 
+0

bnd.bnd 파일을 게시 할 수도 있습니까? –

답변

1

당신은 당신의 실행 구성에 선언적 서비스의 서비스 구성 요소 런타임을 제공하는 번들을 추가해야합니다. 번들은 org.apache.felix.scr라고 불리며 저장소 뷰의 Bndtools 허브 저장소에서 찾을 수 있습니다.

구성 요소를 완벽하게 구성했지만 실행시 구성을 실제로 처리하려면 SCR 번들이 필요합니다.