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
4 views
Changing version of ObjectMapper when migrate to latest version of Jersey
I have legacy code on Jersey 1.xx
ObjectMapper mapper = new ObjectMapper();
SerializationConfig serializationConfig = mapper.getSerializationConfig();
serializationConfig = ...
0
votes
0answers
14 views
Issue whilst trying to check if a HashMap contains an instance of a custom class
I am trying to check if a HashMap keyset contains an instance of a custom class and compare 2 instances of the same class.
Coordinates Code:
package net.button.utils;
public class Coordinates {
...
0
votes
0answers
1 views
Get Full Stack Trace from Log4j LoggingEvent
I'm building a logger interceptor so that I can do some interesting stuff with the logs being printed out across several dozen applications and then submit it to a queue so that one single application ...
0
votes
0answers
3 views
How to set the TCP_NODELAY socket option when using java.net.URLConnection
I have a java client application that connects to a 3rd party api. I uses a standard URLConnection object to do the HTTP GET requests but I would like to have the ability to turn off the TCP_NODELAY ...
-1
votes
0answers
12 views
how to create a layout file in android using xml
how could i design a layout file in which top contains IMAGES and middle TEXT VIEW with SCROLL BAR and down again IMAGES.so please help how to develop the xml page,
thanks in advance.
-1
votes
0answers
13 views
Implement speedometer
I want to implement speedometer in Android which will show current speed of the users. I have made the classic type with fixed needle, made the image png move over the speedometer but what I really ...
0
votes
0answers
10 views
Find ip addresses connected to the android hotspot from java code
I am writing a program that is using an android phone as a remote control via TCP/IP. The phone hosts a hotspot network that the devices connect to by knowing the SSID and password. It then connects ...
0
votes
2answers
20 views
Order of components in a JPanel (Java)
How can I decide the order of components when using a JPanel? My code looks something like this:
panel = new JPanel();
panel.add(a);
panel.add(b);
panel.add(c);
[...]
panel.remove(b);
[...]
...
0
votes
0answers
5 views
How to setup xa datasource using Spring and weblogic
I am having an issue creating xa datasources in spring 4.0.
I have setup my datasources in weblogic using an xa driver.
I then added added jndi-lookups for the data sources in spring:
...
0
votes
0answers
5 views
SVNKit update XML file in a branch
Good day,
I only started using SVNKit last week, so I'm a bit inexperienced. I need assistance with an algorithm. I'm attempting to update a XML file in my repo. This is my alogrithm, but I'm ...
0
votes
0answers
6 views
Extending URLClassLoader and overriding getPermissions does not work
When trying to implement a sandbox in a plugin-like environment, I came accross http://stackoverflow.com/a/5580239/2057294 which seems exactly like I want, however I am unable to get it working, what ...
0
votes
0answers
4 views
SMS sent via JSMPP not saved on a phone - “push” only
I'm sending SMS via JSMPP as described in SubmitMultipartMultilangualExample.java provided by JSMPP authors. Current SMS is with latin symbols only and does not overlap 160 chars limit - no multipart ...
0
votes
0answers
15 views
im looking for a class or a jar to handle file uploads in a jsp
I'm writing a jsp to upload a profile image to a user.is there a class, servlet , jar file that let me handle this with ease.
i have seen some solutions out there like com.oreilly.servlet but it ...
0
votes
0answers
44 views
How do I skip to the next object in a for loop if a condition isn't met
I've got a big loop here that sits inside of a method that imitates a mass text message to all of the people inside of my address book. This loop(successfully) checks an email that contains any ...
0
votes
0answers
9 views
Java templates and custom widgets
i'm building a custom html5 tabset that can be reused by others using a custom template server side.
Now i'm using velocity. The problem is that i've defined a basic semantic for my tabset like this:
...
0
votes
0answers
10 views
Sonar custom rule not apply
I am trying to run custom rule (based on
https://github.com/SonarSource/sonar-examples/blob/master/plugins/java-custom-rules/src/main/java/org/sonar/samples/java/ExampleCheck.java)
Mentioned rule is ...
0
votes
0answers
2 views
org.apache.struts2.dispatcher.Dispatcher: Exception occurred during processing request: Stream closed java.io.IOException: Stream closed
Im using tomcat security manager for my application. When i run my application it is thrown this exception
org.apache.struts2.dispatcher.Dispatcher: Exception occurred during processing request: ...
0
votes
1answer
28 views
(Android): Unable to start activity ComponentInfo [duplicate]
My problem is that when I run my app on the android emulator the app starts up but quickly crashes and displays the popup: "Unfortunately, NewBusinessListing has stopped." and I have looked at the ...
0
votes
2answers
34 views
how to give input from array whenever it ask input from keyboard in java
Suppose i have a class named Invoked, to which i want to call using reflection from Invoker class. but i want to give input from array declared in Invoker class whenever it get code for input from ...
0
votes
0answers
21 views
How to call another controller URL mapping using Spring
I am having two maven project one is Test-run1 and Test-run2.Both the projects are exposed as Spring Rest ie both have seperate URL request mapping.
Test-run1 controller :
...
0
votes
1answer
5 views
Unable to run selenium web-driver scripts through build.xml using ANT
Getting this error "error: package jxl does not exist" while executing build.xml file using command prompt/hudson tool
I am using Testng+ant to run my existing developed selenium webdriver scripts ...
-5
votes
0answers
32 views
how to replace data stored in hashmap with data stored in other hashmap in java
here is my code plz tell how to write expansion function for the above code
package com.mypack;
import java.io.FileNotFoundException;
import java.io.IOException;
import ...
-2
votes
4answers
35 views
how to get the point to 3 decimal and in usd format in java
Hi here i have the code below to show a number into usd format
Long amount = 1234L;
NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("en", "US"));
String moneyString = ...
-1
votes
1answer
34 views
Remove duplicate white spaces in string using Java?
How to remove duplicate white spaces (including tabs, newlines, spaces, etc...) in a string using Java but not to remove duplicate white spaces in " " and ' ' quoted values within the input sptring ?
...
0
votes
0answers
2 views
Maven and cxf: abstractMethodError (getConduit) with web service
i'm trying to connect to EJBCA server with my client run on jboss. If my client is a standalone java application it runs correctly, but when the client is a Rest web service i have this error:
...
0
votes
0answers
15 views
How to inject JmsTemplate object using annotations in a spring class?
I am trying to inject a JmsTemplate object into a class using @Autowired, but it is giving a NullPointerException whenever I try to send messages. While in the application class I could instantiate ...
0
votes
0answers
28 views
Arrow keys priority (java rpg game)
I'm working on a java game using LibGdx and I need your help.
Explanation: There is one issue that I have with the arrow keys. Let me explain how my code works first. So in my update method, I check ...
0
votes
1answer
18 views
Add prefix to the default namespace “xmlns”
I am trying to add prefix to the default namespace of the DOM object, I was unable to achieve that, I have created a new node with no default Namesapce in it printed it to make sure no default ...
0
votes
0answers
3 views
Cannot add Spring Cache advice to method - internalCacheAdvisor is created in same batch as cachable annotated bean
We have refactored some parts of our application, and after that, methods annotated with spring cachable stopped being cached although the class containing the cached method was not touched.
After ...
0
votes
1answer
70 views
How to get Second Most repeated Word in String using Maps
I am trying to get the second most repeated word in the sentence.
eg:
String paraString = "This is a paragraph with multiple strings. Get the second most repeated word from the paragraph text and ...
-2
votes
0answers
41 views
App crashed whithout any error [on hold]
Below is the logcat of my project. my app doesn't show any errors but when I tried to run the project on my phone the app crashes
the logcat
10-13 19:57:50.896: E/USB(3322): [CSSVC ...
1
vote
1answer
27 views
NoSuchMethodError for calling an Enum subclass type's valueOf() with reflection?
Luckily, to solve this problem of mine, I could use Java: instantiating an enum using reflection (the following line: Enum.valueOf((Class<Enum>) class.forName("me.example.enums.MyEnumType"), ...
1
vote
1answer
44 views
need a new pair of eyes to find out why my quads aren't being colored
i am making a opengl engine for learning purposes and in a later stadium develop some games/apps with it. Now with the newest iteration of my engine i cant seem to find out why my quads aren't being ...
-1
votes
0answers
15 views
Fail to translate, Bing Translation API [duplicate]
Good day guys, i need help in my translation application which it could not run the translate() method and keep on return me the catch statement in my try catch. Much appreciated.
MainActivity.java
...
0
votes
0answers
5 views
How to read Logback configuration file from path outside the war file?
I have a requirement where I want to place all logback configuration outside the war file.
Presently I have placed my configuration file (logback.xml) on the classpath.
I am using the JBOSS EAP web ...
3
votes
6answers
98 views
Sort an ArrayList of Strings that are numbers
What is the fastest way to sort an ArrayList<String> (in descending/ascending manner) that contains numbers, eg: { "12", "3.5", "188", "33.03" } ? Does Collections have a built-in method for ...
0
votes
0answers
13 views
Spring Batch for processing large CSV file
I have a 5gb CSV file that I am trying to process with Spring Batch (read, process, write to db). What is the best way to go about this keeping in mind that I have requirements to not use any XML ...
-1
votes
0answers
15 views
Nice 2D dimension/layout drawing software for building game stages [on hold]
I am building an easy Android game and I am spending a lot of time to calculate the x, y coordinates, width and height of the many stage objects (rectangle and other shapes) for the stage design.
Is ...
1
vote
1answer
17 views
Does SOAP Web services support only “POST” http method
I faced this question on one of interviews, so could you please tell whether SOAP Web services support only "POST" http method ot there is some way to accept other methods on the server side?
Thank ...
1
vote
0answers
9 views
How to check for existence of subtree in XML document
I need to check if an XML document contains a given XML DOM subtree. I only need to ensure that all the elements and attributes from this subtree are present in the document. However, there can be ...
0
votes
0answers
9 views
Error during WebSocket handshake: Unexpected response code: 404
I trying a simple websocket application but its giving a error,
WebSocket connection to 'ws://localhost:8080/WebSocketPrj02/chatroomServerEndpoint' failed: Error during WebSocket handshake: ...
2
votes
6answers
67 views
Why “Java does not support Multiple Inheritance” is explained using Diamond case issue only while working with Inheritance?
This question might sound weird to Java people but if you try to explain this, it would be great.
In these days I am clearing some of Java's very basic concept.
So I come to Inheritance and ...
0
votes
1answer
12 views
ServerEndpoint and web.xml
I have some Soap, REST servlets and now one WebSocket:
@ServerEndpoint("/game")
public class WebSocketgame{
...
}
I have next trouble: WebSocket dont visible, if web.xml is exists. In web.xml ...
0
votes
0answers
1 views
WScript calling jar fails
What I want to do is simple. I want to run a jar in background from within php.
I simply don't want to wait, until java executes all what it has to, to get content of the web page.
Here is the ...
0
votes
0answers
18 views
JpaDaoSupport classNotFoundException with Java 8
We have been trying to upgrade our application to Java 8 from Java 7.
While deploying the application on Tomcat we get the classNotFound exception for JpaDaoSupport of Spring ORM.
Spring version that ...
0
votes
0answers
8 views
Android Rich Push Notification Expanded Image recommended Height/Width
I am doing Rich Push notification, everything working fine. Only thing I am stuck at is a common size of Rich notification image which can fit nicely on all available ICS/ICS+ devices.
Here is ...
3
votes
0answers
25 views
Creating a connection with Java ODBC results in a java.sql.SQLException: Invalid Cursor Type exception
I am trying to create a Java program that accesses a ODBC datasource. Using the following code...
ODBCConnecton odbc = new ODBCConnection(); // This creates a connection to the ODBC datasource, which ...
-7
votes
0answers
25 views
Java - Block Incoming Ports
I want to prevent users from using the internet by a java program.
Program not running:
User trying to visit page http://www.google.com
User gets full access to internet
Program running:
User ...
1
vote
2answers
42 views
dynamically change the length of String inside the EditText field in Android
I am using an EditText field in my application.
EditText is for entering the ddns input:
e.g www.example.com/xxxx
I want to restrict the length of the ddns id to 30 characters after "/" ...
0
votes
1answer
32 views
Socket Exception : Connection Reset
Socket Soc=new Socket("whois.internic.net",43);//Creating a Socket.
InputStream In=Soc.getInputStream(); //Getting Input Stream
OutputStream ...