I have been working with the Play! Framework for a few weeks now, and am really enjoying it. Occasionally I have an issue come up which is frustrating me. It starts when I encounter a compile error. I refresh, and see the (excellent) Play! error message. Here's a simple example.
I go to the appropriate file, fix the error, and reload the page. Then I get this compiler error:
Strangely, it shows the updated source code, with the bug fix, but it is throwing the same compiler error from the previous message. If I restart the Play! server, then everything compiles and I can go on as expected, but of course one of the great things about Play! is being able to edit .java source files and see those changes right away in the browser.
Would really appreciate a tip from anyone who's bumped into this before, or has a clue what is causing it! Thanks so much! I am running OSX 10.6.
EDIT
I have also tried manually deleting the tmp/ directory, where the .class files are stored. This does not help, and I get the same behavior, where the edited source code appears, but the old compiler error is still dsiplayed.
My best stab at this is that your clock is screwed up. Do you use time synchronization? Keep a terminal open running:
while true; do sleep 1; date; done
and check whether there is a correlation with clock changes and this behaviour.
FWIW, I've never witnessed this (also on MacOS 10.6)
Related
I originally posted this question on GameDev stackexchange however I'll also ask the question here to try and get more outreach, especially since I wasn't sure my problem was specific to game development since it's a problem with a Java native call.
For the past months I've been working on creating my own game engine for personal use in LWJGL using pieces here and there, especially from developer ThinMatrix's rightfully credited code, to learn as much as I can while building it. Only recently there has been strange behavior happening when I launch the engine from IntelliJ for testing:
After about 6-10 individual times I click run, all subsequent runs suddenly take about 60 seconds for the window to appear.
Whenever I restart my PC this hanging resets and I have another 6-10 runs before it hangs everytime again.
I located the issue to glfwInit, more specifically at the call to the native method:
#NativeType("int")
public static boolean glfwInit() {
long __functionAddress = Functions.Init;
return invokeI(__functionAddress) != 0; // Right here
}
I also noticed that this issue only started when I attempted to implement text support in my engine using the STBTrueType library. It was perfectly fine before that. I tried removing the TrueType code but it didn't fix it.
Here's a list of things I've tried:
Clearing my temp folder in case a buggy or corrupted file was present.
Recompiling and rebuilding the entire LWJGL jars twice.
Building glfw.dll from the GLFW sources and replacing the glfw.dll in the native jars with the former.
Reinstalling Java and actually upgrading JDK versions (from 13.0.2 to 14.0.2)
Switching IDEs even if I suspected it wouldn't work.
Updating my NVIDIA drivers, and reinstalling them.
I'm quite confused as to what it could be, and I'd be more than happy to share code, thread dumps, or debug info if you deem it necessary. Here is the Github repository with the latest, "faulty" code (fault in quotes because I'm not too sure the code is the problem.)
Thank you very much for any guidance.
P.S: Please tell me if this is better asked in StackOverflow instead of here.
So I fixed the issue, it turns out it wasn't even related to anything to do with programming, or STBTrueType, or the library itself. The problem was as pointed out in this StackOverflow post, where this hanging behavior was due to a faulty driver or, in my case, my keyboard USB being plugged in the "wrong" USB port. I moved my computer at the same time I started working on text in my engine, hence why I wrongly linked the issue with the TrueType library. If you're having the same issue, look at the aforementioned post or if that doesn't work, look for a peripheral that might cause interference.
I've recently been attempting to set up SceneBuilder but suddenly my copy of Eclipse crashes pretty much instantly when I attempt to try and associate any external editor with a file type (not just XFXML). I've done some research and this seems to be the only page I can find talking about the issue, but I'm not sure how to take the advice therein.
I've linked the error log generated by these crashes. If anyone has experience something similar or has any idea how to go about troubleshooting this issue I'd greatly appreciate your input!
//I've included this code block to allow the pastebin link to work. There have
not been any issues with programming as the IDE won't operate as expected.
Im trying to get a project with JOGL running and from second one I've run into problems. I have downloaded jogl-all.jar, gluegen-rt.jar and gluegen-rt-natives-windows-amd64.jar and jogl-all-natives-windows-amd64.jar version 2.3.2 from the release website of JOGL. I have extracted gluegen-rt.jar and jogl-all.jar, added them as a library to my project and put all the native files into lib/natives/windows-amd64. So far so good, I then set up a simple method doing the following:
System.out.println("Start");
GLProfile profile = GLProfile.getDefault();
System.out.println(profile.getImplName());
I hit the run button in IntelliJ and it printed "Start". Thats it. I started checking some logs, browsing the internet about that issue and suddenly, like 2 minutes later I realized in the corner of my eye that the output changed and it printed GL4bc. A little bit confused i thought this might be some IntelliJ related issue or so and started it in the command line. Same thing there, it consistently takes 1-2 minutes to execute GLProfile.getDefault(). What's this madness? I mean, I never choose Java for performance reasons, but that's a little bit too much :D.
What am I missing here? Or is this 'as designed'? Thanks for any help in advance and have a nice day!
I have no idea what a hot swap is and for the life of me cannot construct a google search that will find what it means in the context of my program. I was editing my class, the same way I do all the time, and when I went to run it I all of a sudden got a
Hot Swap failed: myClassName: schema not implemented
error.
Can anyone explain this to me in Layman's terms?
You are attempting to change your source code while the program (or IntelliJ's debugger) is still running. This is what the HotSwap feature does according to IntelliJ's KB.
Please make sure your program and/or debugger is stopped before re-launching the program and the issue should be resolved.
I am in a very very upset situation. My program worked 100% fine when it is in netbeans, but when I build it it has some issues. That is, in my program, there is an one interface and 10 implementation classes. Program calls correct correct implementation class based on how the user save the file (eg: if user save it as game.yellow, it will call "YellowImpl.java", if saved as game.red, then "RedImpl.java" likewise).
But when it is built, it is calling everything fine, instead YellowImpl!! Which means, if the user saves it as game.red, it will call "RedImpl" correctly and same to all other implementations instead YellowImpl. When the user save the file as game.yellow, the program do nothing!!! But this is not happening when it is inside the netbeans! I tried clean and build too, still not good! What is causing this ? Please help!
However, I am unable to provide the code, because it has lot of codings
PS: I am using some libs too
It's difficult to understand exactly what issue you are having with your explaination and no code. However I assume you are having issue with implementation naming conventions.
Perhaps the below link can help.
Java Interfaces/Implementation naming convention
I am agree with #Rhys: it is hard to understand what happens in your application. Just let me give you an advice: do not think (even for 1 second) that there is a bug in java compiler, JVM etc. It is definitely your bug.
How to find it? I suggest you to use remote debugging.
Run your application outside IDE (NetBeans in your case) with enabled remote debugger, connect to it with net beans and debug your application. I believe you will fined the problem within minutes.
How to enable remote debugging? Add the following long string to your java execution command line:
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
If something happens in very beginning of your program execution use suspend=y.
Now connect to this application from NetBeans. It is simple, just configure it to port 8000 according to the configuration of your application.
That's it. Good luck.
Thanks a lot for the replies guys. However, I managed to find the issue. That was a simple, capital case!! I have a package called "kolor" and all the implementations are inside that. In my "YelloImpl" class, I have mentioned the package as "Kolor" (Note that "K" is capital). It was fine in netbeans, but outside it wasn't. After clearing this out, everything went fine. Thanks all for the replies again.