java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment

The java.lang.IllegalAccessError with the message “class lombok.javac.apt.LombokProcessor cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment” occurs when the Lombok library cannot access the internal Java Compiler (javac) classes due to a change in the visibility of those classes in newer JDK versions. Starting from JDK 9, the Java Platform Module System (JPMS) was introduced, which enforces stronger encapsulation by … Read more

error: unable to extract uploader id; please report this issue on https://yt-dl.org/bug . make sure you are using the latest version; type youtube-dl -u to update. be sure to call youtube-dl with the –verbose flag and include its complete output.

Error: Unable to extract uploader ID Follow these steps to resolve the issue: Update youtube-dl to the latest version: Open your terminal or command prompt and run the following command: If the issue persists, enable the –verbose flag to get detailed output: Run the following command, replacing with the video URL you’re trying to download: … Read more

How to fix unsupported class file major version 60

The error “unsupported class file major version 60” occurs when you try to run a Java application that was compiled using a higher JDK (Java Development Kit) version than the JRE (Java Runtime Environment) version used to execute the application. In this case, the error indicates that the class file was compiled using JDK 16 … Read more

Java 8 Lambda Expressions Tips and Tricks

Java 8 introduced lambda expressions, which have become an essential feature for developers working with the language. Lambda expressions are a concise way of representing instances of functional interfaces, allowing you to write more readable and maintainable code. In this article, we will explore some tips and tricks for working with Java 8 lambda expressions, … Read more

Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport (MyWebServiceClient) on project com.myproject: Execution MyWebServiceClient of goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport failed: start 0, end -1, length 0 -> [Help 1]

We recently upgraded from Java 8 to openjdk16. And our webservice clients failed with below error. Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport (MyWebServiceClient) on project com.myproject: Execution MyWebServiceClient of goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport failed: start 0, end -1, length 0 -> [Help 1] And the fix was to change the plugin for ws-import. Before we had  <groupId>org.jvnet.jax-ws-commons</groupId><artifactId>jaxws-maven-plugin</artifactId><version>2.3</version> And … Read more

Caused by: org.hibernate.MappingException: The increment size of the [MY_SEQ] sequence is set to [50] in the entity mapping while the associated database sequence increment size is [1].

While upgrading from hibernate 3 to hibernate 5, this was one of the issues. Here is how id fields were defined in hibernate 3. @Id@GeneratedValue(strategy=GenerationType.AUTO, generator=”my_seq_gen”)@SequenceGenerator(name=”my_seq_gen”, sequenceName=”MY_SEQ”)private long id; So now, I added allocationSize = 1 to resolve the issue @Id@GeneratedValue(strategy=GenerationType.AUTO, generator=”my_seq_gen”)@SequenceGenerator(name=”my_seq_gen”, sequenceName=”MY_SEQ”, allocationSize = 1)private long id; And for new Ids I used the … Read more

Cannot create JDBC driver of class ‘com.mysql.jdbc.Driver’ for connect URL ‘jdbc:postgresql://localhost:5432/my_test’

This turned out to be a mistake in the config.  I was using mysql driver. It was a copy-paste mistake. <bean id=”dataSource” class=”org.apache.commons.dbcp2.BasicDataSource”destroy-method=”close”><property name=”driverClassName”><value>com.mysql.jdbc.Driver</value></property>   Here is the correct config: <bean id=”dataSource” class=”org.apache.commons.dbcp2.BasicDataSource”destroy-method=”close”><property name=”driverClassName”> <value>org.postgresql.Driver</value></property>   And the postgres entry in pom.xml : <dependency><groupId>org.postgresql</groupId><artifactId>postgresql</artifactId><version>42.2.23</version></dependency>

Exception encountered during context initialization – cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’ defined in class path resource [xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/validation/ValidatorFactory

Resolving Spring Context Initialization Error: NoClassDefFoundError for ValidatorFactory The root cause of this issue is a java.lang.NoClassDefFoundError for the javax/validation/ValidatorFactory class. This error usually occurs when there’s a missing dependency in your project. In this case, it’s likely that you’re missing the Java Validation API (JSR 303) dependency. To resolve this issue, you need to … Read more