Tomáš Hubálek Blog: Bavte se přiměřeně
Reklama
Čtvrtek, 08.11.07
hibernate.hbm2ddl.auto - What do values create, create-drop, update and validate mean?
I was looking into documentation for Hibernate for the meaning of these options. Unfortunately it is not written there.
I found explanation on Eyal Lupu's blog... :-)
Enjoy...
Čtvrtek, 13.09.07
Java: How to display incomplete stacktrace?
A few days ago we met some issue and there was huge stacktrace finishing with ... 20 more.
We was disappointed that we cannot see real cause of the exception because we thought that Java is hiding most important exception details.
But in fact, there is nothing hidden, it is just misunderstanding of the stack trace.
Lets look at following java snippet:
01 public class Test {
|
| Java2html |
This code display following stack trace:
Exception in thread "main" java.lang.RuntimeException: Error occured in method a()
at Test.a(Test.java:7)
at Test.main(Test.java:24)
Caused by: java.lang.RuntimeException: Error occured in method b()
at Test.b(Test.java:15)
at Test.a(Test.java:5)
... 1 more
Caused by: java.lang.RuntimeException
at Test.c(Test.java:20)
at Test.b(Test.java:13)
... 2 more
and you can see complete stack trace although there is text .. 2 more and the real cause you can see at the top of the last exception.
For more info see description of the "bug" number 4775147 (Incomplete stack trace printed by Throwable.printStackTrace in JDK 1.4+) in Sun's bug parade.
Úterý, 20.02.07
NetBeans 6.0: I want it, I want it, I want it...
Úterý, 30.01.07
How to execute long running tasks in NetBeans platform...
We work on J2EE project based on NetBeans platform and we solve typical tasks. My first problem was execution of long running tasks.
Here is a solution:
private void jbExecuteActionPerformed(java.awt.event.ActionEvent evt) {
// start thread
RequestProcessor.getDefault().post(new Runnable() {
public void run() {
ProgressHandle progress =
ProgressHandleFactory.createHandle("Loading data...");
progress.start(10);
try {
for (int i = 1; i < 10; i++) {
try {
Thread.sleep(2000);
} catch (InterruptedException ex) { }
progress.progress(i);
}
} finally {
progress.finish();
}
}
});
}
The trick is in RequestProcessor.getDefault().post(new Runnable(){...}).
Inside new Runnable(){...} you may optionally use NetBeans Progress API
Pátek, 12.01.07
NetBeans module and web services made easy...
I looked at Roumen's presentation regarding NetBeans Plaftorm and Web Services and I was impressed. It really looks very easy.
Older articles:
08.12.2006
30.10.2006
14:55:35 -


