java

JVM -XX:+StringCache argument?

I was recently reading about all the JVM arguments available in JRE 6 [Java VM Options] and saw this : -XX:+StringCache : Enables caching of commonly allocated strings. Now I was always under the impression that Java kept a pool of interned (correct word?) Strings and when doing something like String concatenation with literals it...

dictionary application in java

Hi all!! i need to implement a dictionary application in java i.e. which wil retrieve the synonyms of the user input.. jus give me an idea to do this.. ...

Is there any relation between the class that implements interface and that interface???

Consider this class hierarchy: Book extends Goods Book implements Taxable As we know, there is a relationship between a subclass and its superclass (is-a). Q: Is there any relationship like "is-a" between Book and Taxable? GOOD Answers, but you said that "is-a" is also a relationship between Book and Taxable, but "is-a" is a relati...

Is there a data mapper like Dozer for c#

I am looking for something similar to Java's Dozer for C#, something that uses reflection to automatically maps the data fields in one object to another. A link to Dozer: http://dozer.sourceforge.net/ ...

How to get the URL of the captured image

I launch an activity to capture a picture from camera: Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE, null); i.putExtra("return-data", true); startActivityForResult(i, PICK_FROM_CAMERA); Can you please tell me how to get the URI of the capture picture? Thank you. ...

Checking for a Valid Path when Uploading a File Using commons-fileupload

I'm working with some code that uploads an image from a form and stores it on our server. In Internet Explorer the user can enter a path manually, and I wonder how I can check that the file exists, i.e., that the user entered a valid path. There's a FileItem object that's being used to check size (e.g., fileItem.getSize() < MAX_SIZE), a...

Java error: java.lang.IllegalArgumentException: Signal already used by VM: INT

I am investigating a Java issue (using IBM JVM 1.4.2 64-bit) on Red Hat Linux. I am wondering if anyone has seen this error message before and knows if there is a workaround to this problem? Source: import sun.misc.Signal; import sun.misc.SignalHandler; public class SignalTest extends Thread { private static Signal signal = new S...

What does UnmappableCharacterException mean?

CharsetDecoder reads: There are two general types of decoding errors. If the input byte sequence is not legal for this charset then the input is considered malformed. If the input byte sequence is legal but cannot be mapped to a valid Unicode character then an unmappable character has been encountered. I understand the concept of m...

Maintain file permissions when extracting from a zip file using JDK 5 api

I am using java.util.Zip and java.util.ZipEntry to successfully extra a zip file's contents to disk. I would like to maintain the file permissions set when extracting on a *nix file-system. Can anyone point me to the "correct" way to do this? ...

Do spurious wakeups actually happen?

Seeing various locking related question and (almost) always finding the 'loop because of spurious wakeups' terms1 I wonder, has anyone experienced such kind of a wakeup (assuming a decent hardware/software environment for example)? I know the term 'spurious' means no apparent reason but what can be the reasons for such kind of an event?...

Can I connect to a jsadebugd process on a remote machine from Eclipse/IDE debugger?

I have a java process running on a Linux box, but it cannot be started/re-started in debug mode. I read about the jsadebugd command and started the daemon, but I want to connect to it from an IDE(possibly Eclipse) debugger or maybe YourKit or jconsole. How can I do this? The remote JVM is 1.6+. ...

JAX-WS client for IIS Integrated Windows authentication (NTLM)

Recently, I am working on a project that requires to build a web service client in Java running on JAX-WS engine to talk to a .NET web service secured by Integrated Windows authentication (also known as NTLM protocol) I searched on the Internet. It seems a well-known issue, but no one has good solution yet. Anyone has done this before...

How does software update work?

Ive been reading Liang's Introduction to Java Programming for a couple of weeks, and that question came up when the author said "There is no need for developers to create, and for users to install, major new software versions.". How does software update work? For example, patches for games, new version of products, and that kind of thin...

Logback usage and printing lists

I am starting using logback and I want to know if there are better ways of doing something. I have this code: public class ClassA { private List<String> l; private Logger logger; public ClassA(){ this.logger = LoggerFactory.getLogger(this.getClass().getName()); } .... public List<String> method() { t...

How to show a textbox, button, etc in a Java Applet?

How can I show common GUI elements such as : Textbox Button Radios/Dropdowns Labels etc in a java applet which would be run from a web browser? ...

Reading in a JPEG image in java

I want to read in a jpeg image with a uniform gray background with several colored balls on it of the same size. I want a program which can take this image and record the coordinates of each ball. whats the best way to do this? ...

Using Hibernate with Dynamic Eclipse Plug-ins

I have classes that are named exactly the same across different plug-ins that I use for my application, and I'd like to be able to configure them properly with Hibernate. The problem is that it looks like Hibernate dynamically generates a class' package name when trying to find a class when it's doing its mapping. With one plug-in this s...

JML Evaluation of \old(Expression[Id])

I would like to know how a JML expression of the form \old(Expression[Id]) is evaluated, i.e. if I have the \old(vector[value-1]) expression, does the \old also refer to "value" or just the to the value of the vector[value-1]. Thanks in advance! ...

How to do file uploads via a Java applet?

Specifically how can I: Show a button which will let the user browse through his computer and select a file Show a progress bar as the files are uploaded And store the files to a location on the server of the website on which the applet is being run Any ideas? And yes, I must do this in an applet, and I will make it a trusted/signed ...

Problem with JavaMail and Exchange Server 2007 - BAD Command Argument

Hi, In the application I'm working on, there is a function that connects with a mail server via IMAP using JavaMail. One of our clients had the following stack trace: javax.mail.MessagingException: A13 BAD Command Argument Error. 11; nested exception is: com.sun.mail.iap.BadCommandException: A13 BAD Command Argument Error. 11 at com...