Tagged Questions
Java is a general-purpose 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. Use this tag for questions referring to Java programming ...
0
votes
0answers
5 views
Unresolved constraint in bundle with Java 8
I have a web server running under Tomcat 6. In MANIFEST.MF there's
Import-Package: org.osgi.framework,javax.swing,javax.net,javax.net.ssl.
It's all fine with Java < 8, but with Java 8 it fails ...
0
votes
0answers
2 views
Upload files using selenium
How to upload files from local via window prompt using selenium webdriver.
I want to perform the following action:
1) click on 'Browse' option on the window
2) from the window prompt go to the ...
0
votes
0answers
8 views
Java File IO performance?
I am using RandomAccesFile and writing data in chunks of 10MB at a time. Following is source. Here it is writing 10MB data in write call. It's taking ~700ms. Is there any way to improve this using ...
0
votes
0answers
3 views
How to hot deploy newly created files to Apache Tomcat in Eclipse IDE?
I have a peculiar problem. I am extracting the data from a database in the form of .csv file and then passing this file to d3.js for visualization. The problem is, d3.js doesn't allow file:// based ...
0
votes
0answers
2 views
Deploying to Wildfly 8.20
I'm trying to deploy a GWT Errai application to Jboss Wildfly 8.2.0 Final, however, I am getting the following deployment error.
Caused by: java.lang.ClassNotFoundException: ...
0
votes
1answer
4 views
Selenium Webdriver - Unable to find element after page refresh/redirect
I am trying to write some UI test cases for an SAP-webUI (web based) application. After login, it shows the dashboard ( Workcenter's ) screen.
Now the problem is, I am able to open the page, enter ...
-2
votes
0answers
6 views
Oracle DB interactions within WebDriver (Java)
What are the commands to connect, drop, and insert additional SQL statements into test case? Please provide example
0
votes
0answers
5 views
Blobstore Library Error
I'm following this tutorial: https://developers.google.com/appengine/docs/java/blobstore/#Uploading_a_Blob
But I have an import error when i try to get BlobStore from library!
import ...
0
votes
0answers
7 views
Netbeans Cannot connect to server. Cause: The cipher 'aes252-cbc' is required
I am getting the following error when trying to create a Remote Connection within Netbeans for a PHP Project:
Netbeans Cannot connect to server XXX.XXX.XXX.XXX.
Cause: The cipher 'aes252-cbc' is ...
0
votes
2answers
19 views
Figuring out if statement
So my project is about creating a table that adds statistic comparisons to a selection sort table. I've done the bulk of the work but am stuck at this one part that asks me to It should add ...
0
votes
1answer
7 views
PDFBox to byte array length 0
Im trying to create an PDF with PDFBox and attach it to an eMail.
Code of the pdf creation (the pdf is succesfully created):
PDDocument document = new PDDocument();
PDPage page = new ...
0
votes
0answers
14 views
Bring common code into a separate jsp
I have more than two jsp pages. And into every page I have a common jsp code like this(navigation bar)
<nav>
<div class="nav-wrapper green darken-1 ">
<a href="#" ...
-1
votes
0answers
16 views
Java program direct execution in windows
How to convert the java programs into windows executable '.exe' format.
I have tried the Jexepack but its not comfortable for me. because the jexepack is executable file open the swing program with ...
0
votes
0answers
10 views
Spring RestTemplate unable to deserialize JSON
I'm trying to read the JSON response of a REST service using RestTemplate, however, when I'm reading the response I'm getting the following exception:
...
0
votes
0answers
6 views
Switch between perspectives in rcp
I have an rcp application which consist of two perspectives. in one perspective I have a tree. On double clicking any item of the tree it opens the details of the selected tree item but in the same ...
1
vote
3answers
35 views
how to converted timestamp string to a date in java
I have one string 1427241600000 and want it convert to yyyy-MM-dd format,
I have tried but not able to parse it, please check below code
try {
String str = "1427241600000";
SimpleDateFormat ...
1
vote
0answers
6 views
log4j AbstractFilter.equals() appears to do Object identity equals
Recently updated log4j from 2.1 to 2.2 and one of our tests fail that compares two Filters. It seems that the reason is that the old one checks (eventually) if a couple of the filters' ivars match in ...
0
votes
0answers
16 views
Get file name and length when transmit file using java socket
I am going to transmit a file(for example: abc.jpg) using Java socket:
What I can:
Establish a socket connection with other side
Send file content successfully
What I want:
Let other side know ...
0
votes
2answers
24 views
Creating a background service that launches an app at a specific time.
I just started on android development and I'm trying to write and a service that runs in the background and will launch an app at a specific time.
The program I wrote is based on a tutorial I came ...
0
votes
0answers
3 views
Reading an (iPhone-generated) .mov file using Java OpenCV in Linux
I want to read an .mov file captured from an iPhone5 camera using Java OpenCV in Linux, but I have been unsuccessfull. All I ger from Videocapture.read() is a 0x0 frame. Here is the code:
package ...
0
votes
1answer
12 views
Mocking one method with different values
I still have some difficulties with Mockito. I want to have two test cases for two different object examples. So I want to simulate different method behaviour depending on argument value.
The problem ...
0
votes
0answers
11 views
RSA Decryption error
I am implementing RSA decryption. I have tried lot more things regarding RSA decryption and i have develop below code snipet.
public class AsymmetricEncryptionWithRSA {
public void decryptdata1(){
...
0
votes
0answers
5 views
Role of PayloadRootAnnotationMethodEndpointMapping?
i have recently learnt spring webservices from springbyexample
I was simply amazed how stuff got simplified. Basically Developer just need to comeup with XSD. Then
1)Maven will create the java ...
-6
votes
0answers
27 views
Text search function/library (PHP, Java, C++) [on hold]
we have been tasked to create a simple search engine, which could search through a small set of .html documents (stored locally probably) for given text string (not exact occurence, just similarity), ...
0
votes
1answer
16 views
Hibernate criteria to fetch the records?
I have below records in table.
col1 col2 col3
------------------------
1 Abc IN
2 DEF CA
3 Xyz IN
4 Cae CA
5 Pty IN
6 Zwe DE
...
0
votes
1answer
16 views
Get all unique, matched, unmatched values from two different arraylist with different values in Java
I am having strange problems with finding the non/duplicate values from two different array list with same type of values.
Here is my code:
List<CustomStation> serverStationLists = new ...
2
votes
0answers
33 views
How to return value by ternary condition in a stream?
I want to return a value of a stream based on a condition. Take the following as an example only, where I want to map any apple to Food.APPLE:
public enum Food {
APPLE, APPLE2, APPLE3, BANANA, ...
0
votes
0answers
7 views
Visibility of Labels on AnchorPane
I am developing an app for viewing a tree-structured models. App parses a supplied XML and draws a tree according to the XML hierarchy.
My "drawing" pane is an AnchorPane on which I put a GridPane. ...
0
votes
0answers
6 views
“No SourceDir is specified” error while running ANT build.xml
I am running 3 java class files(it will just print the name of class) in eclipse test NG, with build.xml (ANT build).
I am getting below error(last line, No SourceDir is Specified) while running the ...
0
votes
3answers
62 views
Declare new class from a Variable in Java
I would like to know if there is a way to do something like this in Java:
Integer a = new Integer(2);
a.getClass() newVariable = new Integer(4);
My question is can I declare the type of a new ...
-10
votes
0answers
33 views
Java to Python?
I am converting a java project into python but dont really know much about pyhton
This is what i am doing in java:
document dom;
DocumentBuilderFactory dbf = ...
1
vote
2answers
13 views
HTML form submitting values with multiple double quotes
HTML Code:
<form action="...">
<textarea name="str">"abc"</textarea>
</form>
JS Code:
console.log($("textarea").val()); //output "abc" -> correct
var v = ...
0
votes
0answers
12 views
is it wise to build a whole website using HTML5 with libGDX?
LibGDX Offers the option of exporting your project as HTML5. would it be detrimental to create an entire project in eclipse and export with this option and use as a website. I am very comfortable ...
0
votes
2answers
32 views
How to negate a number using shift operator
I need to negate a number using shift operator.
Example:
If number = 5 then negation of 5 should be -5
If number =-5 then negation of -5 should be 5.
0
votes
0answers
8 views
ColdFusion found 0 methods that match the provided arguments
I'm trying to implement a .Net component in a Coldfusion application (this is on my development machine running CF 11.
I set up the object like this:
<cfset dll = ...
0
votes
0answers
21 views
How to switch turn in socket programming java
I am trying to make a battleship game in java, and using socket programming.
I can chat and the message is comming to the JTextArea. But the issue is that I need to shoot, and when the user have ...
0
votes
0answers
8 views
JMS Message Driven Bean instances pool and thread pool size
If I have a pool of 20 message driven bean instances (maxSession=20) should the thread pool contains exactly 20 thread instances or one or two more to handle eventual delay ?
For example I suppose ...
0
votes
1answer
31 views
Binary representation of a 32 bits integer
I have writen a very simple algorithm for generating the binary representation of a 32 bits integer.
Here is my code:
public class NumberManipulator {
public static final int HEAVIEST_BIT = 32;
...
0
votes
1answer
16 views
converting superclasses and subclasses back and forth
I wish to be able to change a subclass to a superclass then, if needed, back to its subclass to get access to all the methods and fields and modify them as required.
public class MainClass {
...
0
votes
1answer
16 views
How to insert multiple strings into a sqlite table using dbadapter
I want to insert the values inside 2 strings into a table using dbadapter.
I am able to insert one string named as 'inputparticulars' to a column named
as 'TX_PARTICULARS'. How to insert another the ...
-2
votes
1answer
27 views
How to split sentence to words and punctuation using split or matcher?
I need to split sentence to words and punctuation marks, and place em into list, saving their sequence.
For example: "Some text here!". And result should be: List(Some, ,text, , here,!)
I'm using ...
-2
votes
0answers
18 views
Dos Attack Server python java
I dont know what is going on on my server. RamNode just adviced me that my VPS appears to e sending out DoS attacks.
I restarted the server and did htop and get this:
gyazo
0
votes
0answers
6 views
Opencv and jmf Together
I've programmed server side and client side to receive a video stream from a webcam in java .
This is What I'm using in the client side :
public void update (ReceiveStreamEvent event) {
...
0
votes
1answer
24 views
Display a value dynamically on JSP
I have a table and I'm fetching the values from it through Java. I wanted to display the values on the JSP page such that when a dropdown option is selected the corresponding value should be painted ...
-3
votes
0answers
20 views
Key press simulation in unit testing
I wrote below code to press three tab keys after that press enter key using robot.
But it doesn't work as expected.
public void test_11() throws InterruptedException, AWTException {
Robot ...
-3
votes
0answers
12 views
how to refer two jar in android application project
I am adding one java lib and one android lib both are jar file.
But i am facing class not found error .
In both class two need to required to launch the application.
how to refer two jar in android.
...
0
votes
0answers
4 views
Twitter4j - change filter for stream
I'm using Twitter4J's streaming API, and I want to change the set of terms over time.
I'm using this code (scala):
def refresh_stream = {
stream.shutdown()
refresh_filter
stream.filter(filt)
}
...
0
votes
1answer
3 views
org.ops4j.pax.swissbox.bnd.BndUtils and IOException: Pipe closed
What is this all about? How could I fix karaf startup error?
2015-03-25 12:05:48,995 | ERROR | Thread-69 | aQute.lib.osgi.Jar 33 | Exception in ...
0
votes
0answers
7 views
e4-Javafx: How to apply current theme to login dialog
My e4 javafx application displays login dialog before diplaying main window.
LifeCycleManager class
@PostContextCreate
void postContextCreate(Application app, IEclipseContext econtext){
...
0
votes
3answers
38 views
Scanner.equals() returns false in either case
package harry;
import java.util.Scanner;
public class harry {
public static void main(String[] args) {
String Harr = ("Harry");
Scanner name = new Scanner(System.in);
...