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’…
Unable to create call adapter for class example.Simple
I am using retrofit 2.0.0-beta1 with SimpleXml. I want the retrieve a Simple (XML) resource from a REST service. Marshalling/Unmarshalling the Simple object with SimpleXML works fine. When using this code (converted form pre 2.0.0 code): Service: I get this exception: What am i missing? I know that wrapping t…
Logging JSON-RPC calls using jsonrpc4j
I’m sure that if you have used jsonrpc4j (outside a spring container) you will recognise the following standard pattern. I am trying to create a log file containing all the JSON requests and JSON responses. i.e. I’d like to log the incoming JSON RPC request before it is deserialised and log the ou…
Java “”(” expected” compiler error
I’m a beginner in Java and after a few time of studying this language by books, I decided to write a simple program that “encrypts” a string by replacing numbers with letters and vice versa. It is not finished yet and has some considerable restrictions, but it should work as is. The code: It…
Does proguard converts all enums to int or needs to be configured for this
Does proguard automatically converts enums to integer for memory optimization or I have to configure it to do this? If I do have to configure what is the configuration? Answer The optimization is listed on ProGuard’s optimizations page. It appears to be one of the default optimizations, but it (like oth…
Java 8: Lambda with variable arguments
I am looking for a way to invoke multiple argument methods but using a lambda construct. In the documentation it is said that lambda is only usable if it can map to a functional interface. I want to do something like: Is there any way one can do this elegantly without defining 10 interfaces, one for each argu…
javax.servlet.ServletException: Not running on Jetty, JSR-356 support unavailable
I am facing a problem while deploying a war on to tomcat instance, Tomcat version details, POM Dependency : I have created a war using maven plugin and tried to deploy on tomcat 7. I was able to deploy but unable to start the webapp. When I find the logs for it, it gave below stacktrace, Any help would be