I am using Python to insert value in a database through an API written by someone else in Java. The insertion goes quite slow, and when I look at the mysql log of the transcactions for one insert I see that it often does select @@session.tx_read_only: From http://docs.oracle.com/cd/E17952_01/refman-5.6-en/ser…
Tag: java
Ways to make maven build faster?
I have a multi module java project. Maven takes almost around 40 secs to build it. I have tried maven with multi threaded builds too by specifying -T and -C args for no of threads and cores to be used. But I haven’t seen any significant improvement in wall time of my builds. I am using maven 3.2.3 and s…
net.sf.jasperreports.engine.JRException: Invalid page index range : 0 – -1 of 0
When I try printing the Jasper report it gets me the message: “net.sf.jasperreports.engine.JRException: Invalid page index range : 0 – -1 of 0”. Code: Report: Could someone help me to figure out why is it happening? Answer JasperFillManager likes to get a data source, even when you don’…
How to add image along with title name for all pages in that project in one code in Struts 2
I wrote the mentioned code in head section of JSP page and it is able to display the image along with the title name of the page but what I want is it should be reflected on all my pages of project. So what should be done ? Note: Made a favicn.ico and environment is Java Struts 2 Answer Create
How do I convert [[Ljava.lang.String;@7defb4fb] to a String
I am trying to print the String, below is the code: but I get following output in the console: I have tried the following snippets: But all of these are giving similar strange output: How do I get the string value out of it? ** Edit: ** My problem was to print and array of an array in Java. First
How to enable CSS editing in Intellij
I just switched to IntelliJ IDEA because I thought it would be great for developing JavaFX application. I must be doing something wrong because when I am editing a CSS file, there is no code-completion. When I am trying to create a new CSS file there is no option for CSS files. I am using the community versio…
What is the difference between getText() and getAttribute() in Selenium WebDriver?
Both are used to get the WebElement value in between tags. Is my assumption right? If wrong, please elaborate. Answer getAttribute(attr1) you get ‘a’ getAttribute(attr2) you get ‘b’ getAttribute(attr3) you get ‘c’ getText() with no parameter you can only get ‘foo̵…
How to suppress violations in PMD?
When I run a PMD analysis I receive violation: Each class should declare at least one constructor This violation is on a Spring controller. This controller is instantiated by Spring, so I shouldn’t need to invoke this class. What is recommended way of ignoring this violation? According to this doc can u…
Hive NVL does not work with Date type of the column – NullpointerException
I am using MapR Hive distribution over HDFS and facing below issue. If for a table the column type is ‘Date’ type, then the NVL function does not work. The same is working for other datatype. It simply throws Even explain function is throwing same exception. Kindly help here. Is it a bug in Hive d…
Spring – No EntityManager with actual transaction available for current thread – cannot reliably process ‘persist’ call
I get this error when trying to invoke “persist” method to save entity model to database in my Spring MVC web application. Can’t really find any post or page in internet that can relate to this particular error. It seems like something’s wrong with EntityManagerFactory bean but i’…