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
-
1
votes1
answer777
viewsError Registered the JDBC driver [oracle.jdbc.driver.Oracledriver] but failed to unregister
I’m making a system Javaweb using jsp that’s on that topic: Doubt in database query, error in query, and in a database query, I came across a driver error that is just below. I use the IDE netbeans…
-
1
votes1
answer78
viewsView does not communicate with MB
I’m using Primefaces, Javajpa,and Wildfly, there’s not much there but my doubt is the following: my view is not seeing my MB, when I rotate gives the following error: Target Unreachable, Identifier…
-
1
votes1
answer153
viewsClick on the Gridview photo and show in another Activity
I’m developing an app that contains a gallery and found a tutorial that showed how to fill the GridView with photo taken from camera. However, I’m having trouble doing something for when the photo…
-
1
votes1
answer2395
viewsCalling a JSF popup from a Managed Bean
I use this Javascript to call a popup in JSF: function showMyPage() { window.open('./showMyPage.xhtml','mywindow', 'resizable=no,toolbar=no,scrollbars=yes,height=450,width=530,top=145,left=235');…
-
1
votes1
answer91
viewsJPQL Query for Data Insertion
How can I enter a data with JPQL containing values: @Query("insert into user values()") User insertUser(); Dice: nomeUsuario emailUsuario…
-
1
votes2
answers233
viewsHow to make this consultation with JPA?
I would like two solutions to this question, one using a normal typedquery and the other using the criteria due to its great versatility for code. Here is my query: TypedQuery<Pessoa> query =…
-
1
votes0
answers414
viewsPDF generated from HTML, via itext (5.5.6), does not have the font size defined in CSS
I am using itext 5.5.6 to generate a PDF file from an HTML document generated by Thymeleaf. In this HTML, the styles are being reflected correctly in the browser. However, when generating the PDF,…
-
1
votes1
answer549
viewsHow do I update a proprietary app?
I have an app that should only be used by a number x employees, so it’s not on the playstore, but wanted to know how I can make available updates and install them.
-
1
votes1
answer229
viewsReading of text file
I need to handle a 3-line file with the following structure: nome data horário To read this method I use the following commands: BufferedReader leitor = new BufferedReader(new…
-
1
votes1
answer412
viewsI can’t get all the XML file data and save it to a txt
This is the XML: <cv> <pessoa id="1"> <dadosPessoais> <nome></nome> <sexo></sexo> <idade></idade> </dadosPessoais> <formação>…
-
1
votes2
answers68
viewsNullpointerexception on a Servlet when using Datavoting method
I’m working with a Servlet however, this giving error java.lang.NullPointerException when I use the object method DataVoting. Follows the code: @Override protected void doGet(HttpServletRequest…
-
1
votes1
answer1049
viewsConfigure Sessionfactory Hibernate 5.2
Does anyone know of any tutorial or can you give me an example of configuration for Hibernateutil.java class for version 5.2 of Hibernate? I’ve seen some settings, including in the documentation.…
-
1
votes1
answer601
viewsWhy does the Netbeans IDE not automatically delete the Build from an imported web application?
I downloaded a Java web project and imported it to netbeans,when all the imported project with all its libraries were in its proper place along with the archive web.xml(within WEB-INF), I ran the…
-
1
votes1
answer268
viewscommandbutton executes method, but being null values. Why are inputstexts values not being assigned to class attributes?
In all the examples I saw of the code below, the normal one was to start the xhtml page to create a new client-like object. Through the values entered in the inputs set the attributes of this object…
-
1
votes1
answer112
viewsLoop in Carousel
I’m making a Carousel, that I received the friend help from here. But now a small problem has arisen, in the example there are 6 images, and when arriving at the last it stops. I wanted to know how…
-
1
votes1
answer314
viewsMapping the same entity class to two banks
Good afternoon Earthlings, I am a beginner in java and I have the following situation. I have two databases, where I will transfer the records from one database to the other. There is the…
-
1
votes2
answers981
viewsWhat is the reason for the error "The Operator / is Undefined for the argument" in this code?
double t1 = System.currentTimeMillis(); double t2 = System.currentTimeMillis(); System.out.print("\n Tempo Total: "+ (t2-t1)/Double.valueOf(1000)+ " segundos"); When compiling the third line,…
javaasked 8 years, 3 months ago Thiago Marques 77 -
1
votes2
answers87
viewsPlay Framework Execution Error
Good evening, I’m studying the Play Framework es I’m hitting on the following error: ! @6naojhb5b - Internal server error, for (GET) [/] -> play.api.http.HttpErrorHandlerExceptions$$anon$1:…
-
1
votes0
answers67
viewsHow do I pass an object value with itext
I have the following code fragment: Document doc = new Document(PageSize.A4.rotate()); while(iteratorRow.hasNext()){ Object valorCelulaRow = iteratorRow.next(); if ( valorCelulaRow != null ) {…
-
1
votes0
answers89
viewsproblems with @Injection
Hi, guys. I’m creating a program that manipulates human and livestock records. In this program, on the livestock register screen, I am creating two Selectonemenu of the first faces. One is of type…
-
1
votes0
answers72
viewsSaving whole object instead of name only
Hi, guys. I’m having a problem storing livestock records at the bank. The situation is as follows: I have two Selectonemenu on my screen where one is dependent on the other. One is to indicate the…
-
1
votes1
answer600
viewsHow to change a dynamic template content when the user clicks a button?
I would like the middle of the page to be changed when the user clicks "login" or "registration". Can anyone explain to me how to do this? If you know tutorials that teach you how to log in and if…
-
1
votes1
answer51
viewsCreating txt file from another txt file
I have a file in this format (the zero indicates that 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 condition to…
-
1
votes1
answer404
viewsNo tests found with test Runner 'Junit 4'
When creating a new package and within that package create a new test when trying to run the test the eclipse returns the message: "No tests found with test Runner 'Junit 4'" Within the project I…
-
1
votes1
answer92
viewsNon-recognition eclipse error of Static and default modifiers
People the eclipse does not recognize when I want to create a class within an interface with Static and default modifiers. Obs: I already have JAVA 8 jdk installed. Thank you very much. Att, Thiago…
javaasked 8 years, 3 months ago Thiago Marques 77 -
1
votes1
answer218
viewsCalling Java (Android) function inside a hybrid mobile application with Javascript
We are building a hybrid web application, which needs to print on a portable printer by bluetooth. But the printer is imported and only comes with a Java SDK, which is not our strong! We needed to…
-
1
votes0
answers68
viewsError while retrieving Web Service Object List (CSV)
I have an error retrieving a list of CSV objects from the server.. I’m using Jsefa to serialize and deserialize Java Beans for CSV and implemented a Messagebodywriter and Reader to make this…
-
1
votes1
answer395
viewsError deploying SOAP web service with Maven and Apache Tomcat
I built a JAX-WS application by Maven, but I’m unable to deploy it to the Tomcat application server. They follow my artifacts: pom.xml: <project xmlns = "http://maven.apache.org/POM/4.0.0"…
-
1
votes2
answers561
viewsHow to avoid automatic closing in Dialogfragment?
I developed a login screen, as can be seen in the figure below, following the section "Creating a Custom Layout" of official documentation. The only problem I’m facing is that the dialog closes…
-
1
votes1
answer975
viewsGet method values to have result in ANDROID calculator
Friends, now the doubt is the following, I need the operation "+", be present to accomplish the sum, but always leave 1+2 and never the two make the sum. Does anyone have any idea what it might be ?…
-
1
votes1
answer53
viewsJava Socket Specification and Implementation
I created a class MySocket that extends java.net.Socket, but I saw that class java.net.Socket implements the interface java.io.Closeable, and my question is: In my class MySocket I am obliged to…
-
1
votes3
answers11115
viewsJavascript to remove accents and special characters does not work the same in all browsers ?
I have the following Javascript: function validaCaracteres(strToReplace) { strSChar = "áàãâäéèêëíìîïóòõôöúùûüçÁÀÃÂÄÉÈÊËÍÌÎÏÓÒÕÖÔÚÙÛÜÇ"; strNoSChars =…
-
1
votes2
answers4072
viewsHow to create notifications?
I’m making apps only to test some functions for Android and would like to know how to create notifications in the status bar. My Java code and a standard code that only calls the XML file: package…
-
1
votes1
answer177
viewsError. WARN: WELD-000335: Conversation context is already active
I am presenting the following error in my Glassfish server 4.1 output: WARN: WELD-000335: Conversation context is already active, Most likely it was not cleaned up properly During Previous request…
-
1
votes2
answers384
viewsError while removing Arraylist item
I’m "playing" with the canvas (android) and I’m having trouble removing element from an Arraylist. The app works like this: The user clicks on the screen, a ball appears that goes up but I want to…
-
1
votes1
answer211
viewsWhat is the best practice for instantiating a class in Java?
Aiming at performance, how should I instantiate an object (ex a Databasehandler) to be used in Fragments. I must instantiate them in Activity and pass via constructor method to the Fragments or…
-
1
votes1
answer340
viewsButton that overwrites all screens
How to make a floating button that overlaps all screens , mainly the screens outside the application. in the image has 2 examples of floating buttons…
-
1
votes0
answers99
viewsLimits for updating with Bufferedreader in mysql
Hello everybody good morning, I am having problems with a update routine in the mysql database, I am reading a Bufferedreader containing more than 3,000,000 records and updating in mysql but when I…
-
1
votes1
answer1284
viewsEclipse Error: Intializing Java Tooling
When I start the Eclipse ide the Initializing Java Tooling error is shown. How to fix this ?…
-
1
votes2
answers224
viewsJconsole: Java Monitoring and Management Console
Jconsole Hi, I read that this tool monitors JVM processes. However, when executing the tool appears this form (see image). As for these parameters, what do they mean? I don’t remember configuring…
-
1
votes0
answers127
viewsUnable to build Entity manager Factory in jar created with Maven
Good morning, everyone, In one project we’re using Hibernate, Log4j2, Gson and a few other things that you can see in pom.xml <?xml version="1.0" encoding="UTF-8"?> <project…
-
1
votes1
answer694
viewsHow to check if a Resultset is empty?
I’m making a query in Mysql and when the query exists it returns the good values. But here’s the question, what’s the value ResultSet receives when the search does not exist? Type look for a name in…
-
1
votes1
answer247
viewsHow to manipulate iterator position
I need to compare all the elements of a list 2 a 2 am doing as follows: List: 1, 2, 3, 4. Comparison: 1 and 2, 1 and 3, 1 and 4, 2 and 1, 2 and 3... I’m using it as follows: Iterator<Policie>…
-
1
votes1
answer51
viewsConventions of when to use _ or $ in Java identifiers?
When to use _ or $ in identifiers? That is, in which cases should I use _ or $ to make my code more organized. For example, I should use $ in front of variable names when building a framework?…
-
1
votes0
answers45
viewsDetect point on screen with device camera
Does anyone know any library or practice to detect a point in the image captured with the device camera? Ex. a white paper with a black dot, then the camera detects this point and gives the…
-
1
votes1
answer279
viewsI need to create a regular expression to validate a Camelcase
Good morning to everyone, I hope you can help me. I need a regex or even an idea of how to insert a space for Camelcase expressions. In other words, insert a space for each uppercase letter of the…
-
1
votes1
answer40
viewsCheck that all objects in the class that extends Realmobject are empty
My Book.class extending realmobject public class Book extends RealmObject { private String title; private String author; public String getTitle() { return title; } public void setTitle(String title)…
-
1
votes1
answer530
viewsHow to recover data from an HTML form opened in a Webview?
Hello! I have a responsive web application that I intend to open via android app through a Webview. Well, the only problem is that I would need to take some Submit data from just one application…
-
1
votes2
answers92
views"Refresh" from Fragment co listview
I have a Fragment that, clicked on a RadioButton, a route is calculated, after this route calculation, a ListView with the results. By clicking on the other option of this radiobuttom, the routes…
-
1
votes1
answer197
viewsURL mapping
When accessing a user’s profile, I pass their user name as a parameter. www.site.com.br/busca?usuario=nomedousuario I would like to access as follows www.site.com.br/nomedousuario Someone has the…