java

Converting a Java Keystore into PEM Format.

I am trying to convert into Java keystore file into a PEM file using keytool and openssl applicactions. But I could not find a good way to do the conversion. Any idea? Instead of converting the kaystore into PEM I tried to create a PKCS12 file first and then convert into relevant PEM file and Keystore. But I could not establish connect...

Is this scenario suitable for WeakReferences ?

I am working on querying the address book via J2ME and returning a custom Hashtable which I will call pimList. The keys in pimList {firstname, lastname} maps to an object (we'll call this object ContactInfo) holding (key, value) pairs e.g. work1 -> 44232454545, home1 -> 44876887787 Next I take firstName and add it into a tree. The node...

Idea: Embed data/DSLs in Java as comments and generate Java code with APT

I had an idea and I wanted to run it by you to get some feedback. Please look the following over and let me know what you think, whether it's positive or negative. I've always wished that there was a way to embed certain pieces of data in Java code without having to follow Java's rules all the time. I've heard a lot of talk about Domain...

Tag library?

What is the purpose of having tag library? Though we have the basic tags available which makes our work very simple, what is the reason to have a struts-html.tld. Though we can call and use the bean easily through usebean, setProperty and getProperty tags why we have struts-bean.tld. I am a newbie, so kindly clarify my doubts.. Thanks i...

Looking for documentation about scaling

What is the best documentation / articles on scaling, including: Scaling a database driven website (like ebay or amazon) Scaling a client / server architecture in C# or Java ...

Enclosing calls to debug() in if isDebugEnabled(): a good policy?

Our team has the policy of doing logging like if (LOGGER.isDebugEnabled()) { LOGGER.debug("model[" + model + "]"); } instead of simply calling the logging method like this: LOGGER.debug("model[" + model + "]"); This practice is capable of leading to some performance improvement, but on the other hand it makes the codebase more ...

Java Swing Combobox with Autocomplet and Context Menu

Hi, I have auto complete for a JCombobox working by following this article: http://today.java.net/pub/a/today/2007/07/19/adding-auto-completion-to-swing-comboboxes.html I am using the SwingX library. Now I like to add persistence support to the items in the combo box. Basically when you right click an item a context menu comes up and...

Oracle converts empty string to null but JPA doesn't update entity cache correspondingly

It's a well known fact, that Oracle treats empty strings as null. However, I'm having an issue because of this behaviour due to JPA's caching. First I persist using JPA (Toplink Essentials) an entity, which has an empty string as one field. Oracle converts this value to null when it stores it. However, when I fetch the entity, JPA see...

Resetting an arry of JButton Labels and making all active again

Hi, when i play my game i allow the user to click the buttons which then sets a o or an x as the label and then each button becomes in active as to not allow the user to clik it again and again however when i get to 9 goes and its a draw a message box pops up and says draw but i cant seem to get the buttons to restore themselves to the ...

How to override some Resources from a PropertyResourceBundle.

I have an exsisting Java/JSF website all the text on the screen is coming from property files via <f:loadBundle basename="org.example.applicaltion" var="applicaltion" /> which pulls the text from applicaltion.properties. For a runtime configurable subset of these I am wanting to pull the string from else where (CMS via web services). Lo...

Parsing an HTML file using Java

How can remove the comments and contents of the comments from an html file using Java where the comments are written like: <!-- Any idea or help needed on this. ...

Join two wav files from java ?

What's the simplest way to concatenate two wav files in java 1.6 ? (Equal frequency and all, nothing fancy) (This is probably sooo simple, but my google-fu seems weak on this subject today) ...

How to implement multiple threads in Java

How do I implement multiple threads in Java? ...

Why do I get a NameNotFoundExcpetion when using context.lookup("java:comp/env/MyBean")

Why do I get a NameNotFoundException when using context.lookup("java:comp/env/MyBean") but not when I use context.lookup(MyBean.class.getName()) ? The error reports "No object bound for java:comp/env/MyBean" How do I bind the name and why does class.getName() still work? Why would I use java:comp/env ? I'm using Netbeans 6.5, Glassfish...

What is the most efficient way to convert an int to a String?

Say I have: int someValue = 42; Now I want to convert that int value to a String. Which way is more efficient? // One String stringValue = Integer.toString(someValue); // Two String stringValue = String.valueOf(someValue); // Three String stringValue = someValue + ""; I am just curious if there is any real difference or one is be...

What does $NON-NLS-1$ mean ?

In Eclipse source code, I've found some '$NON-NLS-1$' in comments used like that : private String toolTip = ""; //$NON-NLS-1$ What does that mean ? ...

Correct way to close a socket and ObjectOutputStream? [Java]

Hi all, I am writing a networked application in Java, to communicate between the Client and the Server I am using Serialized objects to represent data/commands and sending them through object output/input streams. I am having problems cleanly closing the Connections, I assume that I am missing something fundamental that I do not really...

Java GraphViz

Is there an Open Source java alternative to GraphViz? I'm aware of the existence of Grappa which basically wraps the Graph interface to GraphViz as an JavaAPI. However the layouting is still done by the GraphViz binaries. I'm looking for a pure-java, open source library providing the same functions and layouting algorithms as GraphViz. ...

Java naming clash between method variable and package names

I have some classes generated from WSDL files by the Axis Framework. In one of these classes, there is a generated method public com.initechsystems.www.initech7.initechbo.Organization createOrganization(com.initechsystems.www.initech7.initechbo.Organization org) throws java.rmi.RemoteException { //(... snip ...) _call.setProperty(org....

Is there any good and free Date AND Time Picker available for Java Swing?

Is there any good and free Date AND Time Picker available for Java Swing? There are a lot date pickers available but no date AND time picker. This is the closest I came across so far: Looking for a date AND time picker Anybody? ...