1 Reply Latest reply on Jul 5, 2010 8:52 AM by Marko Strukelj

    How GateIn Manage taglib?

    Julien Deruère Newbie

      Hello,

       

      I import every taglib I need and so on portlet.tld into my WEB-INF/tld folder.

       

      When I import a taglib in my init.jsp like this:

       

      <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
      <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
      <%@ taglib uri="http://java.sun.com/jstl/sql_rt" prefix="sql" %>
      <%@ taglib uri="http://java.sun.com/jstl/xml_rt" prefix="x" %>

      <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>

      <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
      <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>

       

      I have this :

       

      GRAVE: "Servlet.service()" pour la servlet jsp a lancé une exception org.apache.jasper.JasperException: /WEB-INF/jsp/patientregistration/view.jsp(1,1) /WEB-INF/jsp/patientregistration/init.jsp(1,1) Impossible de charger ou d'instancier la classe TagExtraInfo: org.apache.pluto.tags.DefineObjectsTag$TEI at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)


      I don't understand the problem.

       

      Regards,

        • 1. Re: How GateIn Manage taglib?
          Marko Strukelj Master

          First, the problem is with third party libraries that you ship with your app - most probably the problem is packaging, maybe some missing jars.

           

          The message tells it can't load class: org.apache.pluto.tags.DefineObjectsTag$TEI

           

          The reason for this is one of:

           

          1) This class is nowhere on your classpath (which means you need to find a .jar containing this class and include it into your .war)

          2) The class is in some .jar within your .war but depends on some other class which is nowhere on your classpath (which means you need to determine whic other class this class depend on and include that .jar in our .war as well)

          3) The class is in some .jar within your .war but is loaded via a classloader that doesn't see it (which means you have to move the .jar containing the class into another location - maybe JBOSS_HOME/server/default/deploy/gatein.ear/lib or JBOSS_HOME/server/default/lib - such a move can require other dependencies to be moved as well)

           

           

           

          A quick test to start figuring this out is to write a little .jsp that does <%Class.forName("org.apache.pluto.tags.DefineObjectsTag");%>

           

          As class won't be able to load you'll get a full stack trace with cause. If you don't see a full stack trace change this to:

           

          <%

          try

          {

             Class.forName("org.apache.pluto.tags.DefineObjectsTag");

          }

          catch(Exception ex)

          {

             ex.printStackTrace();

          }

          %>

           

          If in your stack trace you see NoClassDefFoundException with a different classname, then you're dealing with scenario (2).

           

          Otherwise you're dealing with scenario (1) or (3). Use filesystem search or IDE to determine what jar contains or should contain the required classes.

           

          If the problem turns out to be something else, or you manage to solve it another way, please let us know.