Data dodania Pytanie
2017-02-18 17:02 Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Could not open connection »
I am new to Spring-MVC and Hibernate. Trying to create a test web application with Spring-MVC(4.0.3) , Hibernate(4.3.5) and using MySQL as back end. ...
(2) odpowiedzi
2017-02-18 16:02 Why does the Duration class not have 'toSeconds()' method? »
I was looking at the Duration class in Java 8 and noticed that it does not have: long toSeconds(); But it has all other toXXXXX() to get days, hour...
(4) odpowiedzi
2017-02-18 16:02 Interface methods with variable argument types »
I have java interface and class implementations that have need for different arguments when invoking similar behavior. Which of the following is mostl...
(2) odpowiedzi
2017-02-18 15:02 Java 8 Streams: Collapse/abstract streams parts »
Say I have this Stream: list.stream() .map(fn1) // part1 .map(fn2) // .filter(fn3) // .flatMap(fn4) // part 2 .m...
(2) odpowiedzi
2017-02-18 04:02 ANDROID: ViewPager with different Fragments in instantiateItem method »
I use ViewPager to create fragments that swipe left and now I want insert fragments into each fragment page. activityMain.xml <?xml version="1.0"...
(2) odpowiedzi
2017-02-17 16:02 Issues writing text file to IFS though jt400 »
All I'm trying to do is to drop a log on IFS Here is my code: def write(target_filename, data) stream = com.ibm.as400.access.IFSFileOutputStre...
(0) odpowiedzi
2017-02-17 14:02 Why direct memory 'array' is slower to clear than a usual Java array? »
I've set up a JMH benchmark to measure what would be faster Arrays.fill with null, System.arraycopy from a null array, zeroying a DirectByteBuffer or ...
(2) odpowiedzi
2017-02-17 11:02 What is the maximum size of a Java .class file? »
A .class file is a rather well documented format that defines sections and size, and therefore maximum sizes as well. For instance, a .class file con...
(3) odpowiedzi
2017-02-17 11:02 How to send javascript array to struts action by using jQuery Ajax »
I am new to Struts 2. I want to send a javascript array to a Struts action class by using jQuery AJAX request. The alert is working fine, the execut...
(2) odpowiedzi
2017-02-17 09:02 How to judge whether a list is a sub sequence of another with java8 stream? »
For example, I have a long list [1, 2, 3, ..., 10], and a short one [1, 3, 6], then I can tell that the short one is the subsequence of another. On th...
(5) odpowiedzi
2017-02-17 07:02 Does Lock guarantee a happens-before relationship? »
I have a question about code reordering and race conditions in Java. Assume I have the following code, with 2 or more threads simultaneously executin...
(1) odpowiedzi
2017-02-16 20:02 Java Math.random period »
I'm working on a big school project about random numbers, but I can't find the period for Math.random(). I have version 7.0.800.15 installed and I'm ...
(3) odpowiedzi
2017-02-16 13:02 Java 8 Lambdas - Bitwise AND Operations »
I'm currently tackling with the issue of transforming for loops which use bitwise operations using Lambdas in Java 8. Given a set of complex entries...
(3) odpowiedzi
2017-02-16 07:02 If any worker thread can update UI in android? »
I suppose that we can't update any UI view elements (TextView, EditText etc) in any worker thread but in the below example, I am able to update views ...
(5) odpowiedzi
2017-02-16 05:02 how can I make hibernate to create tables only if they didn't exists? »
how can I make hibernate to create tables only if they didn't exists? I just set "hibernate.hbm2ddl.auto" to "update" but it is giving er...
(1) odpowiedzi
2017-02-15 17:02 Spring Data JPA OutOfMemoryError: GC overhead limit exceeded »
I'm developing an application with huge size of entities(3072). We used jhipster for project structure. Everthing was ok so far until we want to upgra...
(1) odpowiedzi
2017-02-15 14:02 java "database is locked" SQL exception »
I am creating a really DB intensive java program, but I encountered an error on the connections. The code is: try{ Statement st; Resu...
(2) odpowiedzi
2017-02-15 11:02 Omitting <?> unintuitively breaks this code »
I have created a MWE where changing a single line by adding <?> solves a compiler error. The following code does not compile: import java.util...
(1) odpowiedzi
2017-02-15 08:02 TreeSet vs Java 8 Streams performance »
Which way is the most efficient to process a distinct and sorted collection? 1. Enhanced loop with TreeSet Set<MyObj> ret = new TreeSet<&g...
(3) odpowiedzi
2017-02-14 18:02 Collect into Guava's ListMultiMap using Java 8 streams »
I am trying to collect into a ListMultiMap using java 8 without using the forEach operation. If I were to write the code in Java 7, it will be someth...
(2) odpowiedzi
2017-02-14 08:02 How to use streams to find pairs of elements from two lists »
I have two lists of numbers and I'd like to find all possible pairs of numbers. For example, given the lists [1, 2, 3] and [3, 4] the result should be...
(4) odpowiedzi
2017-02-14 06:02 Post Increment Infinite loop i += i++; »
I am not understanding why this post increment equation does not increase. I would have thought that after the += operation the value would increment ...
(3) odpowiedzi
2017-02-14 03:02 Not able to debug my app on android device »
I'm not able to debug my app on my android device after I changed the package name (it was working before). I keep seeing the message below in Debug t...
(2) odpowiedzi
2017-02-13 21:02 Increase the performance of storing a JSON stream to a local database on Android »
I am developing an application that (part of its functionality) is fetching a huge list of items from a server, in JSON format, and stores it in a loc...
(1) odpowiedzi
2017-02-13 18:02 Hibernate - Manipulating collection post load »
We are trying to filter\manipulate Persistent Collection based upon the objects it contains (filter out specific entries). Since this manipulation wi...
(1) odpowiedzi
2017-02-13 16:02 Using interface Class<T> as keys to get concrete instance values? »
I have the following test case which fails to retrieve the values from the Map: package tests; import java.util.HashMap; import java.util.Map; publ...
(4) odpowiedzi
2017-02-13 14:02 "Double" composition with CompletableFuture »
I'm trying to avoid nesting CompletableFuture when combining 2 independent ones with a BiFunction that returns a third one. Currently, using thenCombi...
(2) odpowiedzi
2017-02-13 11:02 Connection Pool hanging with java multi threaded program »
I have a 24/7 java application(jdk1.5.0_19) which is multi threaded that uses OJDBC5 as the communication for oracle 11g (11.2.0.3). After verifying t...
(1) odpowiedzi
2017-02-12 23:02 Why is String concatenation faster than String.valueOf for converting an Integer to a String? »
I have a benchmark : @BenchmarkMode(Mode.Throughput) @Fork(1) @State(Scope.Thread) @Warmup(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS, b...
(1) odpowiedzi
2017-02-12 19:02 Unable to handle String literals size greater than 65535 characters. Compiler throws IllegalArgumentException »
I am trying to decode a Base64 encoded Image in Scala. The string literal is over 65535 characters long. Whenever I try to compile the below code, the...
(2) odpowiedzi
2017-02-12 16:02 Android Battery Level Detect Issue »
I am a new user to stackoverflow, this is my first post, if I have done anything wrong please feel free to tell me, thanks. I am developing an androi...
(1) odpowiedzi
2017-02-12 12:02 How SLF4J/ JPA / JAX-RS find their implementation? »
I'm learning Java and I find that there are many functionalities that are standardized : logging (using SLF4J) Persistence (using JPA) REST (using...
(4) odpowiedzi
2017-02-12 12:02 Apache Spark unable to find class »
I'm trying to develop stand alone app using apache spark alongside scala sbt I'm getting this error again and again. Exception in thread "main" ja...
(1) odpowiedzi
2017-02-12 05:02 How to avoid a useless return in a Java method »
I have a situation where the return statement nested in two for loops will always be reached, theoretically. The compiler disagrees and requires a ret...
(10) odpowiedzi
2017-02-11 21:02 Jquery Datatables server side processing SUM of a column »
I am using jQuery Datatables with server side processing to implement a reports page in my application. A report is generated on a button click. I am ...
(0) odpowiedzi