Category "java"

Jsch java ssh client is not getting disconnected after command gets executed

I am using java ssh client (http://www.jcraft.com/jsch/) to connect to remote machine and execute the command. The code is working fine till i connect to remote

How to configure log4j in a Spring Mvc application configured with Java Annotations and using a log4j.properties file

I'm working on a Maven Web application using Spring MVC 4.2.5.RELEASE, I'm using Netbeans IDE with GlassFishSErver 4.1, I want to use log4j 1.2.17 so I created

Get path to all XML's nodes

I have an example XML as follows: <message> <metadata> <msg_id>1</msg_id> <client_type>type1</client_type> <

How do I clone a java byte array?

I have a byte array which i want to copy/clone to avoid calling code from modifying my internal representation. How do I clone a java byte array?

Composite Primary Key using MongoDB and Spring Data JPA

Could someone tell how to create a composite key in Spring Data JPA using Mongo DB

How to run a .jar in mac?

I've written a relatively simple java application. I have JDK on my PC, but I need it to run on a mac for school. The .jar runs perfectly on my PC, but I tested

How to list all embedded files from a microsoft office document, using Apache POI?

is there any opportunity to list all embedded objects (doc, ..., txt) in a office file (doc, docx, xls, xlsx, ppt, pptx, ...)? I am using Apache POI (Java) Li

How to do I locate a Google SpreadSheet ID?

https://developers.google.com/apps-script/guides/rest/api#parameter_and_return_types When using the Google Execution Api for Java, the ID of the spreadsheet is

How to create an ArrayList that is accessible by different classes in android? [duplicate]

I got a CameraView class (with an onPreviewFrame) which on each incoming frame calculates a value of 1 or 0 depends on the frame brightness, I

Can I use generics over reference types only?

While coding a Map<>, I found out that declaring Map<int, int> is a syntax error while Map<Integer, Integer> is OK. Is it only possible in Jav

Select random element from the list in Selenium Java and click on it, but getAttribute is not equal to zero

I'm trying to get random element from the list and click on it. The thing is, the elements are products which have attribute "quantity" and I want to click on t

CORS : Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request [duplicate]

I am trying to integrate the angualar js app with the backend spring boot , in which i am facing the redirection is not allowed for a prefligh

Micronaut @Requires annotation not respected in pipeline

I have built a Micronaut application which so far has not had any CI pipeline. All builds work flawlessly on all developer computers, but I can't for the life o

What is the difference between a Hashtable and Properties?

What is the difference between a Hashtable and Properties?

Does java have something similar to C# properties? [duplicate]

C# properties (I mean get and set methods) are a very useful feature. Does java have something similar to C# properties too? I mean how we can

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

I'm working on getting my database to talk to my Java programs. Can someone give me a quick and dirty sample program using the JDBC? I'm getting a rather stup

Using WireMock with SOAP Web Services in Java

I am totally new to WireMock. Until now, I have been using mock responses using SOAPUI. My use case is simple: Just firing SOAP XML requests to different endp

Using @Fetch(FetchMode.Join) in Hibernate

I have two classes, Test2 and Test3. Test2 has an attribute test3 that is an instance of Test3. In other words, I have a unidirectional OneToOne association, wi

Asynchronous processing with fallback java

I am working on an java application that will makes calls to a web service, I dont want to incur additional latency while making these calls hence I am planning

Can i remove an element while enumerating through a Properties object?

Can i remove an element while enumerating through a Properties object ?