Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!

Jaydeep Mazumdar

Greenhorn
+ Follow
since Aug 26, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jaydeep Mazumdar

You can use JavaScript DOM to read and parse the XML message.
Below are a couple of IDE's:

1. BlueJ - For learning interactively. For beginners. See this link: Blue J

2. JCreator - A lightweight free IDE. See here: JCreator

I think the error message is pretty self explainatory:

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Unreachable catch block for exception1. This exception is never thrown from the try statement body
You can use batch updates to update the data in the list. You will find lots of code samples if you google.
10 years ago
I remember implementing this for one of my projects.

There is a custom tag available using which you can store the output of the JSP (i.e. HTML page) in a HttpSession attribute. I dont remember the name but you can google for the same.

You can then retrieve the contents of the HttpSession attribute and then add it as a content or as attachment.

10 years ago
JSP
Correct! That would work!

I was suggesting this:

10 years ago
Please use tags to post code.

In your case, you can change the SQL to:



That way you will avoid invoking multiple sql statements in a batch.
Change the HashMap construtor to this:

10 years ago
A RuntimeException indicates something bad with your programming logic/code. This type of exception can be completely avoided by fixing the code/changing the code logic.

In your particular case, String.indexOf() method returns index of "<" in your message or -1 when it does not find it. I believe you are trying to access the array with this index returned. All you need to do is before accessing the array check that the index value returned is >= 0.

That's all!
10 years ago
Check out these links below. They will give you both overview and details of GC.

Overview:
http://www.petefreitag.com/articles/gctuning/

Detailed Info:
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html
10 years ago
Hi,

It is not necessary for the Garbage Collector to run concurrently. Infact, it is just one of the various algorithms available for grabage collection. There is a JVM option using which you can select the type of garbage collection you want to use.
10 years ago
Consider the case when your code throws some un-anticipated exceptions (e.g unchecked exceptions like NullPointerException) which are not explictly caught in the catch block.

In such a case, since the exception is not caught, the program will dump the trace and exit. However, if you have some cleanup to be done, you can do it in the finally block.

Infact, you can also have only try and finally blocks. e.g.

10 years ago
The finalize() method of an object is called by the Garbage Collector before it removes the object from memory (when there are no references to that object).
You can write the object cleanup code in the finalize method. This is similar to a destructor in C++.

The System.gc() call is a request to the JVM to run the Garbage Collector. Note that it only *requests* the Garbage Collector to run.

Hope this helps!
10 years ago
Hi Denise,

Which Java stream class are you using to read the file? Are you using buffering? Would it be possible for you to share the Java code for reading the file?

Here are some general guidelines that you can follow to improve the performance:

http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/

http://www.javaworld.com/jw-11-2000/jw-1117-performance.html?page=1

10 years ago
Some queries to figure out your exact problem:

1. Are you able to access the tomcat server using the URL: http://localhost:8080/
Here I am assuming that you aer running tomcat on the 8080 port (set by default). If you can see the tomcat home page that means tomcat is running fine and there is some problem with an application that you have deployed.

If step#1 fails, try step #2

2. Have you deployed any applications in Tomcat? If so, can you try removing all the applications you have added and then try restarting tomcat? Try step #1 now and let me know the result.
10 years ago