2012-09-22 57 views
1

我一直在開發Windows平臺上使用Netbeans和Tomcat的視頻共享Web應用程序(如youtube)。我想在視頻上傳後立即生成視頻文件的縮略圖。所以在網上搜索我找到了一個叫做Xuggle的東西。我在我的Tomcat的lib文件夾中安裝了Xuggler。我已經設置了必要的環境變量。當我運行一個Java應用程序,我得到的結果,但是當我做同樣的Java Web應用程序,我得到了以下錯誤:如何在Windows中爲Apache Tomcat配置xuggle

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 >>>我重新安裝了Xuggler(這次在C:\ Program Files,I 。重新啓動我的電腦安裝後,我設置我的環境變量如下:

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. 

回答

0

確保將Xuggler LIB在Windows PATHLD_LIBRARY_PATH

類似於Tomcat native。我假設你已經嘗試過。

您可能也想看看this thread

+1

@ PD40謝謝你看進我的快速時間問題。請查看我的問題的編輯版本。我想我已經能夠向你描述我的問題情況,並且我希望能從你那裏得到有用的解決方案。 –