Things I learned Last Week Part 2 - No Fluff Just Stuff

Things I learned Last Week Part 2

Posted by: Eric Pugh on March 18, 2010

Favicon and Rails?

Want to use a favicon.ico but don’t want to put it at the root as favicon.ico? Then add <LINK REL=”SHORTCUT ICON” href=”<%=image_path(‘limelight.ico’)%>”>. The use of image_path means that you get all the goodness of Rails routing to generate a complete image path that will work. Even if you deploy under some sub URL, like a war file in JBoss!

Are you working with ISO-8859-1 encoded text, (more info at http://www.w3schools.com/tags/ref_entities.asp).

ISO 8859-1 Characters

And look at the character  (should be a capital A with a caret on top called a grave accent). That will kill Solr, regardless of container deployed in, like Jetty versus Tomcat. But the other ways of representing this entity work great:

&#192; &Agrave;

Of course, there is a bit of confusion on this, as supposedly if the XML document posted to Solr is UTF-8 encoded, then Solr shouldn’t have any issues. So, still some digging to do!

Solritas and JBoss and Velocity Oh My

I recently ran into a Java Classloader issue between JBoss and Solr when loading Velocity. If you are getting in the browser:

TTP Status 500 – loader constraint violation: when resolving method “org.apache.velocity.Template.merge

or messages like “SEVERE: java.lang.LinkageError: loader constraint violation: when resolving method “org.apache.velocity.Template.merge” in the logs, then that means a conflict in the velocity jars. Oddly enough, I could not actually find a velocity.jar anywhere in my JBoss app. However, the fix was to copy the velocity jar from Solr into my JBoss ./lib/ directory.

Eric Pugh

About Eric Pugh

Fascinated by the “craft” of software development, Eric Pugh has been heavily involved in the open source world as a developer, committer, and user for the past 5 years. He is an emeritus member of the Apache Software Foundation and lately has been mulling over how we move from the read/write web to the read/write/share web.

In biotech, financial services and defense IT, he has helped European and American companies develop coherent strategies for embracing open source software. As a speaker he has advocated the advantages of Agile practices in software development.

Eric became involved in Solr when he submitted the patch SOLR-284 for Parsing Rich Document types such as PDF and MS Office formats that became the single most popular patch as measured by votes! The patch was subsequently cleaned up and enhanced by three other individuals, demonstrating the power of the Free/Open Source Model to build great code collaboratively. SOLR-284 was eventually refactored into Solr Cell as part of Solr version 1.4.

Eric co-authored “Solr 1.4 Enterprise Search Server”, the first book on Solr.

He blogs at http://www.opensourceconnections.com/blog/.

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 8
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 4
  • Cloud
  • Automation Tools: Gradle, Git, Jenkins, Sonar
  • HTML5, CSS3, AngularJS, jQuery, Usability
  • Mobile Apps - iPhone and Android
  • More...
Learn More »