Questions tagged as 'java'

1
answer

Configuring SessionFactory Hibernate 5.2

Does anyone know of a tutorial or can you give me an example configuration for HibernateUtil.java class for hibernate version 5.2? I have already seen some settings, including in the documentation. But I still have doubts about being new to java...
asked by 24.08.2016 / 05:21
1
answer

Mapping the same entity class to two banks

Good afternoon Terrans, I'm a beginner in Java and I have the following situation. I have two databases, where I will transfer the records from one bank to another. Is it possible to have a Entity class mapped by the two banks? Comments:...
asked by 25.08.2016 / 23:01
1
answer

Problem trying to transfer files using the Apache FTP implementation in Java

I am performing FTP file transfer using JAVA. I'm using Apache's FTPClient and FTPServer classes. In a specific environment, sometimes the files are not transferred. I call the enterLocalPassiveMode method of FTPClient before calling the...
asked by 12.07.2016 / 21:10
2
answers

logout error servlet cookie

Hello. I'm having an error on the line: Cookie cookie = new Cookies(req.getCookies().getUsuarioLogado(); The complete method / class is this: @WebServlet(urlPatterns = "/logout") public class Logout extends HttpServlet { protecte...
asked by 12.07.2016 / 14:49
2
answers

Android Cursor return error

public boolean insertData( int id_item, String nome, int quantidade) { String preco_unitario = "0"; String id_pedido = "0"; SQLiteDatabase db = this.getWritableDatabase(); ContentValues contentValues = new ContentValues(); Str...
asked by 12.08.2016 / 16:58
1
answer

WildFly 10 + Spring Security + JSF + CDI does not inject dependency

I'm trying to implement CDI in a WEB project that I have where I use WildFly10 with Spring Security (custom login) and JSF and I'm not able to inject dependencies. In the Example below, the UserDao when used    Caused by: java.lang.NullPoi...
asked by 22.06.2016 / 22:50
1
answer

Inject CDI is not working with producer in a .jar project

I created an EntityManager producer on a .jar project but it does not work. I configured POM.XML with the dependency below <!-- CDI --> <dependency> <groupId>javax.enterprise</groupId> <artifactI...
asked by 21.06.2016 / 14:56
1
answer

Creating a txt file from another txt file

I have a file in this format (zero indicates the line has finished): -1 2 0 -2 3 0 $ -1 3 0 What do I do to identify if the file line has a $ ? Because I have to implement this conditional to perform the exchange of numbers signals, t...
asked by 30.08.2016 / 01:02
1
answer

Select returning Null from the database

I'm trying to make a login page and I'm using JaVA,JPA,WIldfly,Primefaces and the MYSQL database. I'm passing the name and password, but at the time of inspecting it it returns me null , throwing the select in the database...
asked by 30.08.2016 / 16:49
1
answer

How to change the color of a JMenuBar?

Is there any way to change the background and foreground color of the java menu bar? I looked in various forums and tutorials and could not find a way to change the color of the menu bar. Here's an example: public class menu extends java...
asked by 26.08.2016 / 22:30