Why scanner.hasNext () hangs when reading the HTTP request

I am writing a server that receives http request(only GET method as part of simplification from school work) I used Socket class to get the connection I then used InputStream as well as Scanner to read the http request. However, while I was reading t

Nexus Proxy Repository at http://dynamicjasper.com FAILED

I'm trying to create a Nexus Proxy Repository to http://nexus.fdvs.com.ar/content/groups/public/, but we have only problems!!!! When I try buid my maven project, my Nexus does not find the DynamicJasper:4.0.2 artfact and the bellow error happens: [ER

Put only a certain number of lines in a char array

I have a file with 2939 lines, and I am trying to save the five lines together in one index of a 2D char array. So, char [][] myArray; myArray[0] = {} //<--char array of first five lines myArray[1]= //char array of next five lines the way I am implem

Store the return value of the method in ArrayList

I am writing a program that creates a game board, and uses a superclass and subclasses to generate the board. Essentially, I want to use an arrayList that stores the values returned back from the methods of the subclasses of Cell. But I cannot figure

While - try - catch in Java

I need a java program that ask a number between 0 and 2. If the user write 0, the program ends. If the user write 1, it executes one function. If the user write 2, it executes another function. I also want to handle the error "java.lang.NumberFormatE

how to read some xml points using java

I'm new to XML and I want to append points from an XML file to a point container that I wrote. this is the XML file: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <container> <point> <X>56<

Cordova 4.0.0: call exec () to an unknown plugin

I generated the code using the Cordova 4.0.0 CLI. Now I try to write a Plugin for Android (MyPlugin) to execute native code from the webview. But everytime i try to call the plugin's method I receive the errormessage: exec() call to unknown plugin I

memory leak - metrics-meter-tick-thread and new I / O client

I am running spring-mvc application. When i was closing Tomcat server, it shows SEVERE: The web application [/myapp] appears to have started a thread named [metrics-meter-tick-thread-1] but has failed to stop it. This is very likely to create a memor

Dynamic generation of a 2D array with different column lengths

For testing purposes I currently ran into a situation, where I had to randomly create a two dimensional array with columns of potentially different lengths for each row. For example consider this illustration: 0.0 0.1 length = 2 1.0 1.1 1.2 length =

A class in a jar file reads the files outside the jar

So following is my project structure: a jar file (named patch.jar) and a resource folder; so in jar file there is a class (named patch.class); in resource folder there is a sub folder (named scripts) and in the sub folder there is a file (named patch

Eclipse with Glassfish 4 DEBUG source search does not work

I'm running Eclipse Kepler with Glassfish 4. I'm developing a set of bundles/plugins, which get deployed to the glassfish autodeploy folder. Also deployed to that folder are bundles from my target definition. The problem is when debugging the source

Chain Match Operation

I have two Strings (they can be anything) like I am a boy and I am a man. Where I am a is common. My task is to find out the common words from two strings. I used Set<String> to store the data, but it only stores unique values. So my question is, ho

Use Selenium to press the tab, then write with Java

I want selenium to press "TAB" for me and then write something in the focused field, now I know that I can use sendKeys(Keys.TAB) But as I understand it That require a locator behind it, I want to test the tab order of my page and to do so, I wa

how to use jdk for java projects in eclipse?

I install jre and jdk, then install Eclipse, I want to create new java project and run it with jdk. For another program I need rename jkd on jskd, in tip JRE in eclipse I can't choose jsdk, how to change this?It's really difficult to understand what

How to AutoWire an object without Spring XML context file?

I have an Interface with Component annotation and some classes that implemented it as follows: @Component public interface A { } public class B implements A { } public class C implements A { } Also, I have a class with an Autowired variable like this

How to display ArrayList data every hour?

I want to show data in this format, 12-22-2011 11:00:00 [12-22-2011 11:13:39] Warning: Contact 'nagiosadmin' service notification command '/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: C:\ Drive Space\nH

Profile Java Process on AIX with VisualVM

I have connected VisualVM via JMX to an AIX server to profile my Java process. But the "Profiler" tab is missing I just get Overview, Monitor and Threads. Have I missed any configuration? When opening a local Java process I see the "Profile

Java vs. C ++ - Raytracing

I created simple ray tracer in Java as a hobby project, and well, it's slow. Not dramatically slow, but slow nevertheless. I wonder if I can get any performance gain using lower level language like C or C++ or will the difference be negligible and I

Click on the event on jTable -Java

This question already has an answer here: ActionListener on JLabel or JTable cell 2 answers I have created a table in java in Netbeans and filled it with some data. Now I want to show some detail in a text area corresponding to the particular column

Selection of plain text xml

Given xml like this: <container> <item> <xmlText> <someTag> <otherTag> Text </otherTag> </someTag> </xmlText> </item> <container> I would like to select all text that is under item/xmlText. I wou

Why does `jLabel1 = jLabel2` not change the displayed value?

I have two JLabels created and added one of them to my JFrame but when I assign the other one to the added one the JFrame doesn't update add(jLabel1); jLabel1 = jLabel2; how can I fix this?In this line: add(jLabel1); You're adding to the GUI the obje

PHP to Java communication

I want to use PHP to communicate with a java using shared database to communicate, please help me with sample code or logic. Thank you. EDIT: I appreciate your suggestions, Yes I will be using both php and java to connect to thesame database. The iss

Dynamically create xhtml from db data in ICEFaces

we are migrating our application from an existing custom web application framework to JSF/IceFaces. we store window description in database: what kind of fields are on the window, what are their labels, etc. Can I have my xhtml pieces generated dynam