java

JUnit Return int value

My Junit test should check that the number being returned is the same as the list size if my test was as follows would this be coded properly, i feel it isnt because i the last 2 lines are always going to be true? public void testGetTotalPilots() { ArrayList<Pilot> list = new ArrayList<Pilot>(); int size = list.size(); as...

How do I store a picture in MySQL?

I want to store an image in a MySQL database. I have created a table with a BLOB datatype, but now how do I store the image in this table? ...

Optimizing XML response of web service

In performance tests of our web service we found out that the traffic generated by the response exceeded our expectations a lot. We are querying the database and loading lists consisting of rows and columns. The type of the column is AnyType so the in the response there needs to be a type information. Therefor the web service engine (A...

How to create background process in spring webapp?

I want to run background process in parallel with my spring-mvc web-application. I need a way to start in automatically on context loading. Background process is a class that implements Runnable. Is spring-mvc has some facilities for that? ...

Can you recommend an easy to use easy to develop CMS?

We need some easy way to manage web sites at our company, and we are evaluating some CMS tools for this purpose. We do not yet know what features the sites will need to have (but it will definitely be something with lots of functionalities), so we are looking for something with lots of features and more importantly to be easily extensi...

innosetup problem

i want to put the prerequisites using the script in innosetup how can i do it and when i have developed the setup using innosetup the desktop icon created is not going to launch the application. what to do plz help me ? thanks in advance. ...

SSLSockets and problem with Cipher Specs

Hi I'm trying to get my java client to communicate with a C server using SSL. The problem is - I don't have any server sources and I'm getting a handshake failure error: Exception in thread "main" javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure at com.sun.net.ssl.internal.ssl.Alerts.getSSLException...

NETBEANS find method calls

In netbeans how can i find out where methods are being called - i have one particular method in a big project ad cant find where its being called thanks ...

java analog to C# SqlConnection and data access layer (my attempt)

I'm trying to work with java data access, so this with what I came up with: Tell me what do you think about this (It's a little bit like SqlConnection from C#) import java.sql.*; public class SqlConnection { Connection connection; public Connection GetConnection() {return connection;} public void Connect(String cs, Strin...

hibernate search + spring3 + jpa

I'm trying to integrate hibernate search in my project. My models are indexed, but for some reason my search queries do not return any results. I've been trying to solve this issue for a few hours now, but nothing I do seems to work. Domain object: @Entity @Table(name = "roles") @Indexed public class Role implements GrantedAuthority { ...

Problem with Rich faces panelBar ?

I am using rich faces panel bar control in my application. There some problem with the control. The code is some thing like this <rich:panelBar contentClass="some-class"> <rich:panelBarItem label="Panel 1" headerClass="some-css-class"> Contents 1 </rich:panelBarItem> <rich:panelBarItem label="Panel 2" headerClass="some...

String[] array variable shows a null value although I am setting a value to it.

I have a string variable static String[] genrename; I am assigning values to it in one of my method and then displaying its content. It does store the value fine. But when I am accessing the String variables directly or from a getter method(). It shows a null value in the string. Any ideas? public class GenreParsing { static int...

[Java] Get a file inside a specifc package

Hi, I've a java package (package A) and I would retrieve a file contained into another package (package B)? How could I do this? Thanks in advance. Best regards. ...

Java Access Denied

C:\Program Files (x86)\Java\jdk1.6.0_17\bin>javac VendingMachine.java VendingMachine.java:27: error while writing VendingMachine: VendingMachine.class (Access is denied) public class VendingMachine ^ 1 error Here is the code from my editior from line 27 to 39: public class VendingMachine /*This is line 27*/ { private int it...

java getting to see the user input side

Okay given this: javac is the java compiler. It compiles the file, but has no output if there are no warnings or errors. What can I use to view the file from a user's perspective- user is suppose to see a vending machine that allows them to buy certain stuff from vending machine.java, apparently just running javac somevendmachi...

Java Casting Problem

Why isn't a Map<String,List<SomeBean>> castable to Map<String,List<?>>? What I'm doing now is this: Map<String, List<SomeBean>> fromMap = new LinkedHashMap<String, List<SomeBean>>(); /* filling in data to fromMap here */ Map<String,List<?>> toMap = new LinkedHashMap<String, List<?>>(); for (String key : fromMap.keySet()) { toMap....

Mathematical Expression evaluation preferably without using stacks or queues

Given the allowed operators of +, /, -, *, and given a user inputted list of single digit numbers (any length allowed), how can I output all possible combinations of mathematical expressions (and the resulting values) that can be formed with the numbers and the given constant set of operators? Also to allow for scalability, for example,...

Can a LABEL block be used without loop?

Any example please? ...

Credit Card processing without Google Checkout / Amazon / Paypal

Hi all, If I would like to process payments directly without going through Google / Amazon / Paypal, how would I go about that? Is there a Java API or some reference implementation that shows how to do such a thing or is it really that large and complicated that I need to choose a provider such as Google or Amazon? I currently use Goo...

Java Inheritance

Hello, I have a question regarding inheritance in Java. If I have this base class class Parent { private String lastName; public Parent() { lastName = "Unassigned"; } public String getLastName( ) { return lastName; } public void setLastName(String name) { lastName = name; } } And...