java

Inserting text into an existing file via Java

Hello, I would like to create a simple program (in Java) which edits text files - particularly one which performs inserting arbitrary pieces of text at random positions in a text file. This feature is part of a larger program I am currently writing. Reading the description about java.util.RandomAccessFile, it appears that any write ope...

Recommended framework for Java Web Services

With an abundance of frameworks and stacks for Java Web Services (Axis2, Spring WS, CFX, Metro, ...), which one should be selected for new projects? What are the pros and cons for each one? How well have they worked for you? See related Q here ...

Convert to date

Hi, I'm trying to create number of Evenement instances and set the date for them: for (int i=2004; i<2009; i++){ evenementen.add(new Evenement("Rock Werchter", "Rock", "Werchter", 200000, (Date)formatter.parse(i+"/07/03"))); But I can't seem to get it to work, Any ideas? ...

Graduate scheme for UK CS Student

Hi, I have recently graduated from University with a 1st class computing science degree and I'm looking to get work as a programmer (Java or C#). I am looking for opinions / recommendations regarding any UK (Preferably Yorkshire area) graduate schemes which offer good experience, pay, etc... Many many thanks. ...

Is there a database modelling library for Java?

Does anyone know of a Java library that provides a useful abstraction for analyzing and manipulating arbitrary relational database schemata? I'm thinking of something that could do things like LibraryClass dbLib = ...; DbSchema schema = dbLib.getSchema("my_schema"); List<DbTable> tables = schema.getTables(); and DbTable myTable = .....

Sliding Notification bar in java (a la Firefox)

I would like to implement a sliding notification bar as the one in Firefox or IE for my java application. But I don't want to reinvent the wheel and I'm sure someone out there has already done it and is willing to share. Do you know any open-source implementation of this in java/swing? ...

Java System.currentTimeMillis() equivalent in C#

What is the equivalent of Java's System.currentTimeMillis() in C#? ...

how can i leave out fields from an axis2 soap response?

Hello. I have an Axis2 Web Service that requests the status of some objects. The objects can either exist on the server, or not exist. The web service is implemented with POJOs, and the wsdl is generated with java2wsdl tool. Lets say the relevant part of the SOAP response looks like this: String int int Strin...

StAX XML formatting in Java

Is it possible using StAX (specifically woodstox) to format the output xml with newlines and tabs, i.e. in the form: <element1> <element2> someData </element2> </element1> instead of: <element1><element2>someData</element2></element1> If this is not possible in woodstox, is there any other lightweight libs that can do this? ...

Java Application Server Performance

I've got a somewhat dated Java EE application running on Sun Application Server 8.1 (aka SJSAS, precursor to Glassfish). With 500+ simultaneous users the application becomes unacceptably slow and I'm trying to assist in identifying where most of the execution time is spent and what can be done to speed it up. So far, we've been experim...

How to automatically copy data to new RMI threads ?

Hello, I am adapting a little rmi client-server application. I have written several things : HelloInterface -> A Hello World interface for RMI Server -> The server app' Client -> The client app' Nothing special, but... I have put my hands in a new RMISecurityManager, which calls a JNI method and checks the permission for a separate us...

JAX-RPC, Spring web services, and UnsupportedOperationCallException

I have a JAX-RPC web service that I am attempting to consume using Spring. This is my first time using Spring to consume a web service, so right now I'm just trying to get it to integrate with the JAX-RPC web service as a test. The web service has several dozen operations in it, but for right now I only care about one. Here are the inte...

Using Java 6, on linux how can I make sure to use an ipv4 socket?

I'm trying to write a quick little java application to read the contents of a pcap file (from Wireshark) and play the data back on the network on a linux box. The file will only contain UDP broadcast packets, so my application only really needs the timestamp, port number, and data from the packet to do what I need. My problem is that t...

Examples for creating stub data structures with dynamic JVM Languages ?

Over the years, I think I have seen and tried every conceivable way of generating stub data structures (fake data) for complex object graphs. It always gets hairy in java. * * * * A---B----C----D----E (Pardon cheap UML) The key issue is that there are certain relationships between the values, so a certain instance of C m...

Can you register an ActiveX dll in Java programmatically?

I have a third-party ActiveX dll, and I'd like to register it programmatically at run time, if possible. Can this be done in Java? The application I'm working with is an Eclipse application on Windows XP. ...

How do I redirect terminal output from a C program to System.out with JNI?

I am invoking a C library via JNI that prints to stdout. How can I redirect this output to System.out? ...

What is the reason behind "non-static method cannot be referenced from a static context"?

The very common beginner mistake is when you try to use a class property "statically" without making an instance of that class. It leaves you with the mentioned error message. You can either make the non static method static or make an instance of that class to use its properties. Why? I am not asking for solutions. I would be grateful...

Using ActiveMQ 5, is it possible to configure the broker with in memory and network connections?

We have a set of applications that I want to use JMS for messaging between. Right now, our applications all make TCP connections to the ActiveMQ broker. Is it possible to make the 15 or so applications that are on the same host use the inVM connections or use a form of shared memory while the remaining 20 or so applications that are of...

Java Class Type

I have a block of code that works and I wanted to ask what exactly is happening here? Class<?> normalFormClass = null; ---added--- The wildcard "<?>" is the part that is confusing for me. Why would this be used rather than not using it (generics)? ...

differences between 2 JUnit Assert classes

Hi, I've noticed that the JUnit framework contains 2 Assert classes (in different packages, obviously) and the methods on each appear to be very similar. Can anybody explain why this is? The classes I'm referring to are: junit.framework.Assert and org.junit.Assert. Cheers, Don ...