Jyotirmoy
Jyotirmoy

Reputation: 51

How to configure xuggle for Apache Tomcat in Windows

I have been developing a video sharing web application (like youtube) using Netbeans with Tomcat on Windows platform. There I want to generate thumbnail images of video files as soon as the videos get uploaded. So searching the net I found something called Xuggle. I installed Xuggler in my Tomcat's lib folder. I have set the necessary environment variables. When I run just a java application I get the results, but when I do the same with a Java web application I get the following errors:

    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 >>> I reinstalled Xuggler ( this time in C:\Program Files , I restarted my PC after installation . I set the following in my environment variables :

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

I have copied the jars of Xuggle/java/jars (6 jar files) in The Tomcat's\lib folder and set the CLASSPATH of them.

Now I still get the problem when i do this in a web application , but standalone java application generates the images nicely. What is going wrong ??? When i upload a video it gets uploaded but the thumbnail images are not generated , I get the following error...

  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.

Upvotes: 1

Views: 1249

Answers (1)

pd40
pd40

Reputation: 3257

Make sure you put Xuggler lib in your windows PATH or LD_LIBRARY_PATH.

Similar to Tomcat native. I assume you have tried this.

You might also want to check out this thread

Upvotes: 1

Related Questions