installing xuggler java libraries in Tomcat on Linux - linux

I'm trying to install xuggler Java libraries in Tomcat (version 5.5) on fedora-release-7-3
Should I install the binaries available for download on xuggler website or build my own (http://www.xuggle.com/xuggler/downloads/build.jsp)?
I took the easy step first and installed the readymade binaries downloaded from http://www.xuggle.com/xuggler/downloads/ in usr/local/xuggler folder on my Linux server and then copied the jar files from share/java/jars folder to Tomcat's $CATALINA_HOME/shared/lib directory (as recommended by
http://wiki.xuggle.com/Frequently_Asked_Questions#I_get_an_.22UnsatisfiedLinkError.22_when_I_run_Xuggler-based_Applications_in_Tomcat
These are some 6 .jar files, including xuggle-xuggler.jar
After restarting Tomcat, I'm still getting "java.lang.UnsatisfiedLinkError: no xuggle-xuggler in java.library.path" exception when my Java code attempts to invoke some xuggler method such as the one to find video duration of an flv file.
What am I doing wrong? Any help is very much appreciated!

Make sure that Tomcat can see the environment variables you have to set up with XUGGLE. In particular LD_LIBRARY_PATH.

Putting the xuggle environmental variables in the startup.sh is probably one of easiest ways to get this going. Also don't forget to put the xuggle jar only in the shared / common lib or you may run into classloader issues when you attempt to use xuggler in multiple webapps.

Related

Finding the log4j.jar installed by rpm at client site and adding it to the classpath rather than including it in our rpm

Our company produces an rpm on red-hat Linux and there is a thought that we should redistribute as little 3rd party code as possible in our package. We are using log4j.jar and want to stop including it in our rpm, but instead have the log4j rpm installed at the client site. However, that means that my java program needs to know where the file is located so that I can import the file. Without knowing where the client installed the file, in case they installed it in a non-standard location, I cannot be sure it is on the classpath. Is there a standard way to determine that? Do rpm or yum have a command so that I can see where a specific file was installed or do I need our customer to tell me where it is so I can set the classpath value correctly? I can't just use the find command on their system to search their files. Any suggestions would be appreciated.
Thanks

How to properly install Ghostscript under Linux as shared library

The link on this page (https://www.ghostscript.com/download.html) for Linux x64, gets you a .tgz with an executable binary.
However, while trying to use this binary as an .so, (after renaming it into libgs.so and putting into appropriate place) via Ghost4J, I invariably get errors as follows:
java.lang.UnsatisfiedLinkError: /tmp/jna-100923095/jna3513656669313044092.tmp: cannot dynamically load executable
Once I install the Ghostscript via apt-get install ghostscript, the same code runs fine (as it now loads an .so from /usr/lib/x86_64-linux-gnu/libgs.so.9.22)
Question: which minimal set of files should I put to some folder, so that I could link to Ghostscript dynamic library (.so) successfully, without Ghostscript being installed on the machine/container?
UPD: under Windows, this seems to be possible, the /bin folder of the installation contains both DLL and EXE files; if I put that .dll file into a win32-x86-64 folder under resources, it is being picked up by JNA (via Ghost4j) and Ghostscript instance works fine, even once I remove the "official" installation). I would like to have same behaviour (i.e. self-sufficient, self-containing JAR file) for Linux as well.
Well, I ended up building the shared object myself, using Ubuntu 18.04 installed as WSL 1 distribution, following the guidelines from here: https://www.ghostscript.com/doc/current/Make.htm#Shared_object
These were the exact commands:
./configure --without-luratech --with-system-libtiff --with-drivers=PCLXL
make so
and then, in the sobin folder, you have libgs.so, that works as expected. But sad it's not possible to download it from the official site.

Is it possible to distribute and use .so files without having to install?

I have a .Net Core application which is to run on Ubuntu. With it I'm looking to distribute 2 .so files that the application depends upon. The app would load those libraries via a [DllImport("mylibrary")] attribute.
If I try to run my application as-is, it complains that it cannot find mylibrary. This is because the library doesn't exist in the search path. If I install the libraries via apt-get instead of distributing them, everything works (the libraries end up in /usr/lib/x86_64-linux-gnu/ which is part of my search path for libraries).
This isn't a very scalable solution. I want something that just "works" when running dotnet myapplication.dll without having to pre-install via apt-get (or otherwise) my .so files.
How can I get the library loader to work with my local .so files without requiring some extra step by the end user before running my application?
The idea of having the .Net Core application running some installation / bash commands upon startup to setup the environment sounded like a decent idea except it requires sudo. This isn't a deal-killer, but isn't terribly clean either.
Any ideas?

Jhipster 5.7 microservice failed to start on windows with error CreateProcess error=206, The filename or extension is too long

Jhipster 5.7 microservice failed to start on windows with error CreateProcess error=206, The filename or extension is too long
I have created a Jhipster micro service. when I am trying to start, I get error CreateProcess error=206, The filename or extension is too long.
All other questions are suggesting to reduce classpath or usning IntelliJ. None of them explained how. Here are few things I have trying:
Remove Unnecessary jar from classpath:
I have fresh Jhipsterap. I don't know which jar I can remove
without breaking it.
Use IntelliJ
I am running the service from command line.
Move your project or maven repo to "c:" drive to make path short.
I can't. The repo is huge and is being shared.
Let me know if there is any other solution for this problem.
Thanks
There is fairly simple way of reducing classpath on windows, if you can not move your local repo. Here is how:
Open command prompt and execute this command
mklink /J c:\repo C:\<long path to your maven repository>
This will create a link to your maven repository. Now run the service like this:
mvn -Dmaven.repo.local=c:\repo spring-boot:run
Thats all. Now your classpath will be reduced by around 10000 characters (tried for jhipster gateway app).
Good luck.
Forking is enabled by default since Spring Boot 2.2.
See Since 2.2.0 spring-boot-maven-plugin create 2 java process (may cause CreateProcess error=206). Need workaround to fix it question and solution

Freeswitch mod_java installation problem

I am trying to install mod_java on ubuntu.
I have installed the latest java(1.6).
I have configured freeswitch with mod_java module enabled in module.conf.xml
then when i run the make file, it says:
freeswitch_java.h:5:17: error: jni.h: No such file or directory
I have searched through the java installtion folders, but did not find any include folder or jni.h.
Can anyone help, what is being the problem here.
Thanks for reading this question.
I had the same problem. The solution was to run configure with the option --with-java:
./configure --with-java=/usr/lib/jvm/java-1.6.0-openjdk/include/
I don't know if it makes any difference but I added mod_java after building freeswitch without it. It was disabled in my initial build in module.conf.xml but afterwards I ran the above command plus:
make mod_java-install
It worked for me on ubuntu with openjdk. Are you using the Sun JDK? Maybe in the version you have dont have the include folder which has the source files. Try installing the other JDK. Or try and see of ther are some other related packages in apt that will get you the include folder.
Type this linux command to locate your jni.h file on your filesystem.
locate jni.h
you should be able to get it somewhere
in /usr/lib/java directory or some other directory
depending upon your java home.
copy paste the jni.h in src/include folder of your freeswitch src.
It will throw you some more errors for different .h files
just copy all of them to your src/include folder.
in latest freeswitch, installing through Makefile, its not possible to configure as the Makefile downloads and installs. Its possible by modifying the Makefile.in file to add the include path
mod_java_la_CPPFLAGS
-I/usr/lib/jvm/default-java/include \

Resources