java

How to troubleshoot an unresponsive Java application/process in Linux

Say your application is unresponsive and you cannot attach a debugger to it, as it rejects everything. All you have is a Linux Bash and process id. How would you investigate the issue? What tools would you use? My goal is to better my troubleshooting skills using Java. This particular issue we had in production, on customer site. ...

Java.lang.UnsupportedClassVersionError on MacOS

Hello All I am trying to run an Java Applet application that ran fine on Windows XP (using Eclipse IDE) but after I imported the project on MacOS X (Using Eclipse on MacOS too), it fails to run displaying this error: Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.C...

Any open source message queue that can be used to send messages from COBOL to Java?

I have a Java stack (Tomcat, etc) and I need to send messages from a mainframe running COBOL to the Java end. Any of the open source queues available can do that? ...

Is there a way to automate EAR deployment in WebSphere and OracleAS?

Hi, I am looking for a solution to automate EAR deployment for OracleAS and WebSphere application servers. Can you guys suggest some open source solution for this? Thanks, Venkat ...

What codepage/charset should be used to interpret data coming from an MVS system into a Java Environment?

I've come into an interesting problem (as is often the case in interacting with legacy systems). I'm working on an application (which currently runs on a x86 Linux or Windows system) that can receive requests from a variety of systems, one of them being an MVS system. I am attempting to determine which codepage/charset I should be us...

Why does my UUID use too much time?

String s = UUID.randomUUID().toString(); return s.substring(0,8) + s.substring(9,13) + s.substring(14,18) + s.substring(19,23) + s.substring(24); I use JDK1.5's UUID, but it uses too much time when I connect/disconnect from the net. I think the UUID may want to access some net. Can anybody help me? ...

A question about enums defined inside a class in java

This code is taken from a SCJP practice test: 3. public class Bridge { 4. public enum Suits { 5. CLUBS(20), DIAMONDS(20), HEARTS(30), SPADES(30), 6. NOTRUMP(40) { public int getValue(int bid) { return ((bid-1)*30)+40; } }; 7. Suits(int points) { this.points = points; } 8. private i...

Is there an Updatepanel control (like ASp.net) in java

Hi, Im basically a .net developer, I am now working on a java web project, here i need to basically get values from the back end (say generating a random number) and update that random number every second on the front end, i want to use jquery for this, in ASP.net, i know that I can have an updatepanel and use _doPostBack to update th...

Eclipse and Classpath.

I swear I'm going insane. JDeveloper runs my project with not a single complaint. If I do "java -cp /usr/share/java/mysql.jar:. MAIN.java", it works like a charm. But Eclipse says "[censored] you" and ignores my classpath settings. I open the Run > Run... menu, and add the mysql jar in the classpath tab, but time and time again, I ke...

How can I set a timeout around some code in java on the main thread?

I'm looking for functionality in java identical to this in ruby: SystemTimer.timeout_after(30.seconds) do do something end i could achieve this by forking a thread and then killing it after a while, but is there a simpler way? ...

Any suggestions for a program or small project to learn about concurrency in Java?

I'm aiming to learn about concurrency in Java. Currently my state of knowledge is poor. I'm pretty sure I know what "volatile" means. I sort of know what "synchronized" means. Sometimes. I've never written code that starts threads or manages them. Outside of this issue, I feel confident and at home working in Java. I'm looking for...

How to draw a line on the camera screen with j2me?

Currently I am developing an application for decoding barcodes using mobile phones. I have a problem with how to draw a line or a square on the camera screen to easily capture the barcode. What is the easiest way of doing it? ...

Tomcat update event

I am working on an application which uses tomcat as a web server and java swing app. as only client to communicate to the web server via webservices. I am stuck in a situation where i need the server to somehow notify the client of some kind of updated event, that occurred on the server side. Something like reverse ajax or similar. A...

Print methods not called when running, called when debugging

Hi, I created a class with four methods. I inserted print statements into them, so I could see if they work properly. There is no problem with the first three. But when I call the fourth method nothing prints out. Strangely when I initiate debugger and move through the method step by step, the statements are called(and output printed). ...

How to send an HTTP header in java

Hi, Is it possible to send a Http header via a URL connection in java? I had this working using sockets, but ran into issues with a firewall which don't seem to be a problem with URLConnection. From looking at the API I get the impression that the output methods in URLConnection are just for filling in forms etc, or can they be used to s...

Read/Write Tiffs in Java

Any ideas for open-source libraries, with Apache or similar license, for reading and writing TIFF files in Java 5 (Preferably with the AWT image-processing libraries, including ImageIO.) I'm aware that Java 6 is supposed to support TIFF. I know about Sun's JAI implementation, but that license doesn't work for the company I work at;...

how to call java function from c++?

Hello all how can i call java function from c++ application ( not using cmd methods.. ) Thanks ...

Is it possible to add VB to an Excel sheet from POI?

Does anyone know if it's possible to add VB to an Excel document, from within Java? I basically want to add a pivot table to a sheet, and set some of it's properties dynamically. I know that I can access the pivot table settings from VB, but not directly from POI. ...

how to register KeyStroke on JXDatePicker

I need to transfer focus onto another element when user press Enter key, so I succeded to register KeyStroke on most elements this way: this.getInputMap( ).put( KeyStroke.getKeyStroke( '\n' ), "transferFokus" ); this.getActionMap( ).put( "transferFokus", transferFokusa ); everything works fine except for my class which extends JX...

JSF and Spring performance vs poor JSP performance

I saw some JSF projects developed by my collegues and these projects seemed to me very slow. Does anybody have the same opinion? I'm currenly using jsp+jstl and jQuery for "rich" client. I wonder what advantages and disadvantages have modern frameworks (jsf, wicket, tapestry..) over old plain jsp. It would be great if people who ...