java

Create history of states in Java

Hi All, I need to save a history of states over a few actions in a Java application, which I can later reload in order to restore the state at a certain action. In other words I have a screen which has a state associated with it and I need to store it as well as any changes in a history so that I can restore the state of the screen at a...

Mapping CSV to a Model

I am writing a simple CSV to XML processor in Java. I am using JAXB to generate a model in java from a DTD. I need to process the CSV format into this model, and then marshall it into the XML that complies to the DTD. I am using JAXB to marhall the data from the Java model to the XML. I have to write the CSV-Model mapping myself. At th...

How can I successfully extend Graphics in Java

I'm trying to create a generic graphics export tool which works by implementing the Graphics interface and intercepts and interprets the calls to its various methods. However although I can do this successfully for a single component my Graphics class is being replaced when I use it on a component which contains other components. Stran...

Connectivity to mainframes using JMS

We are currently using WebSphere MQ to fetch data from mainframes and at times face issues on the MQ side. I would like to know if there is someway to circumvent MQ and use JMS instead to fetch data from mainframes. We use WebSphere Application Server 6.0.2. ...

Specify authentication in container rather than web.xml

We distribute our web-application to our customers as a .war file. That way, the user can just deploy the war to their container and they're good to go. The problem is that some of our customers would like authentication, and use the username as a parameter to certain operations within the application. I know how to configure this using...

Web Service using Axis 2: Complex type or simple type parameters?

The question is a specialization of: http://stackoverflow.com/questions/403058/oo-style-parameters-vs-type-parameters What if you want to define a Web Service operation? To have parameters beeing passed as complex types like this public String insertPerson(Person person); seems pretty cool since you're able to change the definition...

Java - Distributed Programming, RMI?

I've got a doozy of a problem here. I'm aiming to build a framework to allow for the integration of different traffic simulation models. This integration is based upon the sharing of link connectivities, link costs, and vehicles between simulations. To make a distributed simulation, I plan to have a 'coordinator' (star topology). All pa...

java: retrieve bytecode from in-memory to prevent hacking

How can i retrieve the bytecode and make a hash to see if someone has manipulated with my bytecode in-memory or on file? EDIT: Does signing the binaries protect the code from being modified and executed? As much as I want to protect my users from making sure they are running my software. I would also like to protect the program (server)...

Lightweight Webservice producing in Java (without an application server)

Is there any Java library allowing to build a simple standalone webservice server without any application server framework? ...

How can I change the Javahelp font?

Javahelp is the Java based help system that can easily be integrated in a Java application. The documentation does not give any information about it. On the web, many people state that it is not possible, that the help browser always uses a built-in font. I am not convinced that it is not possible. The help system of the IntelliJ IDE is...

Question about "*" in regular expression

Java: String result = "B123".replaceAll("B*","e"); System.out.println(result); The output is: ee1e2e3e Why? ...

Active MQ vs JBoss Messaging

I am going to choose a JMS message broker for a project. It is critical that the JMS server is stable and can handle a high load of messages. I have narrowed down the list to include Active MQ and JBoss Messaging. I was wondering if any of you have any experience with any of these or even better have tried both of them in the same env...

Java - Capturing System.err.println or Capturing a PrintStream

Hi Java Newbie question : I need to capture the text being written to a printStream by a 3rd party component. The PrintStream is defaulted to System.err, but can be changed to another PrintStream. Looking through the docs, I couldn't find an easy way to direct the contents of a PrintStream to a string writer / buffer. Can someone pl...

Is Spring too complex for JDBC operations?

Just been looking at the Spring framework for JDBC - it looks like there is a bit of a learning curve - and I'm still not able to find a nice up to date quick start Spring/JDBC tutorial of any quality! Is there something lighter than Spring for basic JDBC operations - or has anyone got any good links for tutorials Many thanks ...

Why does Grails need Xerces?

We had in a grails-project problems with different XML-libraries clashing. The solution was to delete xercesImpl.jar from $GRAILS_HOME/lib. Grails does work well without it. So my question is, why was the xerces-library in the grails-distribution in the first place? ...

How to Initialise a static Map in Java

How would you initialise a static Map in Java? Method one: Static initialiser Method two: instance initialiser (anonymous subclass) or some other method? What are the pros and cons of each? Here is an example illustrating two methods: import java.util.HashMap; import java.util.Map; public class Test { private static final Map<In...

Problem with FTPClient class in java

I'm using org.apache.commons.net.ftp.FTPClient and seeing behavior that is, well... perplexing. The method beneath intends to go through an FTPFile list, read them in and then do something with the contents. That's all working. What is not (really) working is that the FTPClient object does the following... 1) Properly retrieves and st...

Java serialization and instance sharing using remote services

I'm currently thinking about some design details of remoting / serialization between a Java Swing WebStart Application (Fat Client) and some remote services running on Tomcat. I want to use a http compatible transport to communicate with the server and since I'm already using Spring, I assume Spring's HTTP Remoting is a good choice. But ...

How to use string for TcpClient in C# instead of byte?

In C# I try to send a string through TcpClient as such: byte[] outputOutStream = new byte[1024]; ASCIIEncoding outputAsciiEncoder string message //This is the message I want to send TcpClient outputClient = TcpClient(ip, port); Stream outputDataStreamWriter outputDataStreamWriter = outputClient.GetStream(); outputOutStream = output...

How can I make Java3D start faster?

My application takes several seconds to show the first window with a Canvas3D in it. I've profiled it and found that the bottleneck is in SimpleUniverse.getPreferredConfiguration(); the first call takes three or four seconds, and it must be called before the scene can be rendered. I'm using the Direct3D renderer (-Dj3d.rend=d3d), becaus...