java.lang.Exception: java.lang.UnsatisfiedLinkError: - java

While executing my Hadoop application, I am getting the following error:
java.lang.Exception: java.lang.UnsatisfiedLinkError: /tmp/javacpp5024882630141562/libjniopencv_core.so: libopencv_core.so.2.3: cannot open shared object file: No such file or directory
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:399)
Caused by: java.lang.UnsatisfiedLinkError: /tmp/javacpp5024882630141562/libjniopencv_core.so: libopencv_core.so.2.3: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1957)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1882)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1843)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1061)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:422)
at com.googlecode.javacpp.Loader.load(Loader.java:372)
at com.googlecode.javacpp.Loader.load(Loader.java:319)
at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:136)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at com.googlecode.javacpp.Loader.load(Loader.java:338)
at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:97)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at com.googlecode.javacpp.Loader.load(Loader.java:338)
at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:85)
at com.googlecode.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:169)
at HFD.videoprocessing.utils.VideoRecordReader.initialize(VideoRecordReader.java:58)
at HFD.videoprocessing.utils.VideoInputFormat.createRecordReader(VideoInputFormat.java:30)
at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.<init>(MapTask.java:456)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:698)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:333)
at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:231)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Any help?

try the following :
1) run sudo ldconfig and check if that works.
if above does not works
2) open the file /etc/ld.so.conf.d/opencv.conf and insert the following in it
/usr/local/opencv/
then type: sudo ldconfig
if you can't find opencv.conf try locate opencv.conf to find it in your system

Related

When I run k-Means by Mahout,always show this tip

code:
hadoop jar /home/xnz/local/opt/apache-mahout-distribution-0.13.0/mahout-integration-0.13.0.jar \
org.apache.mahout.clustering.conversion.InputDriver \
-i /user/root/ -o /user/root/input/seqfile
error tip:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/cli2/OptionException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:278)
at org.apache.hadoop.util.RunJar.run(RunJar.java:214)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.cli2.OptionException
at java.net.URLClassLoader$1.run(URLClassLoader.java:359)
at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
at java.lang.ClassLoader.loadClass(ClassLoader.java:430)
at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
...4 more
``
It is clear from the exception. You are missing the org.apache.commons.cli2 Jar in your Classpath.

Error when installing git-plugin on jenkins

I'm trying to install git-plugin on jenkins.
I've installed all the dependencies that are needed for git-plugin.
But I'm still getting the file not found exception.
Please help me solve this error
java.io.FileNotFoundException: http://archives.jenkins-ci.org/plugins/git/3.6.3/git.hpi
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1872)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2982)
at java.net.URLConnection.getHeaderFieldLong(URLConnection.java:629)
at java.net.URLConnection.getContentLengthLong(URLConnection.java:501)
at java.net.URLConnection.getContentLength(URLConnection.java:485)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1126)
Caused: java.io.FileNotFoundException: http://archives.jenkins-ci.org/plugins/git/3.6.3/git.hpi
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1926)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1921)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1920)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1490)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1139)
Caused: java.io.IOException: Failed to load http://updates.jenkins-ci.org/download/plugins/git/3.6.3/git.hpi to /var/lib/jenkins/plugins/git.jpi.tmp
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1146)
Caused: hudson.util.IOException2: Failed to download from http://updates.jenkins-ci.org/download/plugins/git/3.6.3/git.hpi (redirected to: http://archives.jenkins-ci.org/plugins/git/3.6.3/git.hpi)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1172)
at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1677)
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1874)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1651)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
at java.lang.Thread.run(Thread.java:748)

RMI server call throws java.lang.ClassNotFoundException: compute.Compute [duplicate]

This question already has an answer here:
Is it necessary/important to set a classpath in the RMI registry?
(1 answer)
Closed 8 years ago.
I am trying lo learn RMI by following the Oracle documentation for RMI
I have created the classes for server side and client side, the class details are as follows:
compute.Compute -- Remote interface
compute.Task -- Normal interface
engine.ComputeEngine -- Class that implements remote interface
The code details can be seem from the document at these links:
http://docs.oracle.com/javase/tutorial/rmi/designing.html
http://docs.oracle.com/javase/tutorial/rmi/implementing.html
I have followed the steps given in below link to compile the code, all I am doing these are on my machine which has Ubuntu OS.
http://docs.oracle.com/javase/tutorial/rmi/compiling.html
Now as per below link I have placed the policy files for client and server at path : /home/user/public_html
http://docs.oracle.com/javase/tutorial/rmi/running.html
one more difference is I have tomcat server so I placed the class files under Tomcat webapps and under my web application, so I am running the class using the command:
java -cp /home/user/src:. -Djava.rmi.server.codebase=http://myipaddress:8080/myapp/classes/compute.jar -Djava.rmi.server.hostname=myipaddress -Djava.security.policy=server.policy engine.ComputeEngine
Now when I run this application I am getting exception as:
ComputeEngine exception:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: compute.Compute
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:419)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:378)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at engine.ComputeEngine.main(ComputeEngine.java:31)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: compute.Compute
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: compute.Compute
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.rmi.server.LoaderHandler$Loader.loadClass(LoaderHandler.java:1206)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at sun.rmi.server.LoaderHandler.loadClassForName(LoaderHandler.java:1219)
at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:729)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:673)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:610)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:646)
at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:311)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:255)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1558)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1e exce514)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
... 13 more
The exception says java.lang.ClassNotFoundException: compute.Compute. But I have the class file in compute.jar that is located at my path /home/user/src and also I can download it using URL at http://myipaddress:8080/myapp/classes/compute.jar
Also FYI, I am doing all the steps on my machine only without any separate client and server machines.
Can someone please help me how can I fix this issue? Please let me know if you need any further details so I can provide them.
Update:
I followed the asnwer given by #EJP at this post - Is it necessary/important to set a classpath in the RMI registry?
then I started rmiregistry from directory where I have the jar file that has Compute.class and then ran the below command:
java -cp /home/user/src:/home/user/public_html/classes/compute.jar -Djava.rmi.server.codebase=http://myipaddress:8080/myapp/classes/compute.jar -Djava.rmi.server.hostname=myipaddress -Djava.security.policy=server.policy engine.ComputeEngine
But still I am getting same exception.
That class isn't on the Registry's CLASSPATH.

Could not connect to SQL Database using SQuirrelSQL

I encounter the following error when trying to connect to a database using SQuirreLSQL.
Error :
Unexpected Error occured attempting to open an SQL connection
Stacktrace :
java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:202)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:175)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104)
... 5 more
Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at net.sourceforge.squirrel_sql.fw.util.MyURLClassLoader.findClass(MyURLClassLoader.java:209)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:128)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)
... 7 more
I also tried to check Driver Properties and the following error is displayed :
Loading JDBC driver "Microsoft MSSQL Server JDBC Driver" failed.
Can not load driver properties tab.
You need to copy driver into squirrel-sql/lib folder.
I've had same issue with MySql driver.
After copied drived into:
$HOME/squirrel-sql-3.7/lib/mysql-connector-java-3.0.17-ga-bin.jar
and restart Squirrel - there was no error anymore.

Tomcat can't start the app because it can't find JSONRPC2ParseException class

I have application in /var/lib/tomcat7/webapps/code I have init.java file that use json-rpc-2.0
I compile it using:
export CLASSPATH=$CLASSPATH:/path/jsonrpc2-base-1.35.jar:/path/json-smart-1.2.jar
javac init.java
it compile but when I run the app (not the servlet) I got error 404 from Tomcat and in catalina.out file there is exception:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngin
e[Catalina].StandardHost[localhost].StandardContext[/code]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:87
7)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav
a:1114)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig
.java:1673)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.NoClassDefFoundError: com/thetransactioncompany/jsonrpc2/JSONRPC2ParseException
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2387)
at java.lang.Class.getDeclaredFields(Class.java:1796)
at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:140)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:67)
at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:405)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more
Caused by: java.lang.ClassNotFoundException: com.thetransactioncompany.jsonrpc2.JSONRPC2ParseException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 25 more
with caused by not found com/thetransactioncompany/jsonrpc2/JSONRPC2ParseException which is in jar file.
What's happening here? How can I fix it to make it work?
This is usually the jar files are not available for Tomcat.
The best way to solve this is place the json-rpc-2.0 jar files into your Tomcat's lib folder
Update
As specified by A4L user , you can also put the jar in your web applications WEB-INF/lib as well.

Categories