如何在Windows中为Apache Tomcat配置xuggle

时间:2012-09-22 08:20:26

标签: windows tomcat xuggler

我一直在Windows平台上使用Netbeans和Tomcat开发视频共享Web应用程序(如youtube)。在那里,我想在视频上传后立即生成视频文件的缩略图。所以在网上搜索我发现了一个叫做Xuggle的东西。我在我的Tomcat的lib文件夹中安装了Xuggler。我已经设置了必要的环境变量。当我运行一个java应用程序时,我得到了结果,但是当我对Java Web应用程序执行相同操作时,我得到以下错误:

    HTTP Status 500 -

    type Exception report

    message

    description The server encountered an internal error () that prevented it from         

    fulfilling this request.

    exception

    javax.servlet.ServletException: Servlet execution threw an exception


 org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    root cause

 java.lang.UnsatisfiedLinkError: com.xuggle.xuggler.XugglerJNI.Global_NO_PTS_get()J
com.xuggle.xuggler.XugglerJNI.Global_NO_PTS_get(Native Method)
com.xuggle.xuggler.Global.<clinit>(Global.java:240)
xugglerPack.Main.<clinit>(Main.java:43)
xugglerPack.VT.processRequest(VT.java:86)
xugglerPack.VT.doPost(VT.java:137)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:3
  93)
   note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26   
 logs.

=============================================== ============================================

@ pd40&gt;&gt;&gt;我重新安装了Xuggler(这次是在C:\ Program Files中,我在安装后重启了我的电脑。我在环境变量中设置了以下内容:

XUGGLE_HOME = C:\ Program Files(x86)\ Xuggle

CLASSPATH = .; C:\ Apache Tomcat 6.0.26 \ Apache Tomcat 6.0.26 \ lib \ commons-cli.jar; C:\ Apache Tomcat 6.0.26 \ Apache Tomcat 6.0。 26 \ lib \ logback-classic.jar; C:\ Apache Tomcat 6.0.26 \ Apache Tomcat 6.0.26 \ lib \ logback-core.jar; C:\ Apache Tomcat 6.0.26 \ Apache Tomcat 6.0.26 \ lib \ slf4j-api.jar; C:\ Apache Tomcat 6.0.26 \ Apache Tomcat 6.0.26 \ lib \ xuggle-xuggler.jar; C:\ Apache Tomcat 6.0.26 \ Apache Tomcat 6.0.26 \ lib \ xuggle-xuggler- Test.jar的;

PATH = C:\ Program Files(x86)\ Xuggle \ bin; C:\ Apache Tomcat 6.0.26 \ Apache Tomcat 6.0.26 \ bin; C:\ Apache Tomcat 6.0.26 \ Apache Tomcat 6.0.26 \ lib; C:\ Program Files(x86)\ Xuggle \ lib

我已经在Tomcat的\ lib文件夹中复制了Xuggle / java / jars(6个jar文件)的jar并设置了它们的CLASSPATH。

现在,当我在Web应用程序中执行此操作时仍然遇到问题,但独立的Java应用程序可以很好地生成图像。怎么了?当我上传视频时,它上传了但是没有生成缩略图,我收到以下错误......

  HTTP Status 500 -

  type Exception report

  message

  description The server encountered an internal error () that prevented it from     
  fulfilling this request.

  exception

  javax.servlet.ServletException: Servlet execution threw an exception
  root cause

  java.lang.NoClassDefFoundError: Could not initialize class com.xuggle.ferry.FerryJNI
  com.xuggle.ferry.RefCounted.acquire(RefCounted.java:179)
  com.xuggle.xuggler.IContainer.copyReference(IContainer.java:80)
  com.xuggle.mediatool.AMediaCoderMixin.<init>(AMediaCoderMixin.java:68)
  com.xuggle.mediatool.MediaReader.<init>(MediaReader.java:137)
  com.xuggle.mediatool.ToolFactory.makeReader(ToolFactory.java:77)
  xugglerPack.Main.main(Main.java:51)
  xugglerPack.VT.processRequest(VT.java:87)
  xugglerPack.VT.doPost(VT.java:135)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26    
  logs.

1 个答案:

答案 0 :(得分:0)

确保将Xuggler lib放在Windows PATH LD_LIBRARY_PATH 中。

Tomcat native相似。我猜你已经尝试过了。

您可能还想查看this thread