java

JAXWS code generation and implementation along side Spring for JDK1.5

We're trying to generate source code stubs from a series of WSDLs (each with their own XSDs). We can do this fine and works perfectly under JDK1.6, however we need it to work under JDK1.5. We're using jaxws-maven-plugin to generate the source code, however it depends on the wsimport binary being available (this is not available in JDK1...

JFreeChart disable zooming

Is there an easy way to disable zoom in/out feature for XYPlot which is drawn in ChartComposite ? Overriding the zoom methods for XYPlot will be a solution but I wonder if there is an easy way.. ...

How to use join in hibernate criteria following situation

Hello, We have two tables Family and Member, the relation between these two is Family has set of members in it but member don't have any family relationship within it. I wanted get member using dob and family for that I am using Hibernate criteria API's but I am not getting how to write join query since members don't have Family insta...

Resolve class name from bytecode

Is it possible to dig up a classes name from bytecode which is formed from the class' source code? The situation is this: I get a classes bytecode remotely from somewhere, it doesn't matter where it comes from. To effectively load that class with a classloader i would need to have the class name as well... right? ...

Mail Server download help

Hi, Is there any mail server, which can use with javamail, simple in operating, having POP3, IMAP, and SMTP support? I know James, but it doesn't provide support for IMAP. Is anybody know? ...

Insert link/asset into a localized message in Tapestry 5

I'd like to insert a link (as an -Tag) and/or an Asset (as an -Tag) into localized Messages in Tapestry 5. Is there any way to generate the HTML so that I can insert it into the message, possibly via messages.format("message", link); ...

FreeMarker Editor in eclipse 3.5 giving Illegal Argument Exception

I am trying to use the freemarker editor in eclipse 3.5 Galileo and found the exception : java.lang.IllegalArgumentException: Argument not valid at org.eclipse.swt.SWT.error(SWT.java:3865) at org.eclipse.swt.SWT.error(SWT.java:3799) at org.eclipse.swt.SWT.error(SWT.java:3770) at org.eclipse.swt.custom.StyledText.setStyle...

Using Guice with OSGi

I have a project that I am trying to convert to OSGi. However, this project has been built with Guice as its dependency injection manager. It's a large project with Guice interwoven all throughout. Guice has been giving me many fits with the conversion process. Specifically, it has been given me a NoClassDefFoundError for com.google.inje...

File upload by mulitiple user

I am Uploading a file into a webserver using File upload API it works good for a single user, if multiple user upload a file simultaneously how to improve my code using threads? ...

Readable way of knowing if there is at least one difference between two Map<Long, Integer> in Java ?

I have two maps of type Map<Long, Integer>, one named "old" representing the old state of an object, and the other named "new" representing the new state of the same object. Is there a simple & readable way of knowing if the old state and the new state are different (ie. if the state has changed)? Ideally, I'd like some "java.utils" or...

How to generate unique ID's on a cluster of web servers

In the following scenario: 1 Database 4 Web servers How do the Web servers generate unique ID's for the database so that they are unique? Yes it's possible to use Auto-increment, but this is too easily crawled/guessed/etc. So auto-increment is currently not an option. ...

Java: How to wait until a screenshot is captured before taking a new one

I have written java code that captures a screenshot. User can set a time duration in seconds, e.g. 20 seconds, then after 20 seconds screenshot of current working application will be taken. Now I want to improve code by allowing user to set Number of screenshots to be captured in sec like if user sets ImageCnt=5 then 5 screenshots should...

public void add(int a, int... b) { ...

Could someone show me a practical a use of the ... array method delcaration? Is it just a way to declare an optional parameter instead of passing null value? public void add(int a, int... b) { // do something } add(1); add(1,2,3); ...

How to make generated classes contain Javadoc from XML Schema documentation

I'm currently working with an XML Schema that has <xsd:annotation>/<xsd:documentation> on most types and elements. When I generate Java Beans from this XML Schema, then the Javadoc of those Beans only contains some generic generated information about the allowed content of the type/element. I'd like to see the content of the <xsd:docume...

How to prevent JScrollPane from scroll down on repaint?

Hi, I have got a JScrollPane with a diagram inside. The paintComponent Methode of the diagram is overridden. Now when the diagram paints itself, the scrollpane scrolls down to the buttom. How do I prevent the scrolling? I want the scrollpane / scrollbar to hold its position when painting. Thanks in advance. ...

In C# could we imagine writing our own events without writing delegates?

I learned the object-oriented in Java. Now in develop in C#. This means that I never really understood the functioning of delagates but I know how to use them. Lately I discovered this page http://java.sun.com/docs/white/delegates.html. If Java is able to create event without delagates is it possible to do the same in C#? Could we imag...

What is the inclusive range of float and double in Java?

What is the inclusive range of float and double in Java? Why are you not recommended to use float or double for anything where precision is critical? ...

How to generate HTML code programatically in Java?

Is there any recommended Java library for generating HTML code programatically? For example, I'd like to do something like this: // Creates table with 1 row and 2 columns HTMLTable table = new HTMLBuilder().getHTMLTable(1, 2); // Sets the table contents table.setCell(0,0, "abc"); table.setCell(0,1, "def"); String html = table.getHTM...

Java optimization, gain from hashMap?

I've been give some lovely Java code that has a lot of things like this (in a loop that executes about 1.5 million times). code = getCode(); for (int intCount = 1; intCount < vA.size() + 1; intCount++) { oA = (A)vA.elementAt(intCount - 1); if (oA.code.trim().equals(code)) currentName= oA.name; } Would I see significant in...

How to allocate the memory from OS instead of increasing the JVM’s heap size?

I need to detect whether the file I am attaching to an email is exceeding the server limit. I am not allowed to increase the JVM heap size to do this since it is going to affect the application performance. If I don’t increase the JVM heap size, I will run into OutOfMemoryError directly. I would like to know how do allocate the memory...