JavaFX 2.0 Example Crashed On Startup Showing Chinese - javafx-2

I am running Netbeans 7.1 RC1 with Java 7.0 and each time i try to run my javafx example, it crashes.
Below is the example that I was trying to run:
Scene scene = new Scene(new Group());
stage.setTitle("Imported Fruits");
stage.setWidth(800);
stage.setHeight(600);
ObservableList<PieChart.Data> pieChartData =
FXCollections.observableArrayList(
new PieChart.Data("Grapefruit", 13),
new PieChart.Data("Oranges", 25),
new PieChart.Data("Plums", 10),
new PieChart.Data("Pears", 22),
new PieChart.Data("Apples", 30));
final PieChart chart = new PieChart(pieChartData);
//chart.setTitle("Imported Fruits");
chart.setLegendVisible(false);
// chart.setLabelsVisible(false);
//chart.setEffect(new GaussianBlur());
((Group) scene.getRoot()).getChildren().add(chart);
Timeline timeline = new Timeline();
timeline.getKeyFrames().addAll(
new KeyFrame(
Duration.ZERO,
new KeyValue(chart.rotateProperty(), 0), new KeyValue(chart.translateXProperty(), 0+ chart.getWidth()),new KeyValue(chart.translateXProperty(), 0 + chart.getHeight())),
new KeyFrame(
Duration.seconds(5),
new KeyValue(chart.rotateProperty(), 360), new KeyValue(chart.translateXProperty(), 800 - chart.getWidth()),new KeyValue(chart.translateXProperty(), 600 - chart.getHeight())));
//timeline.play();
stage.setScene(scene);
stage.show();
And while running this code, it crashes and if I run an empty canvas, it will run successfully:
Each time I runt he code above, it crashes like this:
java.lang.NullPointerException
�
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
�
java.lang.NullPointerException
�
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
�
java.lang.NullPointerException
�
�
⌠䄠晡瑡氠敲牯爠桡猠扥敮⁤整散瑥搠批⁴桥⁊慶愠創湴業攠䕮癩牯湭敮琺
�
⌠⁅塃䕐呉低彁䍃䕓卟噉佌䅔䥏丠⠰硣〰〰〰㔩⁡琠灣㴰砰〰〰㝦敦㘶㡡愷愬⁰楤㴱㘸㈸Ⱐ瑩搽㌰〴
�
⌠䩒䔠癥牳楯渺‷⸰ⵢㄴ�
⌠䩡癡⁖䴺⁊慶愠䡯瑓灯琨呍⤠㘴ⵂ楴⁓敲癥爠噍
㈱⸰ⵢㄷ楸敤潤攠睩湤潷猭慭搶㐠捯浰牥獳敤潰猩
⌠偲潢汥浡瑩挠晲慭攺
⌠䌠⁛橡癡晸ⵦ潮琮摬氫へ㍡愷慝
�
⌠䙡楬敤⁴漠睲楴攠捯牥⁤畭瀮⁍楮楤畭灳⁡牥潴⁥湡扬敤⁢礠摥晡畬琠潮⁣汩敮琠癥牳楯湳映坩湤潷�
�
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
�
⌠䅮⁥牲潲⁲数潲琠晩汥⁷楴栠浯牥⁩湦潲浡瑩潮⁩猠獡癥搠慳�
⌠䌺屄体呥捨屰硜䍯汯牦畬䍩牣汥獜桳彥牲彰楤ㄶ㠲㠮汯�
�
⌠䥦⁹潵⁷潵汤楫攠瑯⁳畢浩琠愠扵朠牥灯牴Ⱐ灬敡獥⁶楳楴�
⌠†桴瑰㨯⽢畧牥灯牴⹳畮⹣潭⽢畧牥灯牴⽣牡獨⹪獰
⌠周攠捲慳栠桡灰敮敤畴獩摥⁴桥⁊慶愠噩牴畡氠䵡捨楮攠楮慴楶攠捯摥�
⌠卥攠灲潢汥浡瑩挠晲慭攠景爠睨敲攠瑯⁲数潲琠瑨攠扵朮
�
java.lang.NullPointerException
�
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
�
Java Result: 1

It seems like one of your programs are modified, the generated code makes no sense at all. it's most certainly a malicious code involved but it's hard to pinpoint the source, might be your configuration files, might be the core of your used software, you sure you're using genuine version of the software? and didn't download/purchase it from un-authorized websites/vendors?

It works well now. The problem I guess is because Netbeans JavaFX projects created from Netbeans 7.1beta has issues when you try to run the same project in a newer Netbeans 7.1 such as RC2 which was what happened in my case.

Related

Android studio Unable to add window -- token android.os.BinderProxy#499c862 is not valid; is your activity running?

I've gone through lot of posts about this issue before I post my own question , and Im still not able to find any solution to it , in fact I don't even know where the problem is !
I keep getting this crash everyday on my crashlytics dashboard ( only for few users ) . Unfortunately its only giving me the crash infos but not showing which line or class is causing it , and other thing is that 100% of devices affected are using Android 7 & most of them are Amlogic devices ( eg : X96 mini , TX3 mini )
I understand that this is most likely happening because Im trying to show a dialog after execution of a background thread, while the Activity is being destroyed , so I checked all my code and I've added to each dialog the condition below
if(!YourActivityName.this.isFinishing())
{
//show dialog
}
Here is the LogCat:
Fatal Exception: android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy#499c862 is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:679)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
at android.widget.Toast$TN.handleShow(Toast.java:459)
at android.widget.Toast$TN$2.handleMessage(Toast.java:342)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6121)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:892)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)

Windows 10 >= 1809 issues with jacob and Word ComObject

we have an old legacy app which uses Java version 1.6 update 45 (jdk-6u45-windows-i586.exe) and Jacob.dll 1.8 (jacob_18.zip), and which cannot be updated :(
Everything was working fine till the latest Windows 10 1809 Update. Since then the comobject behavior seems to have changed and causes an error as well as that the word document cannot be saved anymore. I also tried 19H1 but got the same error.
I could reproduce the issue in java with following code, of course you have to import the Jacob.dll:
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Variant;
import com.jacob.com.Dispatch;
ActiveXComponent oWord = new ActiveXComponent("Word.Application");
oWord.setProperty("Visible", new Variant(true));
Dispatch documents = oWord.getProperty("Documents").toDispatch();
String str_file = "C:/temp/test.rtf";
Dispatch doc = Dispatch.invoke(documents, "Open", Dispatch.Method,
new Object[]{str_file},
new int[1]).toDispatch();
The error I get is:
Exception in thread "main" com.jacob.com.ComFailException: A COM exception has been encountered:
At Invoke of: Open
Description: An unknown COM error has occured.
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.com.Dispatch.invokev(Dispatch.java:384)
at com.jacob.com.Dispatch.invoke(Dispatch.java:267)
at Main.main(Main.java:21)
When I click on the Dispatch errors I only get that it is not a valid line number in com.jacob.com.Dispatch
I know it is not the best day not updating the legacy app itself, but what can I say, it is as it is.
Any ideas what might have changed in Windows >= 1809 or how it can be solved without touching the app?
Thanks
Stephan
Edit:
Dispatch oDocument = Dispatch.call(documents, "Open", str_file).toDispatch(); leads to the same error
I should mention that Word opens, but I am not able to save the file and that the return value is an error
OK, the error is the same which is covered in this post:
Exception from Word.ApplicationClass.Activedocument all of a sudden
So it seems to be a bug in >=1809 and for the moment the only fix is to change/play with the regional settings

ClassNotFoundException at dalvik.system.BaseDexClassLoader

Did some research on this and found a few posts regarding people facing the same issue in their application. I too am facing this crash in the google console for my app and followed the posts I found (java.lang.ClassNotFoundException dalvik.system.BaseDexClassLoader.findClass) and similar others. All of these suggest to follow steps mentioned on the link, https://developer.android.com/studio/build/multidex.html.
Followed all the workarounds mentioned on the page but still getting the same issue. MinSdkVersion for my app is 15 and thus added all workarounds to get rid of this but no luck as of yet.
I am left with the option to change the minimum sdk version to 21 as mentioned int he documentation, but that would affect me big time. *
I am getting this issue on Android 5.1 and lower versions only.
java.lang.RuntimeException:
at android.app.LoadedApk.makeApplication (LoadedApk.java:563)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:4540)
at android.app.ActivityThread.access$1500 (ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1371)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:135)
at android.app.ActivityThread.main (ActivityThread.java:5268)
at java.lang.reflect.Method.invoke (Method.java)
at java.lang.reflect.Method.invoke (Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:697)
Caused by: java.lang.ClassNotFoundException:
at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass (ClassLoader.java:511)
at java.lang.ClassLoader.loadClass (ClassLoader.java:469)
at android.app.Instrumentation.newApplication (Instrumentation.java:980)
at android.app.LoadedApk.makeApplication (LoadedApk.java:558)
Post a lot of research, the below post details this appropriately and concludes hat this is not fixable,
Unexpected crash in BaseDexClassLoader

eglCreateImageKHR returning EGL_BAD_ATTRIBUTE error

I have implemented hardware decoding on Linux using VAAPI via FFmpeg. Since I have an OpenGL application, I am converting the decoded VAAPI surfaces to OpenGL textures using vaCopySurfaceGLX. This is working fine except that there is a copy (on the GPU) that is made. I was told that I could directly use the VAAPI surface as OpenGL textures using EGL. I have looked at some examples (mainly Kodi source code) but I'm not able to create the EGLImageKHR. The function eglCreateImageKHR returns 0, and when I check for errors, I get a EGL_BAD_ATTRIBUTE error but I don't understand why.
Below is how I'm converting the VAAPI surface.
During initialization, I set up EGL this way:
// currentDisplay comes from call to glXGetCurrentDisplay() and is also used when getting the VADisplay like this: vaGetDisplay(currentDisplay)
EGLint major, minor;
_eglDisplay = eglGetDisplay(currentDisplay);
eglInitialize(_eglDisplay, &major, &minor);
eglBindAPI(EGL_OPENGL_API);
Then later, to create my EGL image, this is what I do:
// _vaapiContext.vaDisplay comes from vaGetDisplay(currentDisplay)
// surface is the VASurfaceID of the surface I want to use in OpenGL
vaDeriveImage(_vaapiContext.vaDisplay, surface, &_vaapiContext.vaImage);
VABufferInfo buf_info;
memset(&buf_info, 0, sizeof(buf_info));
buf_info.mem_type = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME;
vaAcquireBufferHandle(_vaapiContext.vaDisplay, _vaapiContext.vaImage.buf, &buf_info);
EGLint attribs[] = {
EGL_WIDTH, _vaapiContext.vaImage.width,
EGL_HEIGHT, _vaapiContext.vaImage.height,
EGL_LINUX_DRM_FOURCC_EXT, fourcc_code('R', '8', ' ', ' '),
EGL_DMA_BUF_PLANE0_FD_EXT, buf_info.handle,
EGL_DMA_BUF_PLANE0_OFFSET_EXT, _vaapiContext.vaImage.offsets[0],
EGL_DMA_BUF_PLANE0_PITCH_EXT, _vaapiContext.vaImage.pitches[0],
EGL_NONE
};
EGLImageKHR eglImage = eglCreateImageKHR(_eglDisplay, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, (EGLClientBuffer)NULL, attribs);
Looking at what could cause this error in the following document https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt, I also tried to add the following options which should not matter since my format is not planar
EGL_YUV_COLOR_SPACE_HINT_EXT, EGL_ITU_REC601_EXT,
EGL_SAMPLE_RANGE_HINT_EXT, EGL_YUV_FULL_RANGE_EXT,
EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT, EGL_YUV_CHROMA_SITING_0_EXT,
EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT, EGL_YUV_CHROMA_SITING_0_EXT
The code that I'm using is similar to all the examples I've seen so I'm not sure what the error is.
Note that I have removed all the error checks for this post. All the calls above are successful except for eglCreateImageKHR.
After turning the egl log level to debug, I was able to get more information about the error and pinpointed where in the egl source code this error happened. It turns out that the format fourcc_code('R', '8', ' ', ' ') was not supported because my mesa version was too old. You need to have mesa 11.0.0 or above installed. After recompiling mesa (I'm running Ubuntu 15.04) and installing the 11.0.0 version, I'm finally getting an EGL image.

org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed

I'm new to use astyanax connecting to cassandra(1.2.8).
I downloaded astyanax from [https://github.com/Netflix/astyanax] and cassandra from [http://www.apache.org/dyn/closer.cgi?path=/cassandra/1.2.8/apache-cassandra-1.2.8-bin.tar.gz]. Everything is installed/built based on instruction and keep default settings(like conf/cassandra.yaml). Now I try to run the sample code [https://github.com/Netflix/astyanax/blob/master/astyanax-examples/src/main/java/com/netflix/astyanax/examples/AstCQLClient.java], and a disgusting error keeps bothering me(showed at eclipse):
Caused by: com.netflix.astyanax.connectionpool.exceptions.PoolTimeoutException: PoolTimeoutException: [host=127.0.0.1(127.0.0.1):9160, latency=5021(5021), attempts=1]Timed out waiting for connection
As I enable cassandra debug mode, the below is showed on the terminal:
DEBUG 17:06:48,968 Thrift transport error occurred during processing of message.
org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 4 bytes, but only got 0 bytes. (This is often indicative of an internal error on the server side. Please check your server logs.)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:378)
at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:297)
at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:204)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:22)
at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:199)
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)
Just to emphasize, I don't change anything in cassandra.yaml(actually I don't know what they mean); all the libs from astyanax and from cassandra-1.2.8 are all imported to the java project.
I guess the problem is due to that connections will shut down when I try to flush through frame transform... I'm a noob to database. I do appreciate to all the helps!
ps. I'm waiting on stackoverflow. If any logs you need to check(please also give me the directory to find it. I'm noob>_<), just say and I'll fetch it. Thanks a lot!!
Even though this is an old question and I'm not sure if my suggestion will help anyone but I faced the same error and here is how I solved it. Hopefully this will help another poor soul.
I was seeing the same error "cannot read remote side has closed" , but I was using csharp, Apache.Cassandra namespace and Thrift.dll.
The following is a working snippet,
TSocket socket = null;
TTransport transport = null;
socket = new TSocket("localhost", 9160);
transport = new TFramedTransport(socket);
TProtocol protocol = new TBinaryProtocol(transport);
CassandraClient cassandraClient = new CassandraClient(protocol);
cassandraClient.InputProtocol.Transport.Open();
The trick was to use cassandraClient.InputProtocol.Transport.Open(); rather than transport.open()

Resources