How much memory should I use in my Java program?

I am making a Java program. It involves making a image with size up to 9933 * 14043 pixels (which is A0 size and 300 ppi). The image is 24 bit, so it would take up about 400mb of space. The BufferedImage class some how take more RAM than the bitmap'...
more »

2017-08-13 18:08 (1) Answers

Mailgun send user specific html emails using Java

I have been playing around with mailgun, but there seems to be no way how I can send user specific email with html content. Meaning I dont want to send same email to every customer but with "Hi xyz user, ". I read and it says that I should use reci...
more »

2017-08-13 17:08 (0) Answers

When is a Java 8 Stream considered to be consumed?

My understanding was that a Java 8 Stream is considered to be consumed once a terminal operation, such as forEach() or count(), is performed. However, the test case multipleFilters_separate below throws an IllegalStateException even though filter i...
more »

2017-08-13 09:08 (2) Answers

spring data rest post sub-resource

I am using spring data rest and want to post a new resource and its sub-resource.Both of them are new resource so there is no link pointing to either of them.In fact,the following json is a reasonable json I think to post the new resource and its su...
more »

2017-08-13 09:08 (1) Answers

Jersey Service and Persistence Layers

I'm am developing a simple Question and Answer service (Jersey JAX-RS). With this service, I've come up with the following resource so far (might increase). GET|POST -------------/questions GET|PUT|DELETE -- /questions/{id} GET|POST ------------ /q...
more »

2017-08-13 08:08 (1) Answers

okhttpclient for android and Laravel API

Currently building an Android App that has a Web Service. Trying to get data from the SQL Database using the okhttp3 but I'm getting a weird response and I can't figure it out. My API in Laravel is: public function getAccount(Request $request, User ...
more »

2017-08-13 01:08 (1) Answers

Java base as Template parameter

I am semi Java literate and trying something in Groovy. Is the following possible in Groovy/Java: public class A { } public class B { } public class C<Ta extends A, Tb extends B> extends Ta { public Ta[] bArray; public Tb[] getAllBs() ...
more »

2017-08-12 20:08 (2) Answers

Generics vs. JavaFX

I fail to understand why there are certain ways my code doesn't work properly. This is the short but very dirty (who'd put a Stage into a TableView?) small sample code: package test; import javafx.application.Application; import javafx.scene.Scene;...
more »

2017-08-12 18:08 (0) Answers

Error creating bean with name 'validator'

I'm trying to create bean validation (I'm using tomcat server 7). When I added this piece of code @Bean public Validator validator() { return new org.springframework.validation.beanvalidation.LocalValidatorFactoryBean(); } I got the error org...
more »

2017-08-12 12:08 (2) Answers