Category "java"

Google Cloud: Pubsub subscription filter expression options

I am trying to put filter in the GCP pubsub subscription. My requirement is to add number of codes in the filter. I am using terraform for that. Here is somethi

Field in com.XXX required a bean of type that could not be found

I'm working on Spring over Hibernate project an i'm only in the beginning. I'm tryng to hav a SpringBootApplication which writes to MsSql some LogEntries object

Retrieve time tag with Jsoup

This is my Html: <div id="trestleLifts"> <header class="tableHeader"> <time>as of 4/23/15 @5:18 AM MST</time&g

How do update a scheduled quartz Job?

Both of the below snippets give this error: org.quartz.SchedulerException: Jobs added with no trigger must be durable. JobDetail job = scheduler.getJo

SonarQube: Invoke method(s) only conditionally

The following part of code raises a major bug at SonarQube : "Invoke method(s) only conditionally." How am I supposed to fix this? if(us != null){ logger.

Error creating bean with name 'org.springframework.transaction.annotation. error at ::0 formal unbound in pointcut Spring AOP

I'm facing an error that mentioned below, related to Spring Aspect Oriented Programming. 2022-05-06 17:26:44 ERROR org.springframework.boot.SpringApplication.ja

How to fix org.apache.spark.SparkException: Job aborted due to stage failure Task & com.datastax.spark.connector.rdd.partitioner.CassandraPartition

In my project i am using spark-Cassandra-connector to read the from Cassandra table and process it further into JavaRDD but i am facing issue while processing C

Why is reading a JDBC ResultSet by position faster than by name and how much faster?

Announcing Hibernate 6 the Hibernate team claims that by switching from read-by-name to read-by-position in JDBC ResultSet they gain a performance benefit. Hig

Jaxb ignore the namespace on unmarshalling

I use Jaxb2 and Spring. I am trying to unmarshal some XML that are sent by 2 of my customers. Up to now, I only had to handle one customer which sent some xml

Check for corrupted JPEG files in Java

I need a fast Java way to check if a JPEG file is valid or if it's a truncated / corrupted image. I tried to do it in a couple of ways: using the javax.ImageI

Retrofit 2 send an empty array

I'm sending an array of integers to the backend via this Retrofit interface: @PATCH("save/ids") @FormUrlEncoded Call<Output> saveIds(@Field("ids[]") List

Do we need to call awaitTermination on ScheduledExecutorService?

I am new to Java multithreading. I have thousands of scheduled tasks/threads that I need to be executed. I am using the following code: ScheduledExecutorSerivce

Replace 0s of jTextField as I type

I want jTextField with 12 0s and I need to change those 0s to numbers I type as I type. In begining there is 000000000000 If I type 123 then it should be 0000

Method executeQuery cannot be used for update. ERRORCODE=-4476, SQLSTATE=null

I am using Spring batch framework to read from db2 and getting error. Please note that same is working fine with Mysql. When using db2 its making entry in meta

Which is the best way to append single quotes for a String in java

For example, String x= "ABC"; Which is the best way to convert ABC to 'ABC' ?

Update database table through jsp to jsp

View.jsp this jsp to fetching the data from the database. <form method="post" action="updatedemo.jsp"> <table width="50%" border="1" align="center"

Need Jackson serializer for Double and need to specify precision at runtime

There are many posts about creating Jackson serializers for numbers, currency, etc. For engineering applications, there is often a need to set the precision on

Compilation error: duplicate class with MapStruct in IntelliJ IDEA 2019.1

I am using Mapstruct for mapping between different Java Beans, but after installing the latest IntelliJ update, Compilation is getting failed with error: Comp

Here map SDK for android voice catalog speaking in miles or feet's instead of meters

Does here SDK for android and ios provide voice speaking in feet's or miles instead of meters? For example while navigation is running and the speaker says "I

How to implement hiding the toolbar when scrolling WebView?

I have an Activity with WebView and my own AppBarLayout. I want to implement hiding/showing the AppBarLayout with animation when scrolling the WebView, like in