Can not find the tag library descriptor for "http://tiles.apache.org/tags-tiles" - spring

I am creating an application using Tiles, Spring and Hibernate.
When when running, it is showing following error:
Can not find the tag library descriptor for "http://tiles.apache.org/tags-tiles"
All the jars are included and mapping is also seeing fine. Where I am going wrong?

The url looks ok.
Your problem sounds a bit like you are missing some tiles jars. Make sure that a jar containing tiles-jsp.tld is added to your projects web libs folder.
One jar that contains this file is for example: tiles-jsp-2.2.1.jar.

In pom.xml file appended below artifacts and compiled well this time.
<!-- Tiles -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-api</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-servlet</artifactId>
<version>2.1.2</version>
</dependency>

I copied the whole file with the taglib declaration from somewhere else and got the same compilation error. I deleted the file, created a new one and pasted the same contents. Sounds weird but worked! Hope it helps someone. :)

I had this problem even after having tiles-jsp.2.0.6.jar. So i found the solution by removing the jar manually from the maven dependencies and adding it as an external jar.. It worked, you may also try so..

Adding the tiles dependency in pom.xml of Spring project will help-
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>3.0.7</version>
</dependency>

Related

Spring Boot No Class found error though starter dependency has added classes in classpath

Despite having appropriate jars in classpath Spring Boot throws - java.lang.ClassNotFoundException: org.apache.camel.spring.spi.XmlCamelContextConfigurer
Any suggestions what is missing here.
I have added the respective starters in pom.xml as shown below:
<dependency>
<groupId>org.springframework.boot</groupId>[![enter image description here][1]][1]
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>2.19.3</version>
</dependency>
The project maven dependencies also shows the class availability, as in given image attachment.
the answer is here - https://stackoverflow.com/a/34271507/2885422 It all depends how maven loads the class. There are 2 version of camel-spring.jars available in classpath (2.20.1 and 2.19.3. Ref: my original post image)
And org.apache.camel.spring.spi.XmlCamelContextConfigurer class is available only in 2.20.1 jars. And maven by default looks in earlier one and once package found matching but no class found throws error (?)
And the reason I believe 2.19.3 get loaded is Apache-cxf jars is of 2.19.3. Unfortunately our project repository does not have apache-cxf starter jars.
https://stackoverflow.com/a/34271507/2885422
Solution: - I hope it may be helpful for future references
By adding options I could resolve the issue,by having exclusion clause added as given below. Thus I could load only required version jars.
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>2.19.3</version>
<exclusions>
<exclusion>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</exclusion>
</exclusions>
</dependency>'

Find all dependencies that include a given package

I excluded an artifact because it causes conflicts, namely the jsr311-api given below. Yet when I run the generated jar I'm still getting the java.lang.NoSuchMethodError error. I suspect that another dependency is also including this artifact. How can I find out which one? My dependency list is quite large. Which dependencies include the package javax.ws.rs.core?
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-kernel</artifactId>
<version>1.7.3</version>
<exclusions>
<!-- Causes java.lang.NoSuchMethodError: javax.ws.rs.core.Response$Status$Family.familyOf(I)Ljavax/ws/rs/core/Response$Status$Family; -->
<exclusion>
<artifactId>jsr311-api</artifactId>
<groupId>javax.ws.rs</groupId>
</exclusion>
</exclusions>
</dependency>
Go to
http://search.maven.org/#advancedsearch%7Cgav
and use classname search to find
javax.ws.rs.core.Response
If you use a Nexus 2.x in your company, you can use classname search there as well.
If you want to find out where a given artifact (that you e.g. found by classnmae search) comes from, use dependency:tree in Maven.
In my case the mistake was that I had to manually add the javaee api and I set <scope>provided</scope> which was a mistake, fixing this solved the problem.
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope><!-- remove this -->
</dependency>

Maven Guava Dependency "Cannot resolve symbol 'google'" in IntelliJ IDEA

IntelliJ says Cannot resolve symbol 'google'. about this import:
import com.google.common.cache.LoadingCache;
Even though I have added the dependency correctly and it doesn't complain about it:
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>
I have updated my Maven repository. I have Maven auto-import enabled in IntelliJ IDEA. My project is using SDK version 1.8. Based on numerous examples on the web, this should work, but it doesn't.
I found this about a similar (although not the same issue, as my code doesn't compile). I tried invalidating the cache and restarting, but it didn't help. The top answer also suggests deleting the IDEA system directory. I don't know if this is a good idea and how much stuff breaks if I do that.
I had the same problem and was trying all solutions to import Guava cache manager.
But the mistake I made was, did not add dependencies properly. Please do check pom.xml before trying any solution.
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>25.0-jre</version>
</dependency>
<!-- these are the dependencies i missed -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.3.10.RELEASE</version>
</dependency>`
If anyone else has a similar issue, reading through pom.xml may be helpful. Turns out I had <properties> defined twice. For some reason it was not causing problems before adding the Guava dependency. After removing the duplicate definition, everything started working again.

Maven Webjars - bootstrap-datepicker makes bootstrap invisible

I've tried to use Bootstrap and Bootstrap-Datepicker in my SpringMVC project:
GitHub repo
I trying to include both Bootstrap and Bootstrap-Datepicker via WebJars like this:
<!-- WebJars -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap-datepicker</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>1.10.2</version>
</dependency>
When I comment out the bootstrap-datepicker dependency in pom.xml, the browser is throwing errors in the console like this:
GET http://localhost:8080/finager/webjars/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.js 404 (Not Found)
This is working as expected. When I leave boostrap-datepicker section uncommented, the browser starts to see bootstrap-datepicker files, also as expected. Unfortunately, the browser console starts to throw similar errors saying that now Bootstrap files are not visible! It seems that boostrap-datepicker is somehow overriding Bootstrap.
I've tried to change my includes order and still the same effect. All of my .jsp files (CSS and JS includes) seem to be valid, because Bootstrap is visible when Maven does not try to include the datepicker. Is there a simple way to check what is visible in my webjars folder after compilation?
I am very confused. I couldn't find any useful information on the Internet. I've spent whole day on this, so any help would be hugely appreciated. Thanks in advance!
As always, the solution came up to my mind right after posting the question. It seems that Maven detected that bootstrap-datepicker was depending on bootstrap. I suppose that it included Bootstrap in different version in result - that would explain everything.
However, this is the solution:
<!-- WebJars -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap-datepicker</artifactId>
<version>1.3.0</version>
<exclusions>
<exclusion>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.1.0</version>
</dependency>
Is anybody aware of simple solution to browse /webjars directory structure after the Maven compilation? This would prevent such issues.

Maybe bad jasper report dependency in pom.xml

I'm developing my first application with vaadin and spring. I'm using also maven for dependency management. Now i have this trouble, when i try to add a the followed jasper report dependency
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.2.0</version>
</dependency>
I get the following error
The container 'Maven Dependencies' references non existing library 'C:\Users\Alex.m2\repository\bouncycastle\bcprov-jdk14\138\bcprov-jdk14-138.jar'
then i also try to add this dependency:
<dependency>
<groupId>bouncycastle</groupId>
<artifactId>bcmail-jdk14</artifactId>
<version>138</version>
</dependency>
but doesn't work.
Where i wrong?

Resources