Questions tagged as 'java'

2
answers

I made a client / server socket application but it only works with the emulator

I made a client / server socket application, where the client is a device with android and the server is done in java. At the beginning this is all ok, in the emulator it runs correctly, but when I install the apk on the cell it does not work, i...
asked by 06.04.2014 / 23:11
1
answer

Problem with JPA [closed]

Classes and persistence.xml below. The problem is: entityManager is coming NULL. @ManagedBean(name="pessoaController") @SessionScoped public class PessoaController{ private List<Pessoa> pessoas = new ArrayList<Pessoa>(...
asked by 04.04.2014 / 19:12
1
answer

Maven Project - Loads tomcat, but does not execute

I'm having a Maven project that, despite messages displayed on the Eclipse terminal, reports that Deploy was successful. When I type the URL in the browser, I get a 404 error; then when I open the Tomcat manager, I try to st...
asked by 20.04.2014 / 19:28
1
answer

JPQL to query date / time of bank with hibernate without native query

Is there a way to query the database date / time without using active query ? In Oracle I do this: SQLQuery qry = session.createSQLQuery("SELECT SYSDATE FROM dual"); But I would like a generic query to not price the database.     
asked by 17.04.2014 / 19:12
2
answers

Pass the object as an argument

There is the + method in the Client class that calculates the discount and the points of the client, and at the end of the method, a Buying object should be instantiated, but I can not instantiate the purchase object. Attributes and Builder o...
asked by 16.04.2014 / 20:14
1
answer

Adjust image size with ImageIO Java

I would like to resize an image to be displayed on my jLabel. Here's my code: BufferedImage imagem; Icon novaImg; try { String newPath = "file:///" + aleat(); // carrega imagem aleatória imagem = ImageIO.read(new U...
asked by 16.06.2014 / 22:54
1
answer

Error during Eclipse update: "unable to connect to repository"

When I try to install a new Eclipse update on "Available Software" the following error appears:    Unable to connect to repository link       Connection to download.eclipse.org refused I have already released the firewall, but the erro...
asked by 15.03.2014 / 22:24
1
answer

How to keep a checkbox true after an error message is displayed?

How can I keep a true checkbox when I display an error message? Every time I display a errorMessage my checkBox turns false . How can I solve this problem? I'm using jsf2.0 and primefaces . This is the button that calls...
asked by 18.03.2014 / 19:30
1
answer

How to get data from two different txt, Java

I have two .txt and I want to create a new txt by joining some data from these two .txt files, it follows below how I get the .txt data, can someone give me a path how to do this? I was wondering if you could throw the data into an array....
asked by 17.03.2014 / 22:45
1
answer

Observer Project Pattern on Android

Would anyone like to show me an Observer structure inside the android? I was trying to build an equal to java, but I did not succeed. My test was done as follows: I created a class Banco and a class ClienteObservable ; I...
asked by 24.03.2014 / 19:45