기술지원 문의

DB Connection 관련 질문 드립니다.
장윤선 / 2003-03-03 00:00

수고 많으십니다.
DB Connection 관련 질문 좀 드립니다.

지금 톰캣에서 작업한 사이트를 레진에 올려놓고 테스트 중인데요
linux 에서 apache와 resin 연동시키고 mysql로 연결하니까 연결은 됩니다.
근데 아무래도 레진에서 제공해주는 드라이버를 쓰고 싶어서
아래 게시판에 올려진 예제대로 (409번 게시물) 테스트를 해볼려고 하니
TestDatabase.java를 컴파일 할때 에러가 납니다.

첨에는 servlet.jar 파일이 없었는데, 에러가 나서 혹시나하고 톰캣에 있던 servlet.jar 파일을 resin/lib에 넣어주고 resin 재시동해도 마찬가집니다.
뭐가 문제인지 좀 알려주세요

수고하세요^^

==============================================
===========에러 메시지 ===========================
TestDatabase.java:6: package javax.servlet does not exist
import javax.servlet.*; 
^
TestDatabase.java:7: package javax.servlet.http does not exist
import javax.servlet.http.*; 
^
TestDatabase.java:11: cannot resolve symbol
symbol  : class HttpServlet  
location: class test.TestDatabase
public class TestDatabase extends HttpServlet { 
                                  ^
TestDatabase.java:15: cannot resolve symbol
symbol  : class ServletException  
location: class test.TestDatabase
throws ServletException 
       ^
TestDatabase.java:29: cannot resolve symbol
symbol  : class HttpServletRequest  
location: class test.TestDatabase
public void doGet(HttpServletRequest req, 
                  ^
TestDatabase.java:30: cannot resolve symbol
symbol  : class HttpServletResponse  
location: class test.TestDatabase
HttpServletResponse res) 
^
TestDatabase.java:31: cannot resolve symbol
symbol  : class ServletException  
location: class test.TestDatabase
throws IOException, ServletException 
                    ^
TestDatabase.java:23: cannot resolve symbol
symbol  : class ServletException  
location: class test.TestDatabase
throw new ServletException(\"`jdbc/test is an unknown DataSource\"); 
          ^
TestDatabase.java:25: cannot resolve symbol
symbol  : class ServletException  
location: class test.TestDatabase
throw new ServletException(e); 
          ^
TestDatabase.java:53: cannot resolve symbol
symbol  : class ServletException  
location: class test.TestDatabase
throw new ServletException(e); 
          ^
10 errors

Re:DB Connection 관련 질문 드립니다.
관리자 / 2003-03-03 00:00

Resin에서 제공하는 servelt.jar는
$RESIN_HOME/lib/jsdk23.jar라는 파일로 존재합니다.
다른 컨테이너에서 제공하는 것을 이용하시면 안됩니다.

즉 CLASSPATH, $JAVA_HOME/jre/lib/ext에 .jar d와 
Resin/lib에 있는 놈들과 같은 라이브러리인 경우
Resin에서 제공하는 것을 이용하시고 다른 것을 이용하시면
안됩니다.



--장윤선 님의 글 [2003-03-03 15:16:02]
>수고 많으십니다.
DB Connection 관련 질문 좀 드립니다.

지금 톰캣에서 작업한 사이트를 레진에 올려놓고 테스트 중인데요
linux 에서 apache와 resin 연동시키고 mysql로 연결하니까 연결은 됩니다.
근데 아무래도 레진에서 제공해주는 드라이버를 쓰고 싶어서
아래 게시판에 올려진 예제대로 (409번 게시물) 테스트를 해볼려고 하니
TestDatabase.java를 컴파일 할때 에러가 납니다.

첨에는 servlet.jar 파일이 없었는데, 에러가 나서 혹시나하고 톰캣에 있던 servlet.jar 파일을 resin/lib에 넣어주고 resin 재시동해도 마찬가집니다.
뭐가 문제인지 좀 알려주세요

수고하세요^^

==============================================
===========에러 메시지 ===========================
TestDatabase.java:6: package javax.servlet does not exist
import javax.servlet.*; 
^
TestDatabase.java:7: package javax.servlet.http does not exist
import javax.servlet.http.*; 
^
TestDatabase.java:11: cannot resolve symbol
symbol  : class HttpServlet  
location: class test.TestDatabase
public class TestDatabase extends HttpServlet { 
                                  ^
TestDatabase.java:15: cannot resolve symbol
symbol  : class ServletException  
location: class test.TestDatabase
throws ServletException 
       ^
TestDatabase.java:29: cannot resolve symbol
symbol  : class HttpServletRequest  
location: class test.TestDatabase
public void doGet(HttpServletRequest req, 
                  ^
TestDatabase.java:30: cannot resolve symbol
symbol  : class HttpServletResponse  
location: class test.TestDatabase
HttpServletResponse res) 
^
TestDatabase.java:31: cannot resolve symbol
symbol  : class ServletException  
location: class test.TestDatabase
throws IOException, ServletException 
                    ^
TestDatabase.java:23: cannot resolve symbol
symbol  : class ServletException  
location: class test.TestDatabase
throw new ServletException(\"`jdbc/test is an unknown DataSource\"); 
          ^
TestDatabase.java:25: cannot resolve symbol
symbol  : class ServletException  
location: class test.TestDatabase
throw new ServletException(e); 
          ^
TestDatabase.java:53: cannot resolve symbol
symbol  : class ServletException  
location: class test.TestDatabase
throw new ServletException(e); 
          ^
10 errors