How to configure xuggle for Apache Tomcat in Windows - 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.

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

Related

Could not find agent library jdwp:transport on the library path

How to run tomcat with debug from idea on mac, getting error:
/Users/konrad/Applications/apache-tomcat-9.0.12/bin/catalina.sh run
[2018-10-25 01:56:13,230] Artifact Gradle : com.test : MyService.war: Waiting for server connection to start artifact deployment...
Error occurred during initialization of VM
Could not find agent library jdwp:transport on the library path, with error: dlopen(libjdwp:transport.dylib, 1): image not found
Disconnected from server
VM options:
-DprofileName=dev -agentlib:jdwp:transport=dt_socket,server=y,address=8000, suspend=n
I'm using InteliJ and Tomcat 9 with debug on Mac

Spring-Boot template resolution fails when WAR is deployed

My Spring-Boot app works fine when running it via the Eclipse IDE (with S.T.S. 3.8.4 installed), with the embedded tomcat server.
I packaged it as a WAR and deployed it to a local Tomcat server.
When accessing the app, a blank page is returned. I discovered the exception in the Tomcat logs (on Windows, C:\<path-to-tomcat>\logs) An exception is thrown when trying to resolve the Thymeleaf templates:
2017-04-04 12:33:36.602 ERROR 5724 --- [io-12080-exec-7] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-12080-exec-7] Exception processing template "home": Error resolving template "common/layout", template might not exist or might not be accessible by any of the configured Template Resolvers (template: "home" - line 5, col 7)
org.thymeleaf.exceptions.TemplateInputException: Error resolving template "common/layout", template might not exist or might not be accessible by any of the configured Template Resolvers (template: "home" - line 5, col 7)
at org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:865) ~[thymeleaf-3.0.2.RELEASE.jar:3.0.2.RELEASE]
The problem was the casing of the folder names.
I had my layout fragment in templates/Common/layout.html (notice the capital C in Common) and in my views was referencing common/layout, which worked within the IDE, but did not work when deploying a WAR on a Tomcat server. Maybe because the IDE ignores casing, and Tomcat is case sensitive?
It worked after changing the reference in my view to the correct casing of the folder, Common/layout

wso2 esb deploy failed on windows

I'm using WSO2 ESB 4.8.1 with JDK 1.7.0_67 x64 on windows 7 x64.
I'm deploying carbon application(.car) using any method:
maven car deploy plugin
web admin console
CarbonAppUploader web service
First deployment succeeds but log file contains:
CarbonAppUploader temp file: C:\Java\WSO2ES~1.1\bin\..\tmp\carbonappsuploads\first-esb_1.0.0.car deletion failed, scheduled deletion on server exit.
Second deployment of same car (name and version) fails with exception in logs (see below)
I Apologize for localized error message but generally it says cant overwrite this file.
If you check, it's actually locked for deletion. Looks like CarbonAppUploader class didn't properly close InputStream.
Strangely enough this bug is not reproducible in unix (centos)
Question to WSO2: do you plan to fix that?
Question to all: Did you meet such bug and how did you solve it?
exception stack trace (partially)
TID: [0] [ESB] [2014-08-18 22:04:58,254] ERROR {org.wso2.carbon.application.upload.CarbonAppUploader} - Error occurred while uploading Carbon App artifacts {org.wso2.carbon.application.upload.CarbonAppUploader}
java.io.FileNotFoundException: C:\Java\WSO2ES~1.1\bin\..\tmp\carbonappsuploads\first-esb_1.0.0.car (Запрошенную операцию нельзя выполнить для файла с открытой пользователем сопоставленной секцией)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
at org.wso2.carbon.application.upload.CarbonAppUploader.writeResource(CarbonAppUploader.java:78)
at org.wso2.carbon.application.upload.CarbonAppUploader.uploadApp(CarbonAppUploader.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
I checked out source code from svn, fixed bug myself. If anybody experiencing same issue, you may download sources and compiled jar from https://wso2.org/jira/browse/ESBJAVA-3272
Hopefully this bug fix will be included in next releases

Weblogic deployment error

I have deployed ear files in oracle weblogic server and i also configured datasource for that project. When i try to test it it is giving me this error.
"Message icon - Error weblogic.application.ModuleException: :org.springframework.beans.factory.BeanDefinitionStoreException:Invalid bean definition with name 'userContext' defined in class path resource [voyager-seats-usercontext.xml]: Could not resolve placeholder 'IDM.USERNAME'
Message icon - Warning Errors were encountered while performing this operation."
I restarted and reconfigured this app still it is giving error.

Tomcat7 running on windows

I have a folder with Tomcat7 installed on my disk that I use to do some tests on my web application running it from eclipse and it I works well. When I try to deploy the application on a stand alone tomcat server it gives an error: (I'm using windows)
Fev 08, 2012 9:10:04 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet Process
java.lang.NullPointerException
at hs.server.CommandFactory.<init>(CommandFactory.java:27)
at hs.server.Process.init(Process.java:40)
and the line 27 is in this context:
19-String pathname = "/"+packageName.replace(".", "/")+"/";
20 //String pathname = packageName.replace(".", "/");
21- URL resource = loader.getResource(pathname);
22- File commandDir = (new File(resource.getFile()));
23-
24- //File commandDir = new File(loader.getResource(packageName.replace(".", 25-"/")).getFile());
26-
27- for(String classFilepath: commandDir.list()) {
I guess is something about the URL but the problem is that I'm running it without any problems on the tomcat instance on eclipse. Thank you
File.list() will return null if File represents a non-existent directory. This null will then cause your for loop to throw a null-pointer exception.
You need to make your code defensive, and check that the directory exists using the methods on File before you attempt to read it.

Resources