java

generate java domain objects from database table

may i know in eclipse, is there any feature that will auto generate domain objects with all table relationship properly mapped in class? can provide me with some reference articles on this? ...

Maven, Proguard and assembly issues

I'm trying to get Maven working with ProGuard. What I want to achieve is the following: Run ProGuard over my source files and produce obfuscated classes Create a manifest file that references the main class so that I can execute it as a jar Unpack all of the associated library jars and create one huge jar containing them all. This fi...

increase the java heap size permanently?

Is there a way that I can set the default heap size for the jvm on my own computer? I want to set it to 1g, because I'm always running custom programs that always hit the overage point in the default jvm size. I just dont want to have to remember to type -XmX1g everytime I run my java app from the command line... There has to be an ...

How to read huge data in socket and also write into socketchannel

How to read a very big data using DataInputStream of socket If the data is in String format and having a length of more than 1,00,000 characters. Also How to write that big data using SocketChannel in java Thanks Deepak ...

Top down and Bottom up programming

Hi all, Why do we say language such as C is top-down while OOP languages like java or C++ as bottom-up?. Does this classification has any importance in software development? Thanks. ...

How to invoke a method at runtime from a jar file

I have multiple jar files at a specific location.Based on some calculation ,i need to load different jar files and invoke a certain method inside the jar. The jar file contains methods that act as a client to web services. When i invoke the method using reflection, it throws an error Wrapper class not found.Have you run APT to generate...

Soap body is utf-8 encoded twice

We use a web service which expects UTF-8. The framework we use on the client is Apache Axis2. We call the web service and the soap body contains strings in UTF-8. The problem is that it seems like the body is "double encoded". I.e we have the character 'å'. The utf-8 representation of 'å' in utf-8 is C3 A5 however we see in our logs that...

How to modularize a (large) Java App?

I have a rather large (several MLOC) application at hand that I'd like to split up into more maintainable separate parts. Currently the product is comprised of about 40 Eclipse projects, many of them having inter-dependencies. This alone makes a continuous build system unfeasible, because it would have to rebuild very much with each chec...

Extending JPA entity data at runtime

I need to allow client users to extend the data contained by a JPA entity at runtime. In other words I need to add a virtual column to the entity table at runtime. This virtual column will only be applicable to certain data rows and there could possibly be quite a few of these virtual columns. As such I don't want to create an actual add...

Looking a data structure that is a Map but in which keys can be values, values can be keys

A Map maps from keys to values and provides quick access based on the knowledge of the key. Does there exist a data structure like Maps which supports both key to value and value to key access? Sometimes I may want to derefence the Map via the value, while other times by the key. ...

Trouble accessing Java classes from Firefox extension's Javascript

I'm going to develop a Firefox extension which uses some Java classes. The extension gets the value of <input type="file"> fields, using Javascript. The Java class I'm going to create is the following: public class Firefox { public static String inFileName; public static void main(String[] args) throws IOException { in...

Generating 128-bit keys with keytool

Is there a way to generate a 128-bit key pair suitable for encryption using Sun's keytool program? It seems that the algorithms available in http://java.sun.com/javase/6/docs/technotes/guides/security/StandardNames.html#KeyPairGenerator are either not supported or do not allow keys shorter than 512 bits. The key pair will be used with ...

Swing: Adding listener to a component and ALL its decoration?

Hello! Can I add a listener (let's say MouseAdapter) to a Swing component and all it's internal decoration components? So that when a JInternalFrame is moved by the mouse (by dragging its window title bar), it would give me following events: mousePressed event, mouseDragged event, mouseReleased event. Currently, I receive none of t...

Is php very limited?

Hello, I've tried asp.net and jsp...and the programming language was powerful enough to create both desktop and Windows apps. Butwhat can I possibly do with php other than creating web applications? Does it have some kind of runtime or framework? Thanks ...

Copy one xml document to another using DOM

Hi guys, this is my situation: I have two org.w3c.dom.Document created from two xml files. What I want to obtain is brand new Document containing all the data of the two xml Document. Do you have any idea on how to do this? Thanks! Rob ...

Combining TimeItem and DateItem values

I have to combine the time value for TimeItem and date value from DateItem in smartgwt.In output I want the date object for java.util.Date.I tried to combine these two.I couldnot do that. Sample code is : DateItem date=new DateItem(); TimeItem time=new TimeItem(); DynamicForm form=new DynamicForm(); form.setFields(date,time); // java....

Is it possible to persist a DSL Java object with JPA?

I have a DSL Java object, i.e. a POJO which returns this in setters plus the getters/setters have an unusual naming pattern: public class Demo { private long id; private String name; private Date created; public Demo id (long value) { id = value; return this; } public String id () { return id; } public Demo name...

Web UI Framework for Configuration

I am looking for a UI Framework that supports the following features: Integrated with Apache Commons Config and/or JFig Supports nested tabs Understands users/groups/roles Can interact with JMX MBeans Doesn't require Javascript in order to function Written in Java and ideally JSP-based ...

structured/combined logging with Log4J

Hi fellow geeks, I hope you can help me. I have a web service that needs to log transactions. Since there are many hits, the log statements appears disjoint/fragmented in the log file. I've considered passing a StringBuilder instance through-out the layers and appending the statements to this instance, then I log its contents once at t...

What are the common mistakes that causes the code in Java is not thread safe?

Duplicate: What is the most frequent concurrency problem you’ve encountered in Java? I've been thinking of list of common programming mistakes/pitfalls that causes the code in Java is not thread safe. Here are the common ones that I encountered in the code through the recent years of Java development. Using non-static fields within ...