I'm trying to use the weka.classifiers.functions.MultilayerPerceptron as classifier on Weka using IKVM.NET but I keep getting the following exception:
"Could not load file or assembly 'IKVM.OpenJDK.SwingAWT, Version=7.0.4335.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58' or one of its dependencies. The system cannot find the file specified."
I referenced every IKVM assembly I found on the IKVM folder, including IKVM.OpenJDK.SwingAWT, it's a very simple code:
var classifier = new weka.classifiers.functions.MultilayerPerceptron();
classifier.setOptions(weka.core.Utils.splitOptions("weka.classifiers.functions.MultilayerPerceptron -L 0.7 -M 0.3 -N 75 -V 0 -S 0 -E 20 -H a"));
And the exception is thrown whenever the first line is run, if I create another classifier, like NaiveBayes for instance, it works just well.
Does anyone knows anything I could try to fix this problem?
Thanks in advance!
the culprit turned out to be the class library, I had a class library called IA which stored all the weka stuff, and inside it I had a class called Analyzer which was trying to invoke the MultiLayerPerceptron classifier, so I "decorated" the class with a [MTAThread()] attribute and it is working now
Related
First of all please keep in mind that I am just discovering how "things" work in the DevOps world and my knowledge is pretty limited - especially in scripting (PS and C#).
So I have to figure it out how to set up some Javascript unit tests for an app - specifically to get the "Test Results Analyzer" widget up and running on the Jenkins website.
I am currently recycling code from another Jenkins pipeline (def) and using the already existing "run unit tests" stage in the makefile.include of the project which (from what the main Dev of the project told me) it never worked - was never tested - to try and make the tests run.
I thought the best way (without breaking anything on the main app) is to test locally via cygwin.
I have mapped the project as a workspace in Perforce and tried to run the command from the makefile.include
$ make runRoutingPlannerCSTests
Which is working about half way and after it prompts me with some missing files errors which I was not able to find anywhere on my local project folder.
CSC : error CS0006: Metadata file 'D:\src\project\ServicePlanning\BackendAPI\Comtec.Portal.OSPBackend.ApiModel\bin\Release\Comtec.Portnd [D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests\Comtec.ServicePlanning
CSC : error CS0006: Metadata file 'D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Frontend.RoutingPlannngPlanner.dll' could not be found [D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Frontend.RoutingPlanntingPlanner.Tests.csproj]
CSC : error CS0006: Metadata file 'D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Frontend.RoutingPlannFrontend.RoutingPlanner.Model.dll' could not be found [D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Flanning.Frontend.RoutingPlanner.Tests.csproj]
Makefile.include:121: recipe for target `buildRoutingPlannerCSTests' failed
make: *** [buildRoutingPlannerCSTests] Error 1
and also
$ make runTests
Which gets stuck somewhere after running the Specrunner.html
######################################################
# run unit tests
######################################################
runTests: runRoutingPlannerJasmineTests runRoutingPlannerCSTests
runRoutingPlannerJasmineTests:
$(RoutingPlanner_TESTS_UTILITIES_DIR)/bin/phantomjs.exe $(RoutingPlanner_TESTS_DIR)/Scripts/jasmine.js $(RoutingPlanner_TESTS_DIR)/jsTests/SpecRunner.html
buildRoutingPlannerCSTests:
$(MSBUILD) `cygpath -a -w $(RoutingPlanner_TESTS_DIR)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests.csproj` $(MSBUILD_OPTIONS) /t:Build /property:Configuration=$(VS_CONFIG) /fileloggerparameters:LogFile=`cygpath -a -w $(RoutingPlanner_TESTS_DIR)/Comtec.ServicePlanning.Tests-Build-$(VS_CONFIG).log`
runRoutingPlannerCSTests: buildRoutingPlannerCSTests
#rm -f '$(shell cygpath -aw '$(RoutingPlanner_TESTS_DIR)/bin/$(VS_CONFIG)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests.trx')'
$(DOTNET_UNIT_MSTEST) /nologo '/testcontainer:$(shell cygpath -aw '$(RoutingPlanner_TESTS_DIR)/bin/$(VS_CONFIG)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests.dll')' '/resultsfile:$(shell cygpath -aw '$(RoutingPlanner_TESTS_DIR)/bin/$(VS_CONFIG)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests.trx')'
This section has an additional section at the begging of the script where the paths have been added.
RoutingPlanner_FRONTEND_API_DIR ?= $(RoutingPlanner_FRONTEND_DIR)/Comtec.ServicePlanning.Frontend.RoutingPlanner
RoutingPlanner_TESTS_DIR = $(RoutingPlanner_FRONTEND_DIR)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests
RoutingPlanner_TESTS_UTILITIES_DIR = $(RoutingPlanner_TESTS_DIR)/Utilities/phantomjs-2.0.0-windows
RoutingPlanner_UTILITIES_DIR = $(PREPARESETUPDIR)/RoutingPlannerPortalUtilities
To be honest I am not even sure if I am following the right path to this since the steps I have found on the internet are different from what I found in the project and what I believe should be done.
For example: https://wiki.jenkins.io/display/JENKINS/Test+Results+Analyzer+Plugin
Mainly I believe this might be a simple "wrong path" issue but since my scripting skills are close to zero I am not sure what to modify and where.
I do not expect the solution at hand but I would really like to understand what the issues is or the proper way to actually make this work.
Thank you in advance.
I am using a single branch pipeline for a project, currently I am getting this error.
[xUnit.net 00:00:03.0095238] System.TypeInitializationException : The type initializer for 'System.DrawingCore.GDIPlus' threw an exception.
[xUnit.net 00:00:03.0097048] ---- System.DllNotFoundException : Unable to load DLL 'gdiplus.dll': The specified module could not be found.
Whenever I run the same unit tests locally they all pass, however when going through jenkins it is unable to load the gdiplus.dll I am at a loss because I have no idea why this is behaving this way. Has anyone encountered something similar? How can I add the DLL manually?
If anyone has this issue, the best way to solve this is to install the gdiplus in your docker container. However even after you have installed the docker container you will still have this error because Linus in its infinite wisdom is looking for gdiplus.dll not libgdiplus.so so there is a need to link it.........
Here is a link to where I found the solution after hours of searching
https://en.code-bude.net/2017/05/08/net-core-gdiplus-dll-not-found-in-linux/
This is the code I used and it is working
apt-get install -y libgdiplus \
&& cd /usr/lib ln -s libgdiplus.so gdiplus.dll
I'm new to linux and mono. I installed mono to a new Raspberry Pi machine using
sudo apt-get install mono-complete.
I also did the update and upgrade using apt-get.
I then followed the helloWorld examples in the Mono Basics page in mono-project website:
http://www.mono-project.com/docs/getting-started/mono-basics/
I managed to build and run the first 'Console Hello World' example using the following:
mcs hello.cs
mono hello.exe
However, when I tried the next example 'Winforms Hello World', I encountered the following error when running 'mcs hello.cs -pkg:dotnet':
error CS0006: Metadata file 'cscompmgd.dll' could not be found
However, it works if i use gmcs instead of mcs.
I googled here and there but no luck.
I can find a link to this file 'cscompmgd.dll' in '/usr/lib/mono/2.0' directory in my Raspberry Pi.
The installed mono version is 3.2.8 (returned by using 'mono --version').
Does anyone know why it works with gmcs but it doesn't work with mcs?
Thank you.
Solved by adding the -lib: option like this:
mcs helloWinforms.cs -pkg:dotnet -lib:/usr/lib/mono/2.0
Solution with adding
-lib:/usr/lib/mono/2.0
was not the best in my case (it broke a dependency on some 4.0 elements, specifically 'System.Threading').
Dirty, but works
Another, very dirty solution is to copy the
/usr/lib/mono/2.0/cscompmgd.dll
to your project folder (or wherever the Makefile is) and add
-r:cscompmgd.dll
when compiling (or add the filename after list of other included libraries specified by '-r').
There is probably a way to do that without copying the file, but that is beyond my capabilities.
So you end up with:
mcs helloWinforms.cs -pkg:dotnet -r:cscompmgd.dll
I am trying to build SparkleShare on Mac.
I have Mac OS 10.6
SparkleShare claims to run on Snow Leopard (10.6) or later
SparkleShare contains calls to NSUserNotification, a class which is Available in OS X v10.8 and later
Monodevelop throws an error:
error CS0246: The type or namespace name `NSUserNotification' could not be found. Are you missing a using directive or an assembly reference?
In Monodevelop, when I begin typing MonoMac.Foundation.NSUser, the only suggested item is NSUserDefaults, NSUserNotification is not suggested.
Is this kind of cross-compilation possible?
I can't upgrade to 10.8 because I also want to check how the user experience is on 10.6.
Run:
git clone https://github.com/mono/monomac
git clone https://github.com/mono/maccore
cd monomac
make
It should generate MonoMac.dll. Copy it to wherever your MonoMac.dll is, restart Monodevelop, the project should now build fine.
I just had a look at MonoMac's source code, and NSUserNotification is a recent addition, it has been added three months ago: https://github.com/mono/monomac/commit/2c4a8c639254705e0dde1ce32f4e49cfcb72187e.
These are the generated files:
NSUserNotification.g.cs
NSUserNotificationCenter.g.cs
NSUserNotificationActivationType
NSUserNotificationCenterDelegate.g.cs
As a workaround for older MonoMac versions, you can simply copy these into your code.
I used IKVM to convert slf4j to dll's for use in a c# program. It's throwing me an exception. (NoClassDefFoundError was unhandled org.slf4j.LoggerFactory)
The code is as follows
acceptor = new SocketAcceptor();
connectionHandler = new ConnectionHandler();
serverlistenerPort = 32156;
SocketAcceptorConfig sac = new SocketAcceptorConfig();
sac.getSessionConfig().setTcpNoDelay(false);
sac.setReuseAddress(true);
sac.setBacklog(100);
//The following line is what seems to hate me.
acceptor.bind(new InetSocketAddress(serverlistenerPort), connectionHandler, sac);
Connection Handler is a class I have that overrides IoHandler(a mina class) I have triple checked that I have all the IKVM dll's referenced, and I've searched every possible combination of terms on Google for a solution, but when all the solutions are for Java and they just need to reference .jar files. I'm certain I have all the .dll's referenced (This works as a java program using jars)
I had the same issue. I used this command to get the dll compiled:
ikvmc -sharedclassloader file1.jar ...... file8.jar
should be OK for what I've read, shouldn't it?
And then used this to get the dll into the global cache:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\x64> gacutil -i "C:\ikvm-7.1.4532.2\bin\IKVM.OpenJDK.Core.dll"
and same command to put all the partial libraries needed