Fact++ JNI java.lang.UnsatisfiedLinkError: FaCTPlusPlus.initMethodsFieldsIDs()V exception - owl-api

I wanted to use Fact++ via OWL API. I tried to use libFaCTPlusPlusJNI.so. But it gives me the following exception.
Exception in thread "main" java.lang.UnsatisfiedLinkError:FaCTPlusPlus.initMethodsFieldsIDs()V
at FaCTPlusPlus.initMethodsFieldsIDs(Native Method)
at FaCTPlusPlus.<clinit>(FaCTPlusPlus.java:30)
at FaCTPlusPlusReasoner.<init>(FaCTPlusPlusReasoner.java:57)
at FactMain.main(FactMain.java:20)
Java Result: 1
I am using netbeans for my development.

The issue is that FaCT++ native library has not been found. You need to specify the path to the native library with the -Djava.library.path argument.
See the answers to this question for more.

Related

How to run Apache CXF wadl2java with JDK 12?

The following command used to work flawlessly:
C:\tools\apache-cxf-3.3.1\bin\wsdl2java -client -d generated foo.wsdl
It no longer works with the latest version of JDK - 12. I have downloaded the latest version of Apache CXF, and still get the same error:
-Djava.endorsed.dirs=C:\tools\apache-cxf-3.3.1\bin\..\lib\endorsed is not supported. Endorsed standards and standalone APIs
in modular form will be supported via the concept of upgradeable modules.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Could anyone offer a tip on how to remedy this?
I got the Apache CXF 3.3.1 wsdl2java utility to work with the latest OpenJDK 11 by doing 4 things:
Pull down this jar and place it into the {CXF_HOME}/lib directory: https://mvnrepository.com/artifact/javax.jws/jsr181-api/1.0-MR1
Pull down this jar and also place it in the {CXF_HOME}/lib directory: https://mvnrepository.com/artifact/javax.xml.ws/jaxws-api/2.3.1
In my case, since I'm running on a Mac, I vi'd the wsdl2java script and made sure these two jars are explicitly being set on the CXF classpath, by doing the following declaration within the script right before the execution of the java command:cxf_classpath=${cxf_classpath}:../lib/jaxws-api-2.3.1.jar:../lib/jsr181-api-1.0-MR1.jar
Lastly, I removed the '-Djava.endorsed.dirs="${cxf_home}/lib/endorsed"' parameter from the java command at the end of the script, since newer JDKs no longer support this argument, so my command now looks like this:$JAVA_HOME/bin/java -Xmx${JAVA_MAX_MEM} -cp "${cxf_classpath}" -Djava.util.logging.config.file=$log_config org.apache.cxf.tools.wsdlto.WSDLToJava "$#"
Now, using OpenJDK11, I'm able to point to an external WSDL file and successfully generate the client code I need to consume this SOAP service with the following command:
./wsdl2java -client -d src https://somewhere.com/service\?wsdl
Whether or not this all works yet is TBD in terms of being able to call and consume the SOAP service I'm coding against, but I've at least now overcome the Java9+ support issue with this tool specific to generating client code from a WSDL.
If your needs are different, I would at least remove the '-Djava.endorsed.dirs="${cxf_home}/lib/endorsed"' JVM parameter and start calling the wsd2java command with the parameters you need set and just start iteratively adding back in the missing libs it starts throwing java.lang.NoClassDefFoundError errors for.
Their FAQ specifically says starting in 3.3.x, Java 9+ will be supported but something clearly dropped the ball between the no-longer-supported hardcoded JVM arguments still being passed in the utility and the missing libraries to support the newer JDKs where these legacy libs have been removed.
Hope this helps someone out there unfortunate enough to ALSO still be programming against SOAP endpoints but trying to at least keep the client-side code you're writing up to date and taking advantage of the newer features of the modern JDK.

Error in Selenium Webdriver

Now, I am started to learn Selenium WebDriver.I have got the following error.
Exception in thread "main" java.lang.IllegalStateException: The path
to the driver executable must be set by the webdriver.gecko.driver
system property; for more information, see
https://github.com/mozilla/geckodriver. The latest version can be
downloaded from https://github.com/mozilla/geckodriver/releases.
Does anyone know how to resolve this error?
It seems like you are using latest version of selenium. Unlike older versions, wherein you don't need to set system property for browser driver executable in case of firefox, the System.setProperty("path to geckodriver.exe") is required to be mentioned in code.
This should resolve your issue

How to find maven dependency jar files that are signed?

I met an error:
Exception in thread "main" java.lang.SecurityException: Invalid
signature file digest for Manifest main attributes.
This problem has been solved with this tip:
http://zhentao-li.blogspot.tw/2012/06/maven-shade-plugin-invalid-signature.html
So, how can I find which jar file is signed?
Well, I have found solutions.
This question is similar to the one below:
How can I tell which signed jar is causing maven-shade-plugin to fail?
In my case, bouncy castle is imported with activemq-all.
dependency

java.lang.IllegalArgumentException thrown at debug launch in Eclipse CDT

I am using Eclipse CDT, with MinGW and under Windows XP, to developp a little C program exporting itself as a JNI-compliant DLL.
Debugging the program from the Java calls is not easy, and thus I added a "Debug" configuration to my project and a main method that tests some functions.
When I launch the debug, i get this weird Java error :
An internal error occurred during: "Launching NuanceWrapper.exe".
java.lang.IllegalArgumentException
It seems very much like it is an internal Eclipse problem. I got the stacktrace of the exception in the .log file of the .metadata folder :
!ENTRY org.eclipse.core.jobs 4 2 2011-02-04 14:08:31.531
!MESSAGE An internal error occurred during: "Launching Wrapper.exe".
!STACK 0
java.lang.IllegalArgumentException
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.getBundles(PackageAdminImpl.java:571)
at org.eclipse.core.internal.runtime.InternalPlatform.getBundle(InternalPlatform.java:181)
at org.eclipse.core.runtime.Platform.getBundle(Platform.java:1416)
at org.springframework.ide.eclipse.core.BundleStateLocationVariableResolver.resolveValue(BundleStateLocationVariableResolver.java:32)
at org.eclipse.core.internal.variables.DynamicVariable.getValue(DynamicVariable.java:54)
at org.eclipse.cdt.internal.core.cdtvariables.EclipseVariablesVariableSupplier$EclipseVarMacro.loadValue(EclipseVariablesVariableSupplier.java:103)
at org.eclipse.cdt.internal.core.cdtvariables.EclipseVariablesVariableSupplier$EclipseVarMacro.getStringValue(EclipseVariablesVariableSupplier.java:90)
at org.eclipse.cdt.dsf.gdb.launching.LaunchUtils.getLaunchEnvironment(LaunchUtils.java:385)
at org.eclipse.cdt.dsf.gdb.launching.LaunchUtils.getGDBVersion(LaunchUtils.java:281)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.getGDBVersion(GdbLaunchDelegate.java:243)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugSession(GdbLaunchDelegate.java:129)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugger(GdbLaunchDelegate.java:83)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launch(GdbLaunchDelegate.java:72)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:923)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1126)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Any idea what could be the problem ? I really need this debug functionality in order to understand what is wrong in my code.
Thank you for your answers.
I looked at the source code of the different files of your stack trace, and it seems to be a problem with your CDT project's configuration. You should check the settings here and try to change them.
One of the CDT build variables seems to be wrong. In LaunchUtils.java, line 390, var.getStringValue() is causing the issue because in this variable (var), which contains a name and an associated value, the value is null.
Hope this helps.
Had the same problem. the next string from the exception stack trace:
at org.springframework.ide.eclipse.core.BundleStateLocationVariableResolver.resolveValue(BundleStateLocationVariableResolver.java:32)
led me to the idea that SpringSource ToolSuite (or Spring IDE) could cause the issue. After uninstalling it and all its components the problem was gone.
Hope this helps.

WSDL2Java tool error Apache CXF

We get the following error when we use WSDL2Java tool to generate stubs. The webservice is up and running.
WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsd
l definition from : http://scheduler.heartbeatsoftware.com/scheduler/WebServices
/SampleSNMWebService?wsdl
Caused by : WSDLException: faultCode=PARSER_ERROR: java.lang.IllegalArgumentExce
ption: InputSource must have a ByteStream or CharacterStream
If we donwload the wsdl and generate stubs from that wsdl, they are generated. But the java client using those stubs throws the same exception as above
Strangely when we deploy the same webservice on our LAN such a problem is not encountered stubs are generated sucessfully and the subsequent java client works well.
The webservice is created using apache cxf version 2.2.5 and hosted on tomcat 6
Any pointers would be appreciated
regards
Sameer
Found solution. Just need to modify the wsdl.java.bat to include proxy settings
-Dhttp.proxyHost= -Dhttp.proxyPort=8080

Resources