Showing posts with label dependency. Show all posts
Showing posts with label dependency. Show all posts

Saturday, January 16, 2016

I was checking the actual Elasticsearch Java Api and while I created a NodeClient with the api I got lots of exceptions which is frustrating because I just did a clean install and there's nothing complicated in my pom.xml.
These are exceptions I got with the following of a huge stacktrace of course.
java.lang.ClassNotFoundException: groovy.lang.GroovyClassLoader
 at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_66]

java.lang.ClassNotFoundException: com.github.mustachejava.Mustache
 at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_66]
 

java.lang.ClassNotFoundException: org.apache.lucene.expressions.Expression
 at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_66]
 

java.lang.ClassNotFoundException: com.sun.jna.Native
 at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_66]
So I made maven generate a dependency tree, checked dependencies in elasticsearch client parent pom and added the necessary dependencies one by one by hand. Note that these are for Elasticsearch 2.1.1. For the version of your dependencies you should check org.elasticsearch.elasticsearch pom of your version of Elasticsearch.
  
 
            org.codehaus.groovy
            groovy-all
            2.4.4
        

        
            com.github.spullara.mustache.java
            compiler
            0.8.13
        

        
            org.apache.lucene
            lucene-expressions
            5.3.1
        

        
            net.java.dev.jna
            jna
            4.1.0
        

Friday, March 21, 2014

problem with displaying jsp on spring boot

I'm currently trying to learn Spring Boot (1.0.0 snapshot) in my spare time. I try to use spring-boot-starter-web for building a sample website but had problems when I try to use jsp for the view part of my mvc. Everything was in place.

  • I had a jsp named "welcome-page.jsp" under "src/main/webapp/WEB-INF/jsp/" 
  • In my controller I was sending the user to "welcome-page". 
  • The path configuration was done under application.properties with
    • spring.view.prefix: /WEB-INF/jsp/
    • spring.view.suffix: .jsp


And yet it was not working. Nothing on logs too, even on debug level.
After some search and several trial/errors, I saw that it is impossible to use embedded tomcat for displaying jsps without adding several dependencies to my main pom. Next to the standard spring-boot-starter-web dependency, I had to add jasper and jstl dependencies as well. So long for leaving dependencies to starter templates.


   
 
        
            org.springframework.boot
            spring-boot-starter-web
        
        
            org.apache.tomcat.embed
            tomcat-embed-jasper
            provided
        
        
            javax.servlet
            jstl