I have C program (Dll) which I can call from Java using JNI. I want to use Javafx for the interface so I made a java class to call the dll. I am able to load the dll but I cannot call the method. The error message it gives me is
java.lang.UnsatisfiedLinkError:
mark1.Small_test.tester(DDDLjava/lang/String;Ljava/lang/String;Ljava/lang/String;DDD)[D
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
I have used the same Dll and it works if I call with normal java. I am using netbeans for JavaFX. I have been stuck with this problem for a week. Any help is greatly appreciated.
Related
As part of customizing Alfresco, I have created a java class by extending 'org.quartz.StatefulJob'Action class in Alfresco. I have registered in Spring Bean definition. But I am getting error as follows. I am deploying this Tomcat server
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.tutorialspoint.HelloWorld] for bean with name 'helloWorld' defined in file [C:\alfresco-content-services\tomcat\shared\classes\alfresco\extension\move-monthily-data-context.xml]; nested exception is java.lang.ClassNotFoundException: com.tutorialspoint.HelloWorld
Caused by: java.lang.ClassNotFoundException: com.tutorialspoint.HelloWorld
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:265)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:419)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1299)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1270)
Can i know the reason of this error ? , What exatctly is the right locaiton to keep extended java file in tomcat? I am using Alfresco 5.2 EE ,
Rergards
You should be creating a project based on the SDK and packaging your customizations as an AMP which you then install into your Alfresco and/or Share WAR files.
If you need help stepping through how to do that, please work through the tutorials on ECM Architect.
Doing so will package your action class into a JAR and will then place your JAR in the Alfresco WAR under WEB-INF/lib.
An exception raised when I used the comboBox. Never see this before. but today it just raised. And below is the full stack. Anyone know how can I find where is this bug comes from? It seems like a bug in JavaFX. I am using MAC OS.
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at com.sun.javafx.scene.control.skin.ComboBoxListViewSkin.queryAccessibleAttribute(ComboBoxListViewSkin.java:593)
at javafx.scene.control.Control.queryAccessibleAttribute(Control.java:917)
at javafx.scene.control.ComboBoxBase.queryAccessibleAttribute(ComboBoxBase.java:459)
at javafx.scene.control.ComboBox.queryAccessibleAttribute(ComboBox.java:616)
at javafx.scene.Node$19.getAttribute(Node.java:9648)
at com.sun.glass.ui.Accessible$GetAttribute.run(Accessible.java:142)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.glass.ui.Accessible.lambda$getAttribute$4(Accessible.java:169)
at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
at com.sun.glass.ui.Accessible.getAttribute(Accessible.java:166)
at com.sun.glass.ui.mac.MacAccessible.accessibilityAttributeValue(MacAccessible.java:1261)
I have activemq-client-5.13.3.jar on my class path, but i keep getting
Exception in thread "main" java.lang.NoClassDefFoundError: javax/jms/JMSException
If i use activemq-all-5.13.3.jar on my class path, every thing works.
however I am not allowed to use the activemq-all jar.
added jms-api-1.1-rev-1.jar
and now Exception in thread "main" java.lang.NoClassDefFoundError: javax/management/j2ee/statistics/Stats
You can use maven to determine this with the mvn dependency:tree command or use other maven centric tools to explore the artifacts dependencies.
At a minimum you would need these for v5.13.3
slf4j-api.jar geronimo-jms_1.1_spec.jar hawtbuf.jar
Then you can add an slf4j binding like log4j or logback to get proper logs. There are some others that you might want depending on where / how you are using it like the geronimo-j2ee-management_1.1_spec jar.
Of course if you use maven to build you can make this simpler since it will manage the deps for you.
I found same problem with my java application. I needed to insert Spring Boot for rest web service (Jetty Server) and now ActiveMQ for others data exchange.
With
activemq-client-5.15.11.jar; geronimo-jms_1.1_spec-1.1.1.jar; geronimo-j2ee-management_1.1_spec-1.0.1.jar; hawtbuf-1.11.jar;
all works.
I am following this doc to enable push in Xamarin.Android runtime BB10 app. I am confused where & when exactly to put android.cfg file.
Before creating apk, added cfg file in root of project in application
name (tried naming as android.cfg also).
Using that apk, I generated .bar file, but under android folder, res
folder and apk file only exist, cfg file doesn't seems to be exist.
Then I tried adding cfg file under bar file after creating apk but
before signing bar file, but I started getting following error:
Error: No manifest. Exception in thread "main"
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at net.rim.tools.signing.SigningMain.main(SigningMain.java:72) Caused by: java.lang.Exception: java.lang.RuntimeException: No
manifest.
at net.rim.device.codesigning.barsigner.BarSigner.if(Unknown Source)
at net.rim.device.codesigning.barsigner.BarSigner.main(Unknown Source)
... 5 more Caused by: java.lang.RuntimeException: No manifest.
at net.rim.device.codesigning.barsigner.BarSigner.try(Unknown Source)
... 7 more
I have ppgurl, appid which I got from BB.
What is the exact procedure for this? In same doc following thing is given:
The Google Play Services SDK is not supported on BlackBerry 10. If
your app includes GCM services, you must set up your Android project
to use the stand-alone GCM SDK. Android Studio does not support the
use of the stand-alone GCM SDK at this time. For more information see
Android Studio Overview.
I am using GCM Client component for push in Xamarin.Android. What is stand alone GCM SDK given in doc?. I don't know what kind of GCM I am using.
I fixed above issue and now I am receiving push notification successfully in my BlackBerry device. In different places different location is given to place android.cfg file, but actual location which worked for me is:
android.cfg file under assets/blackberry/android.cfg
Place this file before creating apk. Because in many places I read to put this file after creating apk using zip tool, that may also work, but if it is not working try the solution given here :)
I followed procedures exactly given in below docs.
https://github.com/blackberry/BB10-Android-Runtime-Samples/tree/master/SamplePushClient
I'm trying to decrypt a file using Bouncy Castle v1.53 PGP and Using PGPUtil class.
The program works fine in my Eclipse, but given following error when integrated inside a war file and deployed onto a weblogic server.I'm using following dependencies:
1)bcpg-jdk15on
2)bcprov-jdk15on
Error
java.lang.NoSuchMethodError:
org.bouncycastle.util.Strings.newList()Lorg/bouncycastle/util/StringList;
at org.bouncycastle.bcpg.ArmoredInputStream.<init>(Unknown Source)
at org.bouncycastle.bcpg.ArmoredInputStream.<init>(Unknown Source)
at org.bouncycastle.openpgp.PGPUtil.getDecoderStream(Unknown Source)`
Resolution
This problem is resolved when I copied following classes into my source folder:
org.bouncycastle.util.Strings
org.bouncycastle.util.StringList
org.bouncycastle.bcpg.ArmoredInputStream
org.bouncycastle.openpgp.PGPUtil`
by changing their Class Names
However, I want a better fix than this as I feel this is some Jar Conflict
Please let me know if anyone finds one
That error is likely happening because you are using one version of the bouncycastle .jars when you run with Eclipse, but there is a different version of one of those .jars which is on the classpath that Weblogic is using when running your application.
You will need to investigate how exactly Weblogic sets up the classpath, and make sure the version of the .jars you need are on the classpath before the preexisting version (unless that preexisting version is there by mistake, in which case you can just remove the preexisting one from the classpath).