Should I use @EJB or @Inject

The @EJB is used to inject EJB’s only and is available for quite some time now. @Inject can inject any managed bean and is a part of the new CDI specification (since Java EE 6). In simple cases you can simply change @EJB to @Inject. In more advanced cases (e.g. when you heavily depend on … Read more

What exactly is Java EE?

(Updated Feb 2022) First of all, “Java EE” has since Sep 2019 been renamed to “Jakarta EE“, starting with version 8. Historically, there was also the term “J2EE” which covered versions 1.2 until 1.4. The term “Java EE” covered versions 5 until 8. See also Jakarta EE, History on Wikipedia. Is Jakarta EE just a … Read more

How to define servlet filter order of execution using annotations in WAR

You can indeed not define the filter execution order using @WebFilter annotation. However, to minimize the web.xml usage, it’s sufficient to annotate all filters with just a filterName so that you don’t need the <filter> definition, but just a <filter-mapping> definition in the desired order. For example, @WebFilter(filterName=”filter1″) public class Filter1 implements Filter {} @WebFilter(filterName=”filter2″) … Read more

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved

I had the exact same problem. [ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Failure to find org.apache.maven.plugins:maven-resources-plugin:pom:2.5 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> … Read more

What is the difference between Spring, Struts, Hibernate, JavaServer Faces, Tapestry?

Spring is an IoC container (at least the core of Spring) and is used to wire things using dependency injection. Spring provides additional services like transaction management and seamless integration of various other technologies. Struts is an action-based presentation framework (but don’t use it for a new development). Struts 2 is an action-based presentation framework, … Read more

Intellij IDEA Java classes not auto compiling on save

UPDATED For IntelliJ IDEA 12+ releases we can build automatically the edited sources if we are using the external compiler option. The only thing needed is to check the option “Build project automatically“, located under “Compiler” settings: Also, if you would like to hot deploy, while the application is running or if you are using … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)