java

Java web start w/ SSL deployed in Glassfish

I've been trying to set up SSL for our Java EE application clients deployed in Glassfish (with Java web start), but after some reading I reached this page: Does someone has any experience trying to achieve the same thing as me? I've also considered JBoss, but Glassfish works really neat with Netbeans etc, and we really don't want to cha...

Java and J2EE code examples for 3-tier apps

Do you know a site that offers a tutorial with sample source code for a 3-tier application (the usual data access layer, business layer and UI layer)? The simple, readable and intuitive the source code. Best practices that are applied to the code are welcome as well. ...

Using ServletOutputStream to write very large files in a Java servlet without memory issues

I am using IBM Websphere Application Server v6 and Java 1.4 and am trying to write large CSV files to the ServletOutputStream for a user to download. Files are ranging from a 50-750MB at the moment. The smaller files aren't causing too much of a problem but with the larger files it appears that it is being written into the heap which is...

Is there a way to override class variables in Java?

Hi, class Dad { protected static String me = "dad"; public void printMe() { System.out.println(me); } } class Son extends Dad { protected static String me = "son"; } public void doIt() { new Son().printMe(); } The function doIt will print "dad". Is there a way to make it print "son"? Thanks! Dikla ...

Generic classes in Java (type-safely) depending on each other

Hello! I want to create an abstract collection class (called Space) and an abstract element class (called Atom). Instances of both have to know each other (exactly typed). That's the problem. abstract class Space<A extends Atom>{ // ... } abstract class Atom<S extends Space>{ // ... } Not good: "A extends Atom" means any Atom, ...

How to connect .Net app to JMX agent?

I need to connect my .Net application to somebody else's JMX agent. I've read that this is simply not the done thing and I should use soap or practically anything else. As this is just not going to happen, are there any libraries or interop techniques out there that can help me? I'm only interested in the simple things like invoking a re...

Multiline text in JLabel

How can I make the text of a JLabel extend onto another line? ...

Using private static methods

What do you think about using private static methods? Personally, I prefer using a static private method to non-static as long as it does not require access to any instance fields. But I heard that this practice violates OOP principles. Edit: I am wondering from style prospective of view, not performance. ...

Problem extending jog4j RollingFileAppender rollOver() access Level

Hello All I am trying to extend RollingFileAppender so that it will rotate even when no messages are coming into the logging system. Normally the rollOver method is called when a message arrives and a time check is done to trigger the rotate. My Version of RollingFileAppender will call rollOver every x seconds so that I am guaranteed a...

Windows process exec'ed from Java not terminating

I'm creating a process on Windows from Java. My problem is that this process doesn't terminate. Here's a sample program: import java.io.IOException; public class Test { /** * @param args * @throws IOException * @throws InterruptedException */ public static void main(String[] args) throws IOException, InterruptedException { Proc...

Anyone have experience with Eclipse GMF?

I've just started to play around with Eclipse GMF. Has anyone used the framework? Any good or bad experiences you made using it? Any alternatives for graphical modeling you could suggest? EDIT: What good examples are available? ...

What data structure should I use to keep track of recently used items?

I need something like a bounded queue where I can only insert say 10 elements. A new element should override the last inserted element. There should be only n distinct elements I am looking for suggestions in Java by the way. ...

Java on OpenVMS?

We run batch files on our OpenVMS Alpha and Integrity servers. Up until now they have been written in COBOL. As you can imagine there are many reasons why will not be able to maintain that process. At the same time we have a team of developers that use Eclipse and know Java very well. Is there away to use Eclipse with OpenVMS? ...

ANT Incremental build numbers (zip)

Hi, I'm doing a project at uni and would like to create zip files which name (just a build number) increments after each successful build. What's the easiest way to do this? Is it a case of having to write a custom task or is there some built in functionality that will allow me to do this, simply and easily? I did have a look at the Z...

How can I debug applications under Java Web Start (JNLP) ?

I know how I can debug a remote Java VM with Eclipse. Bit how can I do it with a Java Web Start program. I have a problem that only occur in Java Web Start. It must be security related. I need a solution that work with a current Java VM like 1.6.0_12. ...

In Java, are static class members shared among programs?

I imagine that no, they aren't, because every process has its own memory space, of course. But how does the whole JVM thing actually work? Is there a separate JVM in a separate process for every Java program that I launch? Do Java programs running in a system share anything at all? Are there differences between OSs and JVM implementatio...

What are the fundamental differences between Java and C# in terms of inner/local/anonymous classes?

What are the fundamental differences between Java and C# in terms of inner/local/anonymous classes? ...

Regex to find strings contained between separators

in this text : text text text [[st: aaa bbb ccc ddd eee fff]] text text text text [[st: ggg hhh iii jjj kkk lll mmm nnn]] text text text I'm trying to get the text between the [[st: and that ends with ]] My program should output: aaa bbb ccc ddd eee fff (first match) ggg hhh iii jjj kkk \n lll mmm nnn(second match) But I can on...

How does Apache Ivy resolve the variables in artifact patterns provided in the ivysettings.xml file?

If my ivysettings.xml file includes: <url name="com.springsource.repository.bundles.external"> <ivy pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> <artifact pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]...

Java: Quickly read the last line of a text file?

What's the quickest and most efficient way of reading the last line of text from a [very, very large] file in Java? ...