Add lacking libraries to Processing? ( com.sun.tools ) - java

I'm currently writing a library and I want to do some stuff including com.sun.tools.attach.VirtualMachine however in testing I got a NoClassDefError. With a little research I found the following cause:
Processing simply doesn't have com.sun.tools on it's class-path.
I am currently trying to patch it up with a jar file from my java installation (jrt-fs.jar) however it didn't work.
Is it possible to patch up Processing so I can access com.sun.tools?

Related

opencv 3.2.0 java Face Recognition Ubuntu

i am using opencv 3.2.0 and im trying to get the face recognition up and running.
I am faced with the problem that the Face class in org.opencv.face.Face being empty. This is all contained in the file :
//
// This file is auto-generated. Please don't modify it!
//
package org.opencv.face;
public class Face {
}
From what i have read i need to add 'java' to the CMakeLists.txt of Face contrib module in order to add it to the final jar such as
ocv_define_module(face opencv_core opencv_imgproc opencv_objdetect WRAP python java)
In order to tell the compiler to include the contrib modules i have to add
-D
OPENCV_EXTRA_MODULES_PATH=$YOUR_OPENCV_CONTRIB_PATH/opencv_contrib-
3.2.0/modules
to the cmake command , and later make it , in general my commands are as follows
1: cmake
2: make -j5
I get no errors when compiling and building and i get my jar,
which i use without issues for face detection and so forth.
The problem is that the Face class is empty and i cannot create a FaceRecognizer.
i was following this guide here
https://github.com/andreaiacono/OpenCVDemo - as of 01.06.2017
and in the org.opencv.demo.core.RecognizerFactory class he uses
return Face.createFisherFaceRecognizer();
which as it seems i can not use.
I tried to search if the 3.2.0 libraries have a different way of creating a recognizer but google is not very helpful as there are just a handful of answers to any java opencv related issues.
What could be causing the Face class to be empty and/or are there any other ways to create recognizers in case that 3.2.0 indeed works differently ?
Thank you for the time
I have found an answer to my previous question and i am posting it for all to see , i hope i could help some other lost soul like myself.
I have tested with version 3.1.0 and it would appear that the Face class is NOT empty. Proving that Face detection in 3.2.0 may not be implemented properly (as of the time of writing).
I faced issues with compiling properly due to usage of some libraries :
/usr/include/c++/6.1.1/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
An answer i found to this issue was found in https://github.com/opencv/opencv/issues/6517#issuecomment-219219767
namely to include this in the cmake :
cmake -DENABLE_PRECOMPILED_HEADERS=OFF
This allowed me to compile everything properly and i managed to get my face recognition code up and running :)
Good luck to all

Business Objects 'bcm.jar' error when exporting Java app

I have been working on creating a simple Java desktop app using the RESTful API for Business Objects and have run into an issue. Whenever I run my app in Eclipse in works fine; whenever I export it as a 'Runnable Jar' and select the Library handling option 'Package required libraries into generated JAR' it works fine. However, whenever I try to export it using the Library handling option 'Extract required libraries into generated JAR' I get the following error after running the app:
java.lang.NoClassDefFoundError: Could not initialize class com.businessobjects.bcm.BCM
I have the 'bcm.jar' file added under a 'res' Source Folder and have it added to the Build Path. At one point I added all the JARs under the 'SAP BusinessObjects' java folder, and external folder, but it still throws the error. The problem stems from this line of code:
enterpriseSession = CrystalEnterprise.getSessionMgr().logon(userID, password, CMS, auth);
Would anyone know why I am getting said error? I really want to use the Extract option as it will improve performance as my app becomes larger. Any help resolving this issue would be greatly appreciated :)
EDIT: I would be happy to provide clarification or further detail upon request!
Seems this was introduced in SP04 and SAP has no intent of fixing it as the RESTful API wasn't designed to be used with Desktop apps.
Have you included the cryptojFIPS.jar? Leaving it out can cause the error.

Error: Could not find or load main class edu.stanford.nlp.pipeline.StanfordCoreNLPServer

I am trying to run built in server by following the guide as explained here (http://stanfordnlp.github.io/CoreNLP/corenlp-server.html) but I am seeing the error as I stated in the title.
There are 2 questions asked before related with starting built-in server but they were asked before release 3.6.0.
So I am expecting the built-in server will work properly as explained in the guide.
Am I doing something wrong?
Or do I need to download the code and compile as explained in other questions ?
There is no StanfordCoreNLPServer.jar file or something like this in the full download zip file (http://stanfordnlp.github.io/CoreNLP/download.html)
I tried to create classpath definition with full path. (in windows)

Javassist Runtime Error with msgpack-java

I am trying to use messagepack to send data back and forth between an Arduino and a Java application, and I am having trouble setting up the java implementation of messagepack: msgpack-java (https://github.com/msgpack/msgpack-java/wiki/QuickStart).
I wanted to avoid building the entire library myself, so I used v0.6.8 from here.
The sample code compiles successfully but at runtime I get
java.lang.NoClassDefFoundError: javassist/ClassPath
specifically at the line
MessagePack msgpack = new MessagePack();
I tried just building the msgpack jar myself, but I got compile errors on the source code because it is missing javassist packages. I do not know where to get the correct packages, and unfortunately the developers don't mention that in the documentation. I couldn't find a comments section on their page so I was hoping that someone on here could help me get msgpack working.
I also looked at this question (Using MessagePack with Android) but it was not really clear about where I can get the libraries I need.
I guess this was a fairly obvious question but I'll answer it here in case anybody else is having troubles like me. I ended up learning about the dependencies I needed by looking at the Maven POM file. This file told me that I needed the json-simple library and the javassist library. I just downloaded the .jar files for these two libraries and added them to the eclipse build path and everything ran just fine.
As an alternative, consider sirbrialliance's stripped-down static implementation: https://bitbucket.org/sirbrialliance/msgpack-java-lite
This is a bit better documented and easier to set-up initially.

org.apache.axiom.om.util.AXIOMUtil cannot be resolved

I'm trying to generate some stubs for a WSDL (using xmlbeans) and keep running into some issues. I'm using the following page:
http://axis.apache.org/axis2/java/core/docs/userguide-creatingclients-xmlbeans.html
The only part of these steps that I'm skipping is the "client.java" part because I already have another project ready I want to plug the resulting jars into. A quick run down of my steps are as follows:
My WSDL is a crmonline instance, so I run something like this:
C:\Work\aaa2>WSDL2Java -uri
https://mycrmorgname.crm.dynamics.com/XRMServices/2011/Organization.svc?wsdl
-p crmsdk -d xmlbeans -s -o c:\mystubfolder
I build the project using "ant"
In my "client" project I reference the 2 jars created in .\build\lib
My project builds fine once I add all my axis2 / apache references etc, but when I launch it through playframework I get errors when I hit the first page. The first error seems to be:
17:48:45,289 ERROR ~ Error in ControllersEnhancer.
controllers.ProfileController.editProfile has not been properly enhanced
(fieldAccess javassist.expr.FieldAccess#212ca458).
or something similar to that. Scrolling down through the error I can see that I'm getting this:
The file /app/models/MyDynamicsClient.java could not be compiled.
Error raised is : org.apache.axiom.om.util.AXIOMUtil cannot be resolved
Now, I haven't even hit any of my web services yet, or even instantiated any of my classes ... I'm at a loss as to why this is happening. Or to be more accurate, what exactly am I messing up! Am I missing a reference to something? Doing a search on AXIOMUtil tells me this should be in Axiom-api (version I have is Axiom-api-1.2.10.jar). I have this referenced and doesn't seem to help. Or maybe I'm doing something else wrong someplace?
Some details on versions:
Axis2 1.5.4
Apache-ant 1.8.3
Any help would be very much appreciated!!
Ok, after trying a lot of different things and rereading the sites/instructions I realised what I was doing wrong. Or at least I figured out a couple of things that I started to do differently that fixed the problem.
Firstly, I was using jar files from another sample project for the apache http components. I don't know if this had an impact, but I downloaded a fresh version of this anyway and referenced those JARS instead.
Also, instead of creating jars in my "stub" project and referencing those I copied all the generated stubs/classes directly into the existing client project. I have a feeling this might have been what fixed my problem. Or maybe a mix of this and the previous step I did!
So my new steps are as follows:
Ensure you have all the correct versions downloaded for required components. In my case I have the following:
Apache Axis 2 v 1.5.4
Apache HTTP components client 4.1.3
Apache-ant 1.8.3
Copy all the JARS from the Axis2 and HTTP Components libs into your client project and reference them.
Use WSDL2Java to create your stubs and classes within it's own project.
Ensure the project builds using Ant
Copy all the generated class files within the src folder into the source folder of your client.
Fix any other reference isssues and Build
Thankfully this got me going.

Categories