Domino에 OSGi 서블릿 배치(IBM 프리젠테이션) - 404 오류 (Deploying OSGi Servlet to Domino (IBM presentation) - 404 error)


문제 설명

Domino에 OSGi 서블릿 배치(IBM 프리젠테이션) ‑ 404 오류 (Deploying OSGi Servlet to Domino (IBM presentation) ‑ 404 error)

Equinox와 함께 PDE 도구를 사용하여 Domino에 OSGi 컨테이너를 배포하려고 합니다. 저는 이 IBM 슬라이드쇼의 지침을 따릅니다. http://www .slideshare.net/fiorep/domino‑osgi‑development?next_slideshow=1

그러나 (슬라이드 #52에 따름) http://localhost/simpledemo(디버그 구성에서 디버그를 클릭한 후)에서 "404 파일을 찾을 수 없음" 오류가 발생합니다.

"simpledemo" puligin.xml 파일에 매핑된 별칭입니다(슬라이드 44). 그러나 서블릿 이름은 SimpleServlet입니다.

무슨 생각이야?? 도움을 주시면 감사하겠습니다.

내 환경: Windows 2012 Server(VM), Eclipse 3.6.2, Equinox, PDE 도구 및 Domino Server 6.01 서버.

참조: Domino에 OSGi 서블릿 배포

SimpleServlet.Java

 package com.ibm.ls2012;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.ServletException;
import java.io.IOException;
import java.io.PrintWriter;

public class SimpleServlet extends HttpServlet {
private static final long serialVersionUID = 1L;

public SimpleServlet() {

}

@Override

protected void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
   final PrintWriter pw = resp.getWriter();

   resp.setContentType("text/html");
   pw.println("<HTML");
   pw.println("<HEAD><TITLE>SHOW112 ‑ Simple Servlet Demo</TITLE></HEAD>");
   pw.println("<BODY>");
   pw.println("<BR>");
   pw.println("hello world. feeling cold yet?");
}}

참조 솔루션

방법 1:

I followed the similar demo and for some reason have something slightly different. I'm not sure if something's changed or if I took a slightly different approach based on experience of Vaadin web applications on Liberty.

My plugin.xml has:

<extension
    point="com.ibm.pvc.webcontainer.application">
    <contextRoot>
       /helloWorldWC
    </contextRoot>
    <contentLocation>
       WebContent
    </contentLocation>
</extension>

So that's giving a root for the plugin application of "localhost/helloWorldWC/".

Then, in the WebContent\WEB‑INF there's a web.xml that is:

<?xml version="1.0" encoding="UTF‑8"?>
<!DOCTYPE web‑app PUBLIC "‑//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web‑app_2_3.dtd">

<web‑app>
    <servlet>
        <servlet‑name>HelloWorldServlet</servlet‑name>
        <servlet‑class>com.paulwithers.helloWorld.HelloWorldServlet</servlet‑class>
    </servlet>

    <servlet‑mapping>
        <servlet‑name>HelloWorldServlet</servlet‑name>
        <url‑pattern>helloWorld</url‑pattern>
    </servlet‑mapping>
</web‑app>

So this is saying anything with a subsequent URL pattern of "helloWorld", so "localhost/helloWorldWC/helloWorld" should use the HelloWorldServlet. That's defined in the preceding element as mapping to com.paulwithers.helloWorld.HelloWorldServlet class. You can change the url‑pattern to "*" and then localhost/helloWorldWC will map to the HelloWorldServlet class.

To extend that, instead of pointing to an individual servlet class, you can point to a class that extends javax.ws.rs.core.Application which can contain a getClasses() method that returns a Set of all servlets contributed. Each servlet can then have an @Path annotation to define what the path used should be (all this is standard JAX‑RS, I believe). It's a process I used in the attachment to this blog post. The attachment uses OpenNTF Domino API, but the core elements of interest to you ‑ plugin.xml, web.xml, Application class and annotations on Servlet class ‑ are standard.

방법 2:

First thing I would check is that the plugin is correctly loaded. From the server console type: tell http osgi ss {yourpluginname}. Make sure the plugin is loaded and has an active state. If state is installed, then you have a missing constraint issue, to diagnose, type tell http osgi diag {pluginid}. Note: you can get the pluginid from the first ss command.

If state is resolved, then you need to start it manually using the following command: tell http osgi start {pluginid}. Note: being in a resolved state is not expected, the Domino Server should automatically start all plugins.

(by mikkiPaul Stephen WithersDavid Taieb)

참조 문서

  1. Deploying OSGi Servlet to Domino (IBM presentation) ‑ 404 error (CC BY‑SA 2.5/3.0/4.0)

#equinox #osgi #domino-designer-eclipse #lotus-domino






관련 질문

Eclipse에서 OSGi 래퍼 번들을 실행할 수 없습니다. .jar은 잘 빌드되고 있지만 파일을 대상/클래스에 복사하려면 어떻게 해야 합니까? (Can't run OSGi wrapper bundle in Eclipse; .jar is building okay, but how do I also copy files into target/classes?)

최대 절전 모드 5.0 + 춘분 4.5.0 및 사용자 정의 UserType (hibernate 5.0 + equinox 4.5.0 and custom UserType)

Domino에 OSGi 서블릿 배치(IBM 프리젠테이션) - 404 오류 (Deploying OSGi Servlet to Domino (IBM presentation) - 404 error)

Java 7을 사용하여 Equinox 3.8.2 프로젝트 컴파일 (Compile Equinox 3.8.2 Project with java 7)

OSGI 애플리케이션에서 EntityManager를 제공하는 모범 사례 (Best practice to provide EntityManager in OSGI applications)

Eclipse RCP 제품 파일 - 플랫폼별 종속성이 있는 여러 플랫폼을 처리하는 방법 (Eclipse RCP Product File - how to handle multiple platforms with platform specific dependencies)

OSGI 번들이 설치 및 시작되었지만 출력이 표시되지 않음 (OSGI Bundle Installed and Started but no visible output)

Jetty 서버의 포트(Equinox OSGi) (Port in Jetty server (Equinox OSGi ))

Equinox에서 Arquillian 실행 (Running Arquillian in Equinox)

OSGi 가져오기 버전 제한을 동적으로 설정하시겠습니까? (Setting OSGi import version restrictions dynamically?)

OSGI의 AspectJ LoadTimeWeaving (AspectJ LoadTimeWeaving on OSGI)

user.home 디렉토리에 쓰지 못하도록 Eclipse 위치를 어떻게 수정합니까? (How modify Eclipse locations to prevent write to user.home directory?)







코멘트