Tagged Questions
Java (not to be confused with JavaScript or JScript) is a general-purpose object-oriented programming language designed to be used in conjunction with the Java Virtual Machine (JVM). "Java platform" is the name for a computing system that has installed tools for developing and running Java programs. ...
0
votes
0answers
3 views
Getting a FrameNode for an instruction (ASM)
I'm currently trying to use the ASM tree API to insert a frame in the middle of a method as a future jump target.
I have tried to use the Analyzer class in order to compute the stack and variable ...
0
votes
0answers
2 views
how to output a list in a grid with android studios android studios
what is the best way to output a simple 2d array in a grid format.
i want to output a list into a grid 4x4
public int[] gameBoard1 = {0,1,5,0,0,2,3,0,5,2,5,0,1,2,3,0};
thanks.
0
votes
0answers
6 views
How can i know what l am reading with Java Sockets?
I'm creating a Java Application wich need Client to communicate (Send & Recieve data) with other Clients.
I have made a simple Server Application to make Client communication easier.
To ...
0
votes
0answers
4 views
JavaFX: Getting IDs of Dynamic created Button
I'm currently made an Form with JavaFX.
Always i press a Button, i call the "addAnswer()"-Method.
In that I create a RadioButton, a Label and a delete-Button, which i bundle in a HBox. All that ...
-9
votes
0answers
16 views
How to make a image clicking script [on hold]
I am trying to make a simple script so when the page is refreshed it searches for this IMAGE and clicks it. would be really helpful if you wrote it out and showed me how you did it so I can learn, ...
2
votes
0answers
7 views
Java Spring REST API Handling Many Optional Parameters
I'm currently messing around with a Spring Boot REST API project for instructional purposes. I have a rather large table with 22 columns loaded into a MySQL database and am trying to give the user the ...
-3
votes
2answers
24 views
Why am I getting ClassCastException?
I'm trying to do a dijkstra's algorithm for finding a path.
public List<GeographicPoint> dijkstra(GeographicPoint start,
GeographicPoint goal, Consumer<...
0
votes
0answers
6 views
Custom ThreadPoolTaskExecutor with Spring Boot Async
I have a Spring Boot application which is responsible for answering requests via REST. I also push metrics about my application call. Since this is a separate task and I have to response users ...
-1
votes
0answers
7 views
Can someone help me with the custom script that needs to be written to trigger/collect selenium test results and post it to Zephyr for Jira using zapi
We are using Selenium and JMeter for functional automation and performance testing resp. We are thinking of using JIRA and Zephyr and integrate it with selenium.
I have read some documentation about ...
0
votes
3answers
22 views
java keep trying until there are no more filenotfoundexception
I was trying to write a code, which read an input file and create an output file. But when I tried to add a try until a correct input file name is input, i have problems, it shows not proper ...
0
votes
0answers
6 views
Live streaming with Azure Media Services
I'm working on an Android application that allows users to live stream with Azure Media Services. Getting stuck with a problem that I can't seem to push the audio stream to the channel. Here is the ...
-1
votes
0answers
24 views
Avoid multiple adding of content to Generics List
I create custom Nodes with one circle on the left and one on the right.
Everytime I connect two Nodes, I want to set Boolean left or Boolean right to true. When I connect two Nodes to one Node, I want ...
-1
votes
0answers
9 views
Java can't output data stored within another class
Java chess style program using classes to ask for numbers representing pieces, row values and column values, once 2 sets of data has been entered program terminates and displays these values as an ...
0
votes
0answers
5 views
White window when exporting Eclipse project to jar
I exported my project, but when I opened the .jar file it was just a white window.
Here are some screenshots with the build path:
Order and Export
Libraries
When I run the game inside Eclipse ...
0
votes
0answers
11 views
Error javax.validation.ConstraintViolationException
I am using Spring MVC and Spring Security and hibernate. i am having problem with save 'Password" can not tell where mistake is
I get the Following Error When i submit my form
nested exception is ...
0
votes
0answers
6 views
sharedPref.getString() picking value from ListPreference's entries instead of entryValues
I have a ListPreference in my activity:
<ListPreference
android:key="pref_rValue"
android:entries="@array/r"
android:summary="***"
android:entryValues="@array/...
-3
votes
1answer
32 views
Can I force type to be declared? [duplicate]
I have this structure:
interface I{
boolean compare(T);
}
abstract class A
class B extends A implements I
class C extends A
class Comparer<T extends A & I>{
T aThing;
public ...
2
votes
1answer
34 views
Accumulating Rows In A Two Dimensional Array
I'm trying to create the following output:
TOTAL SALES BY REGION
Region 1: 7,845.00
Region 2: 5,636.00
Region 3: 7,879.00
Region 4: 9,174.00
From this Array:
double[][] sales = {{1540.0, 2010.0,...
1
vote
1answer
32 views
How does the classpath influence the *.class file
I have some source code files that I want to compile. For that, I have to specify a classpath which contains (by means of specifying the jars) all used classes and methods with the correct signatures. ...
0
votes
0answers
5 views
ConfigurationSetupException: The configuration data in the base configuration from server does not obey the Terracotta schema (tc-config.xml)
I want to use terracotta (terracotta 4.3.3 + ehcache 2.6.8) in spring in order to implement caching some data. When I tried run, I got this error :
03:10:10,320 ERROR [ContextLoader] Context ...
0
votes
0answers
13 views
Implementation of communication protocol between embedded system based on ARM cpu and JAVA application which simulate elevator.
I need to create a communication module, which will communicate via serial interface with the simulator elevator. The communication protocol is asynchronous and uses CRC8 to verify the correct ...
0
votes
0answers
7 views
How to start again Quartz jobs that are created dynamically after a server shutdown
I'm using spring mvc 4.2.5.RELEASE and quartz 2.2.1 quartz-jobs 2.2.1
I have a user interface when the user inputs the name and the cron expression of a quartz job, and then I create the job like ...
0
votes
0answers
8 views
how to resolve exception in jdo query
I'm developing an application with gwt and google app engine and I have a problem with run jdo query.
I run jdo query and get an exception like this:
Splitting the provided query requires that too ...
0
votes
1answer
31 views
Writing and Reading to/from a file Objects stored in ArrayList
This is a simple example where I'm trying to write and read Objects stored in ArrayList to/from file.
Writing file is working. Reading file is working only for first Object in my ArrayList. How ...
0
votes
0answers
15 views
How to / is it possible to call a matlab finction from a java program?
To begin with i am using Eclipse as my java IDE. Im doing a robotics project where my robot (the lego mindstorms ev3) travels a room using SLAM (programmed in java) and does some image recognition ...
0
votes
1answer
7 views
jmockit return the same object
Can I mock a method using JMockit in a way that it returns the argument that was passed to it?
Consider a signature like this;
public String myFunction(String abc);
I see it is possible to do this ...
0
votes
0answers
10 views
Not able to merge DWR with Spring
Using spring 4.2.0, Dwr 3.
Using annotations to create all spring controllers, service and daos. Working fine till it's in spring only environment. Trying to add DWR as seperate spring controller ...
0
votes
0answers
16 views
Calling subclass method from superclass BroadcastReceiver?
I was wondering if someone could point me in the right direction with a problem I'm having in an android app. I have several subclasses that extend a superclass. This superclass contains a (local) ...
1
vote
1answer
12 views
Catching a RuntimeException 'cross-borders" in command line — originated at one jar and thrown in another
I'm explicitly invoking JVM from within the system i'm developing, say systemA. this is by specs-- I have to process the command in another jre instance.
the command to do this is
java -cp thisJar....
0
votes
2answers
29 views
Get text from specific tags
Suppose I have some html form.
<form action="action_page.php">
First name:<br>
<input type="text" name="fistname" value="Mickey" />
<br>
Last name:<br>
<...
-1
votes
1answer
11 views
Generated integer number save into Binary Search Tree
import java.util.*;
import java.util.Iterator;
import java.util.Random;
public class BST {
static int dataset = 1000;
public static void main(String[] args) {
int i;
Random t = new ...
0
votes
0answers
4 views
wildfly - Application not reached
I'm woking on Java project. I use Maven, Wildfly and IntelliJ IDEA, running on Ubuntu 16.04. I've created a simple Hello-world application in Main class, using System.out.println() . I'm trying to ...
0
votes
0answers
10 views
Catch username from spring web application to use by trigger
I would like to save in my database information about history, for example user "dog" edited field "grass" in table "garden".
I have trigger which saves everything correctly but I have problem with ...
0
votes
2answers
27 views
Eclipse not implementing .class files that are provided, and not able to super those classes in the project
I have scoured this website for the answer, but none of the solutions I have found worked for me. Please mark as duplicate and paste link if you know that post is the answer.
Anyway, what is ...
0
votes
0answers
5 views
Selenium Webdriver is suck on the second iteration of the for-loop: it is not finding or selecting an element
The first iteration of the for-loop works perfectly, and the second works fine up until it has to make a selection from the list. The error I received was: "Exception in thread "main" org.openqa....
-3
votes
1answer
38 views
BufferedReader in java
I am reading a text file using BufferedReader I need to count the words(no punctuations, no spaces just the words). My current code counts from 1-33280.
That isnot what i intended to do i want to ...
0
votes
0answers
10 views
How to add collection of objects to a new JList/JComboBox?
I'm just getting into Java and this is the first time I'm attempting to make a new trial application for a Basket App for Shopping.
A database has products table like this:
CREATE TABLE `...
0
votes
0answers
7 views
Setting per application properties on Wildfly
I am normally the Tomcat guy but we use Widlfly on one of our client project.
With Tomcat, I can set "per application" properties by creating a separate context for each application, just as Tomcat ...
0
votes
1answer
5 views
Adding a Soap Header Elements without NameSpace
I have a problem adding a header soap element. Every try show the exception:
com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl
addHeaderElement SEVERE: SAAJ0131: HeaderElements must be ...
1
vote
2answers
30 views
Java: Check if current item in loop is the last item within the Stack being looped
I have the following:
public Move nextBestMove(Stack<Move> possibleMoves, Stack<Square> enemyPieces){
int highestWeight;
Move best = null;
for(Move move: possibleMoves){
...
-2
votes
0answers
20 views
Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.getString(java.lang.String)' on a null object [duplicate]
My app is crashing and the log is showing this error:
12-09 21:25:02.226 11849-12325/com.learn2crack W/System.err: ... 21 more
12-09 21:25:02.226 11849-12325/com.learn2crack E/Buffer Error: ...
0
votes
0answers
27 views
How can I remove permissions programmatically in Java
I want to write a program in java that removes its own permissions and then, using ClassLoader, loads a unstrusted .class and invokes one of its methods.
How can I do this without messing with policy ...
0
votes
1answer
11 views
Save content from XML into CSV file
I have below code which is going by all XML content.
Now, I have open stream writer on beginig, but I don't know how to add to the method:
bw.write
ReadXML.java
public class ReadXML {
public ...
0
votes
0answers
8 views
Alternative to Kafka mirror maker tool
I am trying to find an alternative for kafka mirror maker tool for replicating between kafka clusters, so far i found Ubers U replicator tool which is an improvement of kafka mirror maker tool , but ...
1
vote
1answer
35 views
How to get the exact bytes?
I want to send an email with 9 specific bytes in the body:
byte one = (byte) 161;
byte two = (byte) 1;
byte three = (byte) 254;
byte four = (byte) 1;
byte five = (byte) 255;
byte six = (byte) 255;
...
-1
votes
1answer
13 views
IllegalMonitorStateException in ProducerConsumer Implementataion
Below is the code snippet that i am using to implement producer consumer problem.Please have a look ,as i am facing IllegalMonitorStateException
Below is the code:-
Producer class and Consumer class ...
1
vote
0answers
23 views
Cannot open url. please check this url is correct
I'm developing a very simple Java web app with Tomcat (Maven Project) in Intellij (Version 14.0.3). When I compile and deploy the package (command: "mvn clean package: using Intellij) and then run the ...
0
votes
0answers
16 views
Return result of parent object type when having child object type in a function in Java? [duplicate]
in Java, I have an interface method that would return
Map<Object, Object> getSomeMap();
In my implementations of the said interface, however, actual maps are more strongly typed and different, ...
0
votes
0answers
4 views
NoClassDefFound When Deploying with Payara Glassfish
I have an enterprise web application in NetBeans with a structure as displayed in the screen capture below:
Whenever I try to deploy the project with Payara/GlassFish, I get the following exception. ...
-4
votes
0answers
23 views
Why my microphone does not works as well?
I want to make a microphone that writes to a file but the file is empty. I don't understand why.
public void recordSound () throws IOException, LineUnavailableException, InterruptedException {
// ...