java

java

  • All Sites

1 answer

How to use a dynamically loaded interface with reflection?

I am trying to use reflection to dynamically load Log4j2 libraries and method. The goal being to have my program use Log4j2 if it is found in the class path and to simply log to console if Log4j2 was ...

1 answers | 48 secs ago by jdarthenay on Stack Overflow stackoverflow.com
1 answer

Swagger + Jersey Numeric Enum in Java

I have a field in my Rest API (Implemented in Jersey + Jackson + Bean Validation) which is a closed set of numeric values. For example, an Employee rank, which can be one of the following values: ...

1 answers | 57 secs ago by Mattan on Stack Overflow stackoverflow.com
2 answers

Homography transformation of image

Here is my sample image I want to transform the image as follows according to the red marked point. I implemented the formula described here : ...

1 answer

Registering multiple styles of an external font in java swing

I want to include a font as a resource file in my deployed application. To use it in swing, I know that I can import a font like this: InputStream is_regular = ...

1 answers | 2 mins ago by trainrobbery on Stack Overflow stackoverflow.com
3 answers

Java: returning a string from a method

I'd like to point out that I'm very new to Java, which is why I may be making stupid mistakes. I have a class called "Characters", which consists of 4 variables and multiple methods. All variables ...

1 answer

CSS and JS are not rendered when index.jsp is set as welcome file

I am facing a problem in jsp-servlet, when I am setting up my index.jsp as welcome-file (default page to run first as soon as the project gets run) at that time the CSS and JS files are not rendered. ...

1 answer

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.hibernate_sequence' doesn't exist

I am working on OneToOne mapping example of Hibernate and facing following error: I am not sure what's going wrong here. Please guide. Caused by: ...

1 answers | 3 mins ago by user4567570 on Stack Overflow stackoverflow.com
3 answers

Email Me Every Time Catalina.out Receives an Exception

Struggling with finding a solution to the pain of having to constantly access my server, load the catalina.out file, and wade through the mess to find exceptions. What are developers using to ...

1 answer

Extracting and Printing text positions

I've been doing some experiments on pdfbox and I'm currently stuck on a issue which I suspect has something to do with coordinate system. I'm extending PDFTextStripper to get the X and Y of each ...

1 answers | 3 mins ago by Opetion on Stack Overflow stackoverflow.com
2 answers

Java Indirect Access to Variables by Name at Runtime?

This question has multiple parts, and will all make sense in the last part: Is it possible to programmatically list any programmer-defined variables in a Java class at runtime..? I recently wrote a ...

2 answers | 4 mins ago by spinjector on Stack Overflow stackoverflow.com
2 answers

SDN4 Enum to String conversion fails

I have an entity class: @Data @JsonIdentityInfo(generator=JSOGGenerator.class) @NodeEntity(label="Person") public class PersonNode { @GraphId private @NonNull Long id; ...

1 answer

How Do I Resolve “does not denote a properly accessible directory” Exception with UNC Path?

A Spring boot application that implements Spring Integration is attempting to access a UNC path for it's inbound-channel-adapter. The problem is that I'm receiving the following exception: ...

1 answer

How to write a java EJB async service?

I tried to do this @Consumes(APPLICATION_XML) @Produces(APPLICATION_XML) public class TestService { @POST @Path("querymember") @Asynchronous public Future<String> ...

1 answers | 6 mins ago by sowen on Stack Overflow stackoverflow.com
1 answer

Find coordinate of a cell in an array of characters

How would I find a coordinate of a cell in a 2d char table. For example if my table would display something like this: .....@@@@..... .........@@@..... .....@@@@..... I want to find the second ...

8 answers

Confusing output from String.split

I do not understand the output of this code: public class StringDemo{ public static void main(String args[]) { String blank = ""; String comma = ...

1 answer

Markers not shown on styled MapView on Mapxbox Android

I need some help on Mapbox Android. I've drawn without problems a polyline and some custom markers on a default styled map, but, when I change the default style into a custom style, I can still see ...

1 answers | 8 mins ago by Juzmulti on Stack Overflow stackoverflow.com
0 answers

Make an image follow the mouse on button click in java

I am using java and would like some functionality so that when I click a button, the image associated with said button follows the mouse. I have the following code, which is executed in the ...

2 answers

ResultSet.next() row counter fails to count

I'm trying to figure out why this won't count and show Rows: 2 when I enter "ashton" for username and "ashton" for password. In my database I inserted 2 entries of username and password. Here's the ...

2 answers | 9 mins ago by p3ace on Stack Overflow stackoverflow.com
2 answers

How to determine if there's a run of characters in an array?

Say we have an array: array = [1, 0, 0, 0, 1, 0, 1, 1, 1]; And we want to find a "run" of duplicate numbers where there are at least three in a row. In this case, it would be the set of 0, 0, 0, ...

0 answers

org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111 on a non-managed entity

I'm calling a stored procedure from postgres database, this SP returns a table in which i map into a non-managed bean, when i call the the REST service it gives me this exception: ...

0 answers

How can I group my jar dependencies with Gradle for Eclipse?

I'm working with a Java project with a good number of dependencies listed in the build.gradle file. In Eclipse they all show up in a big unsightly list in the Project Explorer tab. How can I combine ...

0 answers

How to refresh component of Fragment layout via JSONrequest?

how can I refresh a component of a fragment layout using a JSONrequest. Currently, onButtonClick, I am refreshing the entire layout, hence sending the JSONrequest each time I want to refresh a small ...

0 answers

Can't autowire repository in specific service class

For some unknown reason after writing some piece of new code I can't autowire repository which cause NullPointerException. Everything had worked just fine but out of nowhere that just stopped. I ...

6 answers

Difference between isEmpty() and length==0

What is the difference between these two methods? public boolean nameControl(String str) { if (str.trim().isEmpty()) return false; if (str.trim().length() == 0) return false; return ...

6 answers | 13 mins ago by Sajjad on Stack Overflow stackoverflow.com
8 answers

How to automatically generate getters and setters in Android Studio

I am working on a Android application and created a model with a large number of variables. Since I am planning to add getters and setters for all of them. Is there a shortcut in Android Studio for ...

0 answers

IF condition and LOOP'ing throuh an ArrayList

Here's the situation. The method on the top should merge two String elements in an ArrayList that are side by side with each other. If the length of the ArrayList is Odd the last String element ...

0 answers

My Android Crash when executing code

When i run this LibGdx code on IntelliJ using The DesktopLaucher its fine. But when i run it into my Android via USB the app crash. public class GraphicInterface extends ApplicationAdapter { private ...

2 answers

Sprint Boot JPA won't update record with save method

I am rather new to Spring Boot and JPA and am trying to update a record in a mysql database. In my controller below, I am able to successfully save a new record into the database and lookup existing ...

0 answers

Using espresso view matcher with hamcrest matchers

Can someone please tell me why does not this works onView(withId(R.id.edt_apikey)).check(matches(hasErrorText(anyString()))); Shows this in logcat: ...

0 answers

Why the bmp image that my program creates does not open?

My steganography program takes a string and a bmp image from the user and creates a new bmp image of the same photo but slightly altered to hide the string in the LSB of each byte in the image. ...

15 30 50 per page
1 2 3