You’ll quickly realize that JDK8 is a lot more strict (by default) when it comes to Javadoc. (link – see last bullet point) If you never generate any Javadoc then of course you’ll not experience any problems but things like Maven release process and possibly your CI builds will suddenly fail…
Tag: java
How do I unit test spring security @PreAuthorize(hasRole)?
What do I need in order to unit test the hasRole part of a PreAuthorize annotation on a controller method? My test should succeed because the logged in user only has one of the two roles, but instead it fails with the following assertion error: java.lang.AssertionError: Status Expected :401 Actual :200 I have…
How to split a byte array around a byte sequence in Java?
How to split a byte[] around a byte sequence in Java? Something like the byte[] version of String#split(regex). Example Let’s take this byte array: [11 11 FF FF 22 22 22 FF FF 33 33 33 33] and let’s choose the delimiter to be [FF FF] Then the split will result in these three parts: [11 11] [22 22 …
Hibernate C3P0 settings performance issues
Since we have added C3P0 connection pooling to the application performance became slower. It is Oracle 10g database, Hibernate 3.1.3 and C3P0 0.9.0.4. WebSphere application server. I am very new to this things, so I don’t understand everything. Is this configuration could slow down the app performance? …
what does the -> operator means and usages in grails?
I am new working with grails application.I am confusing about this -> operator in grails. Can anyone give me clear concept about this? or Give me any reference about this that can be easy for me. I am already reading online documentation and some books but i am still confusing about this operator and usage…
Kill process before disconnecting
I am using Jsch to tail a server-log. When I close my exec-channel and session, the “tail -f …” process still stays alive at server side. I tried to do channel.sendSignal(“KILL”) but it throws an exception: com.jcraft.jsch.JSchException: failed to send channel request how can I d…
What’s the difference between next() and nextLine() methods from Scanner class?
What is the main difference between next() and nextLine()? My main goal is to read the all text using a Scanner which may be “connected” to any source (file for example). Which one should I choose and why? Answer I always prefer to read input using nextLine() and then parse the string. Using next(…
Terminating a Java Program
I found out ways to terminate (shut-down or stop) my Java programs. I found two solutions for it. using return;When I want to quit or terminate my program execution , I add this. using System.exit() ; Sometimes I used it. I read about System.exit() from this question. So, I know a little on both them. But I a…
Failed to start service jboss.persistenceunit: org.hibernate.service.UnknownServiceException
I would like to ask if somebody could help to resolve this problem because I’m stuck with it and I don’t know where the problem could be. Until now I developed my application under Glassfish Server 4. Now I deceided to change my server for WildFly and I edited some configs to be able to run it on …
Hibernate query fails with “this_.id must appear in GROUP BY” when using projection.count or projection.rowcount
Edited to provide more detailed information. I’m building a web service using Spring 2.5.6 and Hibernate 4. I’m dynamically building a criteria query based on input from a client. We are using Spring 2.5.6 because it is legacy code, previous attempts to upgrade to later versions of Spring by updat…