Most voted "java" questions
Use this tag when the question refers to some resource, information, or problem relating exclusively to the Java programming language. Java is a class-based, statically typed, reflective, and execution environment (JRE) language. Java programs are compiled to bytecode and run on a virtual machine (JVM), allowing a "write Once, run Anywhere" philosophy (WORA).
Learn more…14,468 questions
Sort by count of
-
0
votes1
answer442
viewsSend login and password in Javamail email
I am developing a web application using jsp and Servlet and I would like that when sending the email an image is passed and the login and password but the email only send the image and does not send…
-
0
votes1
answer114
viewsCode error I can’t find - Create CNPJ (Java)
Good morning guys, could someone help me? I have this Java code that must create valid CNPJ number. However, the answer is Class GeradorCnpj when should I see the number. Follows the code: public…
javaasked 6 years, 9 months ago Estevao FPM 27 -
0
votes1
answer174
viewsFactory error when using @Embeddable in JPA
I need to create a composite key on my system, after researching a little discover that I should implement @Embeddable, even fine, I added the class on my system implementing the keys, but when I…
-
0
votes1
answer33
viewsEdittexts in wrong position
I am creating a list of Edittexts programmatically. In all I give a margin of 20dp and place one below the other. The problem is that textbox2 is always on top of 1, the other textbox is in the…
-
0
votes1
answer67
viewsError Request Resource is not avaliable
I have this class in JAVA package br.com.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import…
-
0
votes0
answers15
viewsHelp for the Java "saveAs" screen
all right? Can anyone tell me how to do, when I click the save button, open the "saveAs" screen of Windows itself? In the code, I’m saving in a fixed place, but I want to open the screen and choose…
javaasked 6 years, 9 months ago Rogério Simsen 1 -
0
votes1
answer763
viewsError type Mismatch: cannot Convert from String to String[] - How can I fix?
When trying to receive value through a JOptionPane in a matrix, but gives this error: type mismatch: cannot convert from String to String[] How can I correct? Follow my source code below: package…
-
0
votes0
answers2733
viewsRun the Maven java project via terminal?
I did a Maven project on Eclipse, I installed a Mahout dependency on pom.xml, I made the code and it works beautiful, it’s beautiful. But I have to run it on a virtual machine, that is without…
-
0
votes1
answer489
viewsHow to run the Maven dependencies?
I am making an application inside a virtual machine and I am using Maven to install Mahout, in Eclipse on another pc worked perfect, but while doing the same project on a virtual machine I did the…
-
0
votes1
answer907
viewsError with Unexpected JPQL token
I made a select JPQL but I’m having this error: Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: where near line 1, column 151 [select pes, pEnd from…
-
0
votes3
answers500
viewsForeign key exclusion
It helps the logic. My question is this:: I have a simple relationship between Lancamento and Pessoa, where people is the foreign key in Lancamento Model Class @NotNull @ManyToOne(optional = false)…
-
0
votes1
answer101
viewsHow to apply a "Blur" effect when a Stagemodal overlaps an already opened Stage in Javafx
Well my doubt is the following, I would like to apply an effect in which, when I open a new window, the window that was superimposed is blurred I tried to use public Stage stageModal(String…
-
0
votes1
answer175
viewsunmount objects in an array
I have a method of searching the bank that brings me the following result: Note that inside the Object[4] comes another array that contains People, People.. i would like you to return me just this…
-
0
votes1
answer76
viewsSave text with line breaks in BD
See below for a java code to save an SQL command return in Postgresql. The command is EXPLAIN ANALYZE. The problem is that while saving this in the database, it loses line breaks. Someone would know…
-
0
votes1
answer141
viewsHow to get Printwriter to write in the file . txt determined String of a variable?
My idea is to create a small database . txt to save a user’s data. public void menuContato(){ try{ FileWriter fw = new FileWriter("usuarios.txt"); PrintWriter pw = new PrintWriter(fw);…
javaasked 6 years, 9 months ago Kenneth Anderson 313 -
0
votes1
answer111
viewsError in persistence.xml when connecting oracle database
I have this file to perform oracle database persistence. However do not connect! <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence"…
-
0
votes2
answers800
viewsProblem when mapping Servlet in web xml
I’m getting error 500 when trying to map Servlet, I don’t know what can be, I think it’s the class Servlet is wrong. Servlet public class addContatoServlet3 extends HttpServlet { protected void…
-
0
votes1
answer205
viewsProblems generating Oauth access token with Httpurlconnection
I’m trying to file a request for a web service that uses Oauth to generate an access token. However, although the request returns the Http 200 code, json only appears as…
-
0
votes0
answers97
viewsApache Commons Email Base64 Image
I have software to send emails that use apache Commons email to send html emails, I also have in the database a string that represents an image Base64 example data:image/png;base64,iVBORw0K .... I…
-
0
votes0
answers47
viewsJenkins' CLI connection denied
When executing java -jar jenkins-cli.jar -remoting -s http://maquina:9090 get-job TAL -auth user:1457c2 I am being denied connection for some reason. Jenkins version 2.89. Any idea why the error?…
-
0
votes1
answer902
views -
0
votes1
answer169
viewsHow to implement Dllinsce32.dll from sintegra in Java corretamante
You need to create a Java function that receives Dllinsce32.dll, provided by Sintegra to verify the consistency of State Registrations. But when passing the DLL location appears: "Exception in…
-
0
votes1
answer41
views'_$visited' property in Javascript object at the return of Obervable’s map() function
I have a Webservice implemented with JAX-RS and I’m consuming it with a service(utilizando Angular 2) Follow the service: @Injectable() export class ModeloService { constructor(private http: Http) {…
-
0
votes1
answer1740
viewsPost a Json object to Webservice via AJAX
I am trying to send an object in Json format to my Java Webservice by AJAX, but I have not succeeded, I have tested wrong formats, which are not Json’s, as "string", and the database reports error…
-
0
votes2
answers493
viewsError Converting String to Numbers in Java
In my last post (do/while repeats the expression twice) was having an input overlay problem using the Scanner class, and according to the links placed in the answer, we cannot use nextLine() after…
-
0
votes1
answer47
viewsHow to display only set objects as true in a new Activity
I have here an arraylist that is shown in a listview, when I give long click a dialog is displayed there contains the favorite option that when it is selected the obeject is marked as true, as I do…
-
0
votes1
answer168
viewsRemove repeated elements from a multidimensional vector
I’m making a code to be able to remove duplicate lines from a vector with customer registrations. This vector is "tabela[1000][3]" So I have for example: 1ºlinha - "joao" " rua: asasdfasdfs" "cep:…
javaasked 6 years, 8 months ago Kelvin Crepaldi 41 -
0
votes1
answer305
viewsSession Hibernate errors - getCurrentSession()
Please, I would like your opinion on that code if possible. If this coherent or needs to be improved because I constantly have errors org.hibernate.TransactionException: rollback failed or…
-
0
votes1
answer475
viewsCreate Array using SELECT output
public class TelaGrafico extends javax.swing.JFrame { Connection conexao = null; PreparedStatement pst = null; ResultSet rs = null; /** * Creates new form TelaGrafico */ public TelaGrafico() {…
-
0
votes1
answer95
viewsNull object array - Android Base Adapter
Hello I was making a gallery, I created the Adapter, worked normally, so proceed to the step of listing files in a directory and then put in the list: ArrayList<GalleryItem>items = new…
-
0
votes0
answers68
viewsError executing project in Tomcat
Hello folks I’m trying to run a Javaweb project on Tomcat, but when I run it gives this error: HTTP Status 404 - /Drugstore/faces/templates/modelSystem.xhtml type Status report message…
-
0
votes1
answer48
viewsCreation of a Splash
I’m creating a splash but this splach is stopping my App, it works for a few seconds after automatically closes my App stops working and no longer opens. public class Splash extends…
-
0
votes2
answers536
viewsRunning threads on android
I’m new at work with threads on Android and I’m having difficulties to implement them. To thread will be used to make a calculation and finally send an email depending on the result of the…
-
0
votes1
answer66
viewsDoubts About Java WS Slowness and Remove warn
1) I have a question about the slowness of a REST web service that I am mounting. In client communication, the server response takes a few seconds. What I’ve already done: -All processes the…
-
0
votes2
answers897
viewsDownload Zip Files via blob array
I have a rest in java where I return a byte[] of a ZIP file. If I access the URL of the API by the browser, the file is downloaded normally without error. But if I try to download the file through…
-
0
votes0
answers2004
viewsConnect mysql to Android Studio
I have a web-based system where his database is with Mysql. I’m starting now to develop the application on Android using Android Studio. I wonder if you have how to create Mysql connection in…
-
0
votes1
answer688
viewsjava.lang.Nullpointerexception: Attempt to invoke virtual method 'void android.media.Mediaplayer.start()' on a null Object Reference
I am learning Java and know basically what Nullpointerexception means. But I would like to understand why this occurs. This is the Activity code: package com.example.android.miwok; import…
-
0
votes1
answer1505
viewsInsert image in Ireport
I’m trying to insert an image into Ireport 3.7.5. When I drag the Image field to the page and place the static url with the image address, it works, but when I put it on Image Expression that way :…
-
0
votes1
answer302
viewsHow to show interstitial ads after loading the home screen?
I need help, I would like to display an interstitial ad after the home screen loads, but my code is giving the following failure: java.lang.Illegalstateexception: isLoaded must be called on the main…
-
0
votes0
answers117
viewsAuthentication problem with Firebase
I’m using Firebase for authentication and database of my app, everything was perfectly fine until (I’ll tell you exactly what happened because I don’t know if it has relation or not) I start to move…
-
0
votes1
answer214
viewsHow to run PROCEDURE and FUNCTION at the same time?
I have this plsql code and I must run at the same time: /*Testar se o codigo é valido*/ CREATE OR REPLACE FUNCTION TESTE1(cod number) RETURN BOOLEAN IS begin if(cod>0)then return true; end if;…
-
0
votes2
answers95
viewsHow to make Item only appear when category code = 1
I have the following code <h:selectOneRadio value="#{solicitacaoImpressaoBean.entrega.tipoGuia}" class="tipoGuia"> <f:selectItems value="#{solicitacaoImpressaoBean.tipoGuia}" var="guia"…
-
0
votes0
answers66
viewsMake the mouse act with a joystick
My code should make the mouse act with a joystick to drive a ball on the screen. It should work as follows: if the mouse is in the crosshairs, the ball does not move. If the mouse is to the right or…
-
0
votes1
answer236
viewsJava @Generatedvalue + SQL server NEWID + Hibernate
I have a table that has ID defined as CREATE DEFAULT ID_Tabelas AS NEWID(), that is, even if I use an Insert without the key, it will be generated automatically. How to make Hibernate recognize that…
-
0
votes1
answer102
viewsClassroom API - Coursealias
The following code refers to the creation of a course by the Classroom API. However, the API does not allow you to manually define an 'ID' (using .setId("ID")). For this is available the creation of…
-
0
votes1
answer150
viewsHow to put socket in read mode until you receive other java data
I created the server part and the client part. If the message exchange is just an input and an output works perfectly, the problem is to maintain a communication without closing the socket. In case…
-
0
votes0
answers36
viewsInsert in table - strange value
I am trying to insert a value into a table from a select option. html: <select class="form-control" name="chaveCadastro" ng-options="cadastro.cadastroId for cadastro in (cadastro | orderBy:'id' |…
-
0
votes1
answer22
viewsSpinner error to popular by Sqlite
Error: Caused by: java.lang.Illegalstateexception: Couldn’t read Row 0, col -1 from Cursorwindow. Make sure the Cursor is initialized correctly before accessing data from it. Classes Novoregistro:…
-
0
votes1
answer131
views -
0
votes1
answer38
viewsApp is closing when debugging on Android
I’m trying to run the app on Android, where I want to list the data registered in a Mysql table. I’m trying this way: Connection import java.io.BufferedReader; import java.io.InputStream; import…