Thymeleaf content assist not working with Spring Tools - spring-boot

I installed Thymeleaf plugin 3.0.0 for sts 4.9.0
I used : xmlns:th="http://www.thymeleaf.org"
error log :
Caused by: java.lang.ClassNotFoundException: javax.activation.DataSource cannot be found by org.thymeleaf.extras.eclipse.core_3.0.0.202005310144
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:516)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 188 more

Probably worth checking the Thymeleaf Eclipse plugin repo for related issues. This one looks related: https://github.com/thymeleaf/thymeleaf-extras-eclipse-plugin/issues/100

Related

Spring-Boot-Admin application not starting because of error creating bean with name adminHandlerMapping

I am following this blog to try out a Spring-Boot-Admin application. And when I run the app it fails with the below error:
Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'adminHandlerMapping' defined in class path resource [de/codecentric/boot/admin/server/config/AdminServerWebConfiguration$ServletRestApiConfirguation.class]:
Invocation of init method failed; nested exception is java.lang.StackOverflowError
I look further below and find these below lines:
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_231]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.2.1.RELEASE.jar:2.2.1.RELEASE]
Caused by: java.lang.StackOverflowError: null
at de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping.withPrefix(AdminControllerHandlerMapping.java:48) ~[spring-boot-admin-server-2.1.0.jar:2.1.0]
at de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping.registerHandlerMethod(AdminControllerHandlerMapping.java:44) ~[spring-boot-admin-server-2.1.0.jar:2.1.0]
Not sure if there is some circular dependency in the jars. Any idea please?
The comment by #the hand of NOD made me relook into my pom.xml file and the pom.xml file provided in the blog
The problem lies in the version number of the spring-boot-starter-parent. The tutorial uses a version 2.1.0.RELEASE whereas the latest one when you prepare a project from Spring Intializr is 2.2.1.RELEASE
I downgraded to 2.1.0.RELEASE and it worked! With 2.2.1.RELEASE there is some dependency that is going cyclic with spring-boot-admin-starter-server
P.S. It seems that the codecentric team is already working upon it and would release the 2.2.0 compliant version by 22 Nov 2019 (https://github.com/codecentric/spring-boot-admin/milestones)
It works for me upgrade spring-boot-admin-starter-admin to 2.2.4 and using
spring-boot-starter-parent 2.2.8.RELEASE, spring-boot-admin-starter-client 2.1.6 on service's pom

Spring Boot 1.4 to 1.5, unable to deploy

I have a very large and working Spring Boot project that is running OK with Boot 1.4.2. When I try to upgrade to 1.5.3 it works from my IDE (Intellij Idea) but it does not work on deployment. It's a Maven project, so I use the "package" directive to generate a WAR file and I get the error bellow on deployment. From what I can see, it says something is missing on the WAR but I even inspected it and the files are there... Any ideas?
Caused by: java.io.FileNotFoundException: file:(...)/target/ultraip-intranet-2.0-RELEASE.war*/WEB-INF/classes/com/ultraip/intranet/entities (No such file or directory)
at java.util.zip.ZipFile.open(Native Method) ~[na:1.8.0_131]
at java.util.zip.ZipFile.<init>(ZipFile.java:219) ~[na:1.8.0_131]
at java.util.zip.ZipFile.<init>(ZipFile.java:149) ~[na:1.8.0_131]
at java.util.jar.JarFile.<init>(JarFile.java:166) ~[na:1.8.0_131]
at java.util.jar.JarFile.<init>(JarFile.java:103) ~[na:1.8.0_131]
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingJarResources(PathMatchingResourcePatternResolver.java:593) ~[spring-core-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:475) ~[spring-core-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:279) ~[spring-core-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.buildDefaultPersistenceUnitInfo(DefaultPersistenceUnitManager.java:525) ~[spring-orm-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
... 105 common frames omitted
Screenshot of the generated WAR file
http://imgur.com/a/5aORQ
A change was made in Tomcat such that it now uses a * as the separator in war:file: URLs. This broke Spring Framework's resource resolution where the * was incorrectly interpreted as a wildcard.
The problem should have been been fixed in Spring Framework 4.3.8 which is used in Spring Boot 1.5.3 but it appears that you have found a case that wasn't considered. Can you please open a Spring Boot issue with a small sample that reproduces the problem?
You don't see the problem when you package your application as a jar file as that stops Tomcat from producing war:file: URLs for resources.

Wildfly 8.2 not recognising spring module

I am getting exception
Caused by: org.jboss.modules.ModuleNotFoundException: org.springframework.sp
ring:main"}}}}
I defined spring modules as per the link
http://www.javacodegeeks.com/2013/11/add-apache-camel-and-spring-as-jboss-modules-in-wildfly.html
but no use.
This issue is because typo in filename it is not modules.xml it should be module.xml

Error after Spring Security update form 3.1 to 3.2.1

I have update my spring security from 3.1 to 3.2.1 in maven/pom.xml. And I am using spring "3.1.0" version After updating i am getting the following error:
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.request.async.CallableProcessingInterceptor
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 54 more
This error was resolved in latest spring security version 3.2.2. If you want to resolve this error by using the same version then add maven dependencies for "spring-web".
Please refer " https://jira.spring.io/browse/SPR-10218 " for further details. This is where i found the solution

org/springframework/core/AliasRegistry not found

I have developed demo application using spring struct and hibernate and getting following error while running it.
java.lang.NoClassDefFoundError: org/springframework/core/AliasRegistry
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.getDeclaredConstructor(Class.java:1985)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:78)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:239)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
through google i came to know that problem might be because of some version conflict of spring library
So following is the jar list, i added in my application.
commons-digester-2.0.jar
commons-beanutils-1.7.0.jar
commons-chain-1.2.jar
commons-collections-3.1.jar
spring-core-2.5.jar
javassist.jar
spring-jdbc-2.5.jar
spring-beans-2.5.6.jar
spring-context-2.5.jar
commons-logging-1.1.1.jar
hibernate3.jar
oro-2.0.8.jar
struts2-core-2.3.1.2.jar
hibernate-jpa-2.0-api-1.0.0.Final.jar
mysql-connector-java-5.1.13-bin.jar
antlr-2.7.2.jar
struts-tiles-1.3.10.jar
struts-taglib-1.3.10.jar
struts-extras-1.3.10.jar
com.springsource.org.dom4j-1.6.1.jar
commons-validator-1.3.1.jar
xwork-core-2.3.1.2.jar
commons-io-2.0.1.jar
hibernate-commons-annotations-3.2.0.Final.jar
spring-context-support-2.5.jar
spring-orm-2.5.jar
spring-tx-2.5.6.jar
spring-web-2.5.jar
spring-webmvc-struts-2.5.jar
Try to use same version for all Spring dependencies. Now you are using 2.5 and 2.5.6.
The jar file that own AliasRegistry is from spring-core-2.5.jar and from your libraries output, it seem you have that. I have once with mixed version 3 and version 2.5 of spring causing issue. But the exceptions are gone once the correct version are in place.
I have struts1.3 and hibernate, I will comment based on our difference and to see if this give you any help. But with my libraries placed in lib, hibernate works fine though. So here goes,
Get the same version for this.
commons-digester-2.0.jar
commons-beanutils-1.7.0.jar
which version of javassist.jar do you have? I have javassist-3.12.0.GA.jar
spring-beans-2.5.6.jar, try get exact version of spring-beans-2.5.jar
which exact version of hibernate3.jar do you have? I'm using hibernate-core-3.6.4.Final.jar
These are libraries for struts1, are you using these together with struts2?
struts-tiles-1.3.10.jar
struts-taglib-1.3.10.jar
struts-extras-1.3.10.jar
commons-validator-1.3.1.jar
these seem like packages from struts2 which is the one you are using, yes?
struts2-core-2.3.1.2.jar
xwork-core-2.3.1.2.jar
try to get the exact version of spring-tx, that is spring-tx-2.5.jar which is the same with the rest of spring jars.

Resources