java

Measuring the Size of HttpSession object

Is there a clean and easy way to measure it other than programatically measuring the size of each data type (that each object is composed of) stored in session? ...

maven import a project to eclipse Mylin with WTP features enabled

I need to import a maven project with WTP features enabled I allready tried: mvn -Dwtpversion=R7 eclipse:eclipse But when I did the import it doens't have the WTP features enabled. ...

What is the difference between c++ dynamic binding and java dynamic binding?

What is the difference between c++ dynamic binding and java dynamic binding? ...

Can anyone help with my 2 Java issues I have. 1 is try catch 2 is where to put a piece of code.

I have a piece of coding I am working on for an assignment for uni and in truth I'm not that great with Java, but I have tried. I'm trying to get my try catch to work but it never seems to do what it is suppoes to. I think I have the exception wrong but I'm not sure which exception to use for the problem as I am trying to stop letters b...

Algorithm to move messages from inbox to junk folder

Hi, I wonder how sites like yahoomail or gmail move the messages, which we click as spam into the spam folder. As far as I concerned Bayesian analysis algorithm checks the messages, if it is spam based on content, or some other probability. But what algorithm do these sites(yahoomail or gmail) use to migrate the message from one folder ...

payment system intergration for custom epos software

Hi I'm trying my hand in the food industry. I'm going to be developing my epos system in house. All the fancy touch screen systems cost an arm and a leg. I was wondering what are my options if I wanted to integrate a chip and pin device as well? Could I use something like paypal? I doubt supermarkets use such a system though. ...

Row from a database as string (JDBC)

Is there a direct method to get the all the elements in a row from the ResultSet as String? JDBC ...

What should qualify as a "long running task" to be executed in a SwingWorker thread ?

I know how to use SwingWorker threads, but I still don't have precise criteria to decide when to use one or not. I/O seems obvious, but what about methods operating on potentially large collections ? A criterion could be the actual running time, but what kind of number (in ms) would qualify ? ...

Is it possible to have 2 JPanels in a Border layout at the same location?

Hi All, I'm writing a game which uses a border layout with a JPanel using BorderLayout.CENTER. What I'd like to be able to do is sometimes hide this panel and replace it with another panel with different information. I added both to the container and set visibility of one of them to false. Then later I try: panel1.setVisible(false)...

what is permsize in java

I was going through the document in Java Memory Management and in that I came across PermSize which I couldn't understand. The document says that it stores "JVM stores its metadata" but I couldn't exactly get what is meant by MetaData. I was googling and somewhere I read it stores value object( User defined object). Can any one explai...

Is this (Lock-Free) Queue Implementation Thread-Safe?

I am trying to create a lock-free queue implementation in Java, mainly for personal learning. The queue should be a general one, allowing any number of readers and/or writers concurrently. Would you please review it, and suggest any improvements/issues you find? Thank you. import java.util.concurrent.atomic.AtomicReference; public cl...

Is there a tool for Java similar to Microsoft's CHESS?

Is there an existing tool for Java that is similar to Microsoft's CHESS? Or is the CHESS source code open, so that I might try to convert it into Java? ...

Can I use a single war file in multiple environments? Should I?

I have a Java web application at my work and I'd like simplify how we deploy to our DEV, QA, and PROD environments. The application reads in a series of properties at startup, and the properties files are different for dev, qa, and prod. Whenever I want to deploy to a certain environment I drop the environment-specific properties fi...

Java mouse operations

I am writing a game in Java, and need to have mouse interaction. I was going to use MouseAdapter, but I've looked into it some, and it does not seem to have any means of determining the location of the mouse pointer without a click or action being done... What would be the recommended way of doing this? A couple questions: Would the m...

Web service logging not outputting, but not failing

I'm having trouble finding/getting any logging output from a web service. I have a web service running through axis2 in a Tomcat6 container, the .aar file contains this structure: root/ log4j.properties lib/ slf4j-api.jar slf4j-log4j12.jar log4j-1.2.jar com/ all of my classes META-INF/ ...

Mouse movement optimizations

I want to have a game where the view will move around as the mouse reaches the outer edge of the window (similar to many RTS games). I have read that there is significant overhead when using the MouseMotionListener. Is there perhaps a way of having a second transparent component within the game window (JPanel) that does not affect game-...

Transaction between several DAO layers ?

As shown below, I am accessing a Service layer method inside of another DAO. (Every DAO in the system is implemented using HibernateDAOSupport class) I wanted to rollback the transaction when #1 or #2 (commented in the following code) is failed. But when #2 throws an exception, #1 does not get rolled back and I can see the entries in th...

SQLite dialect error with Hibernate

I have been trying to use the hibernate dialect for SQLite from http://code.google.com/p/hibernate-sqlite/ in a project, but have hit a problem with something like the following... SQLQuery query = session .createSQLQuery("select id from collection where collection = (:collection_name);"); query.setParameter("collection_name", col...

Adding Java Annotations at Runtime

Is it possible to add an annotation to an object (in my case in particular, a Method) at runtime? For a bit more explanation: I have two modules, moduleA and moduleB. moduleB depends upon moduleA, which doesn't depend upon anything. (modA is my core datatypes and interfaces and such, modB is db/data layer) modB also depends on extern...

how to set default main class in java?

I have 2 class within same package.Both classes have main method in them. Now i want to build a jar file.I want to build 2 jar files which uses different main function as default main. eg class A { public static void main(String args[]) { //do something } } class B { public static void main(String args[]) { //do s...