Questions tagged as 'java'

1
answer

Problems with cast in reflection

Good afternoon. I'm new to using the reflection java API. I am having the following problem, when trying to create a generic Dao class to be used in a CRUD to sqlite in android, I can not cast a field of the corresponding type in the object clas...
asked by 24.11.2016 / 16:34
1
answer

java.lang.RuntimeException: Unable to start activity ComponentInfo {...}: java.lang.NullPointerException [closed]

I'm trying to pick up facebook data and I'm getting this error. Logcat 10-24 00:46:41.230 7526-7526/sptour.hotmail.com E/AndroidRuntime: FATAL EXCEPTION: main Process: sptour.hotmail.com, PID: 7526 java.lang.RuntimeException: Unable to start...
asked by 24.10.2016 / 04:50
1
answer

Save console output from an excel to a txt file

My code reads an excel sheet and returns me a list of IDs, but when I try to save the output that appears on the console to a txt file it returns me null. Does anyone know what? while ((output = buffer.readLine()) != null) {...
asked by 20.11.2018 / 15:07
1
answer

Problems with .jar generated with jxl library [duplicate]

Hello! I am having problem in the generated .jar file of a project. In this project is included a library, called jxl responsible for reading and writing .xls files, but it is returning the following error when clicking a button that calls a t...
asked by 18.11.2018 / 17:27
1
answer

How to "set" a Query in the @Entity annotation with Hibernate?

I have the following Class: Student.java @Entity public class Aluno implements Serializable { @Id @Column(length=11, nullable=false) private int cpf; @Column(nullable=false) private String nome; @Column(nullable...
asked by 03.01.2015 / 17:30
1
answer

PreparedStatement does not initialize (stm="stm" is not a known variable in the current context.)

PreparedStatement declared does not initialize There is an error in line 83, the stm declared in line 21 is not initialized. import java.io.PrintWriter; import java.io.StringWriter; import java.sql.Connection; import java.sql.DriverManager; im...
asked by 26.01.2015 / 15:48
0
answers

Can not convert object of type java.lang.String to type geoapp.cursoandroid.com.geoapp.model.Project

I have a Firebase data recovery method: public void recuperaProjetos(){ DatabaseReference projetosRef = firebaseRef .child("projeto") .child(idUsuario); projetosRef.addValueEventListener(new ValueEventListener(...
asked by 04.01.2019 / 15:19
1
answer

Count months from a date [closed]

An ad will register an ad, what I want, is to get the dataCadastro and from it count 1 month, 2 months, 3 months (depends on the adm). package br.com.petpoint.models; import java.util.Date; import javax.persistence.Column; import javax.pers...
asked by 01.11.2018 / 12:51
1
answer

Capture Linux logon event using Java [closed]

Hello, I'd like some help to create a class that captures a user's login event on Linux using Java.     
asked by 08.04.2014 / 18:05
1
answer

WebView - ClassNotFoundException

I'm creating the following screen in the android <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="matc...
asked by 07.04.2014 / 17:20