Runtime.getRuntime().exec() (tomcat 7.0.93) 에서 발생하는 문제

kimgil419의 이미지

안녕하세요.

질문하나 올리겠습니다..

도저히 문제가 풀리지 않아서 찾다 찾다 이곳까지 오게 되었네요.

문제가 생긴 개발 환경은 centOs7, tomcat7.0.93 입니다.
hwp 파일을 업로드시 thumbnail 추출 하는 기능을 제작 중인데

pyhwp로 cmd 입력 하여 xhtml로 변환 시키는 작업도중 문제가 생겼습니다.

String cmd = "hwp5html --output="+outputPath+FileName+" "+outputPath+FileName+".hwp";
Process p = null;

System.out.println("cmd = " + cmd);
p = Runtime.getRuntime().exec(cmd);

소스코드 일부분을 잘라 왔습니다.

local에선 잘 작동되었는데
local tomcat 서버가 tomcat 7.0.96 인점을 발견 하여

서버에서도 7.0.96으로 실행 하였습니다.
7.0.96에선 잘 작동 되어 tomcat 버전과 연관이 있을거 라는 추측이 되었습니다.

헌데 이상한 부분은 저 부분에서만 저 코드를 실행 하는 것이 아니고
7.0.93에서 ffmpeg를 이용하여 동영상 파일의 thumbnail 추출 할때에는 문제가 없다는 것 입니다.
같은
p = Runtime.getRuntime().exec(cmd);
를 사용하는데 왜 hwp5html은 동작하지 않고 ffmpeg는 동작을 하는지 궁금합니다..

swish95의 이미지

각 라이브러리의 문제겠지요

hwp5html 이 tomcat 의 상위버젼에서만 동작하도록 되어 있는거고
ffmpeg은 해당 라이브러리가 없는 경우 하위 호환되는 함수를 이용하도록 했거나 그 차이 아닐까요 ^^

------------------------------------------------------------
ProgrammingHolic

kimgil419의 이미지

만약 문제가 버전문제라면 회사에서 사용중인 tomcat 버전을 교체 해야 하는 문제가 있어...
심각하게 고민중입니다..
말씀해주신 부분을 한번 확인해 봐야겠습니다.
감사합니다. !

kimgil419의 이미지

shell 파일로 만들어서 실행도 해보았습니다.
hwp5html --output=$1 $1.hwp
이렇게요 ..
cmd에서 직접 쉘파일을 실행 시켰을 때는 정상 작동 하였습니다.
Runtime().exec(쉘) 로 실행하니 오류 메세지 조차 띄우지 않고 작동을 안합니다.

Runtime().exec(쉘)로 간접실행 시켰을 경우에도 tomcat의 영향을 받는 것인지 어떻게 영향을 받는 것인지 궁금합니다.

혹시 답을 알고 계시는 분 계시다면 답글 달아주시면 감사하겠습니다..!!
(--)(__)(--) 꾸벅...

kimgil419의 이미지

String cmd = "/root/.local/bin/hwp5html --output="+outputPath+FileName+" "+outputPath+FileName+".hwp";
왜인지는 모르겠으나.. tomcat 7.0.93 에서는 이렇게 하니 작동하네요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.