java

Oracle SQL Developer not responsive when trying to view tables (or suggest an Oracle Mac client)

I just get the beach ball all day long (it's been doing nothing for hours). It's not taking CPU, not reading from disk, not using the network. I'm using Java 1.6 on Mac OS X 10.5.4. It worked once, now even restarts of the computer won't help. Activity Monitor says it's "(Not Responding)". Only thing that I can do is kill -9 that sucker...

If you have a Java application that is consuming CPU when it isn't doing anything how do you determine what it is doing?

I am calling a vendors Java API and on some servers it appears that the JVM goes into a low priority polling loop after logging into the API (cpu 100%). The same app on other servers does not exhibit this behavior. This happens on WebSphere and Tomcat. The environment is tricky to setup so it is difficult to try to do something like pr...

How can I refactor HTML markup out of my property files?

I've recently inherited a internationalized and text-heavy Struts 1.1 web application. Many of the JSP files look like: <p> <bean:message key="alert" /> </p> and the properties files look like: messages.properties alert=Please update your <a href="/address.do">address</a> and <a href="/contact.do">contact information</a>. with ...

Are there any good Java blogs around?

My news reader is full of good web development blogs but I would really like to have some good quality Java blogs to read. I'm sure they must exist so can anyone help me out? ...

How can I permanently have line numbers in IntelliJ?

How can I permanently have line numbers in IntelliJ? ...

Parsing search queries in Java

Hi, I have been trying to find an easy way to parse a search query and convert it to an SQL query for my DB. I have found two solutions: Lucene: Powerful Java-based search engine, contains a query parser but it isn't very configurable and I could find a way to easily hack/adapt it to create SQL queries. ANTLR: A veteran text lexer-pa...

When should a multi-module project to split into separate repository trees?

Currently we have a project with a standard subversion repository layout of: ./trunk ./branches ./tags However, as we're moving down the road of OSGi and a modular project, we've ended up with: ./trunk/bundle/main ./trunk/bundle/modulea ./trunk/bundle/moduleb ./tags/bundle/main-1.0.0 ./tags/bundle/main-1.0.1 ./tags/bundle/modulea-1.0....

Java: What is the best way to SFTP a file from a server

What is the best was to retrieve a file from a server using SFTP (as opposed to FTPS) using Java? I'll leave the particular definition of best up to you but in my mind it should include free :) ...

Please recommend a Java profiler

I am looking for the Java equivalent of gprof. I did a little Java profiling using System.getCurrentMillis(), and saw several GUI tools which seem too much. A good compromise could be a text-based Java profiler, preferably free or low-cost, which works in either Windows XP or Linux. ...

How can I override an EJB 3 session bean method with a generic argument - if possible at all?

Suppose you have the following EJB 3 interfaces/classes: public interface Repository<E> { public void delete(E entity); } public abstract class AbstractRepository<E> implements Repository<E> { public void delete(E entity){ //... } } public interface FooRepository<Foo> { //other methods } @Local(FooRepository....

Taking the SCJP exam

What do you think about taking the Sun Certified Java Programmer (SCJP) exam? I think it's an essential requirement to learn the Java language properly. Without it silly programming mistakes are made as a direct result of poor understanding of the language's inner workings. Agree? ...

JNI and Java: ant calling make or make calling ant?

I'm just about to make my first trip into the world of JNI (Java Native Interface) to provide file system change notifications from platform specific C/C++ code to Java. That is unless someone suggest some brilliant library for doing this that I've missed. Being new to JNI I've managed to find much documentation on the interface side of...

Java Coding standard / best practices - labeled break/continue

Sometimes a labeled break or continue can make code a lot more readable. OUTERLOOP: for ( ;/*stuff*/; ) { //...lots of code if ( isEnough() ) break OUTERLOOP; //...more code } I was wondering what the common convention for the labels was. All caps? first cap? ...

Hidden Features of Java

After reading Hidden Features of C# I wondered, What are some of the hidden features of Java? ...

Can you really build a fast word processor with GoF Design Patterns?

The Gang of Four's Design Patterns uses a word processor as an example for at least a few of their patterns, particularly Composite and Flyweight. Other than by using C or C++, could you really use those patterns and the object-oriented overhead they entail to write a high-performing fully featured word processor? I know that Eclipse ...

How do you begin designing a large system?

It's been mentioned to me that I'll be the sole developer behind a large new system. Among other things I'll be designing a UI and database schema. I'm sure I'll receive some guidance, but I'd like to be able to knock their socks off. What can I do in the meantime to prepare, and what will I need to keep in mind when I sit down at my ...

Good Stripes tutorials / examples?

The company I just started working for is using Stripes for parts of its web page development these days, and while it seems to be a nice enough web framework it no one really uses it-- it is almost non existent on the 'net. It's not even first in it's google search and the result you do get is for its old home page. So, do any of you p...

What's the best way to validate an XML file against an XSD file?

I'm generating xml files that need to conform to an xsd that was given to me. What's the best way to do this? ...

Refactoring away labeled loops.

After I was convinced that labeled breaks/continues are a total "nono" over here, I need help to remove the label out of my code. I have a square matrix and a vector that has the same length. The vector has already some values in it an depending on the values in the matrix the vector is changed in the loop. I hope, the code-fragment is...

insert/replace XML tag in XmlDocument

I have a XmlDocument in java, created with the Weblogic XmlDocument parser. I want to replace the content of a tag in this xmldocument with my own data, or insert the tag if it isnt there. <customdata> <tag1 /> <tag2>mfkdslmlfkm</tag2> <location /> <tag3 /> </customdata> I for example want to insert some url in the locati...