You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Juan Carlos Méndez <ju...@gkudos.com> on 2010/08/11 21:55:11 UTC

Jetty error: JSP support not configured

I'm trying to run jetty using TestServer but the following error is thrown:
"JSP support not configured"

Any ideas?

This is my config:

JETTY = [
  'org.mortbay.jetty:jetty:jar:6.1.25',
  'org.mortbay.jetty:jetty-util:jar:6.1.25',
  'org.mortbay.jetty:jsp-2.1-jetty:jar:6.1.25',
  transitive('org.mortbay.jetty:maven-jetty-plugin:jar:6.1.25'),
  'org.mortbay.jetty:maven-jetty-jspc-plugin:jar:6.1.25',
  'sun-servlet:jsp-api:jar:2.4',
  'javax.servlet:jsp-api:jar:2.0',
  'org.apache.ant:ant:jar:1.8.1',
  'xerces:xercesImpl:jar:2.9.1',
]



task :run => :compile do
        Java::Commands.java('JettyTestServer',:classpath
=>compile.dependencies +
[compile.target.to_s]+package(:war).libs+artifacts(JETTY))
    end


********
import org.mortbay.jetty.Server;
import org.mortbay.jetty.webapp.WebAppContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author
 *
 */
class JettyTestServer {

    private static final Logger log =
LoggerFactory.getLogger(JettyTestServer.class);

    /**
     *
     * @param args
     */
    public static void main(String[] args){

        try {
            Server server = new Server(9080);
            WebAppContext webAppContext =   new
WebAppContext("src/main/webapp", "/mywebapp");

            String[] configClasses =
{"org.mortbay.jetty.webapp.WebInfConfiguration",
                    "org.mortbay.jetty.webapp.WebXmlConfiguration"};
            webAppContext.setConfigurationClasses(configClasses);
            server.addHandler(webAppContext);
            server.start();
            server.join();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }

    }
}
*********


Juan Carlos

Re: Jetty error: JSP support not configured

Posted by Peter Schröder <pe...@blau.de>.
did you read the FAQ?

http://wiki.eclipse.org/Jetty/FAQ#JSP_support_not_configured.3F


Am 11.08.2010 um 21:55 schrieb Juan Carlos Méndez:

I'm trying to run jetty using TestServer but the following error is thrown:
"JSP support not configured"

Any ideas?

This is my config:

JETTY = [
 'org.mortbay.jetty:jetty:jar:6.1.25',
 'org.mortbay.jetty:jetty-util:jar:6.1.25',
 'org.mortbay.jetty:jsp-2.1-jetty:jar:6.1.25',
 transitive('org.mortbay.jetty:maven-jetty-plugin:jar:6.1.25'),
 'org.mortbay.jetty:maven-jetty-jspc-plugin:jar:6.1.25',
 'sun-servlet:jsp-api:jar:2.4',
 'javax.servlet:jsp-api:jar:2.0',
 'org.apache.ant:ant:jar:1.8.1',
 'xerces:xercesImpl:jar:2.9.1',
]



task :run => :compile do
       Java::Commands.java('JettyTestServer',:classpath
=>compile.dependencies +
[compile.target.to_s]+package(:war).libs+artifacts(JETTY))
   end


********
import org.mortbay.jetty.Server;
import org.mortbay.jetty.webapp.WebAppContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
*
* @author
*
*/
class JettyTestServer {

   private static final Logger log =
LoggerFactory.getLogger(JettyTestServer.class);

   /**
    *
    * @param args
    */
   public static void main(String[] args){

       try {
           Server server = new Server(9080);
           WebAppContext webAppContext =   new
WebAppContext("src/main/webapp", "/mywebapp");

           String[] configClasses =
{"org.mortbay.jetty.webapp.WebInfConfiguration",
                   "org.mortbay.jetty.webapp.WebXmlConfiguration"};
           webAppContext.setConfigurationClasses(configClasses);
           server.addHandler(webAppContext);
           server.start();
           server.join();
       } catch (Exception e) {
           log.error(e.getMessage(), e);
       }

   }
}
*********


Juan Carlos


Re: Jetty error: JSP support not configured

Posted by Juan Carlos Méndez <ju...@gkudos.com>.
It worked with your addon..
thanks for your help...

a couple of comments:

1.   jetty.deploy("http://localhost:9080", task.prerequisites.first)

it doesn't change the port to 9080   (I can't use 8080, it is the default in
the addon)

i had to change the file
/usr/lib/ruby/gems/1.8/gems/buildr-1.4.1/addon/buildr/jetty.rb at line 59 to
use 9080


2. I had to use http://localhost:9080/index.xhtml instead of
http://localhost:9080/index.jsp to make it work.


thanks for your help  ;)

Juan Carlos


On Thu, Aug 12, 2010 at 7:18 AM, Antoine Toulme <an...@lunar-ocean.com>wrote:

> Juan, I work with Jetty, and I heard bad things about JSPs. It seems there
> are multiple implementations of the standard.
> I see your dependencies contain twice a JSP api jar. I would probably
> contact the Jetty project to get the right jar to use (I know Jetty 7 use
> javax.jsp 2.1 from glassfish).
>
> I am wondering if you could use our own jetty addon ?
> http://github.com/apache/buildr/blob/trunk/addon/buildr/jetty.rb
>
> Thanks,
>
> Antoine
> <http://github.com/apache/buildr/blob/trunk/addon/buildr/jetty.rb>
>
> 2010/8/11 Juan Carlos Méndez <ju...@gkudos.com>
>
> > I'm trying to run jetty using TestServer but the following error is
> thrown:
> > "JSP support not configured"
> >
> > Any ideas?
> >
> > This is my config:
> >
> > JETTY = [
> >  'org.mortbay.jetty:jetty:jar:6.1.25',
> >  'org.mortbay.jetty:jetty-util:jar:6.1.25',
> >  'org.mortbay.jetty:jsp-2.1-jetty:jar:6.1.25',
> >  transitive('org.mortbay.jetty:maven-jetty-plugin:jar:6.1.25'),
> >  'org.mortbay.jetty:maven-jetty-jspc-plugin:jar:6.1.25',
> >  'sun-servlet:jsp-api:jar:2.4',
> >  'javax.servlet:jsp-api:jar:2.0',
> >  'org.apache.ant:ant:jar:1.8.1',
> >  'xerces:xercesImpl:jar:2.9.1',
> > ]
> >
> >
> >
> > task :run => :compile do
> >        Java::Commands.java('JettyTestServer',:classpath
> > =>compile.dependencies +
> > [compile.target.to_s]+package(:war).libs+artifacts(JETTY))
> >    end
> >
> >
> > ********
> > import org.mortbay.jetty.Server;
> > import org.mortbay.jetty.webapp.WebAppContext;
> > import org.slf4j.Logger;
> > import org.slf4j.LoggerFactory;
> >
> > /**
> >  *
> >  * @author
> >  *
> >  */
> > class JettyTestServer {
> >
> >    private static final Logger log =
> > LoggerFactory.getLogger(JettyTestServer.class);
> >
> >    /**
> >     *
> >     * @param args
> >     */
> >    public static void main(String[] args){
> >
> >        try {
> >            Server server = new Server(9080);
> >            WebAppContext webAppContext =   new
> > WebAppContext("src/main/webapp", "/mywebapp");
> >
> >            String[] configClasses =
> > {"org.mortbay.jetty.webapp.WebInfConfiguration",
> >                    "org.mortbay.jetty.webapp.WebXmlConfiguration"};
> >            webAppContext.setConfigurationClasses(configClasses);
> >            server.addHandler(webAppContext);
> >            server.start();
> >            server.join();
> >        } catch (Exception e) {
> >            log.error(e.getMessage(), e);
> >        }
> >
> >    }
> > }
> > *********
> >
> >
> > Juan Carlos
> >
>

Re: Jetty error: JSP support not configured

Posted by Rhett Sutphin <rh...@detailedbalance.net>.
Hi Juan,

On Aug 12, 2010, at 7:18 AM, Antoine Toulme wrote:

> Juan, I work with Jetty, and I heard bad things about JSPs. It seems there
> are multiple implementations of the standard.
> I see your dependencies contain twice a JSP api jar. I would probably
> contact the Jetty project to get the right jar to use (I know Jetty 7 use
> javax.jsp 2.1 from glassfish).
> 
> I am wondering if you could use our own jetty addon ?
> http://github.com/apache/buildr/blob/trunk/addon/buildr/jetty.rb

I use Buildr's Jetty extension with JSPs and it works okay.  (If I were starting a new project today, I wouldn't use JSP, but that's a separate issue.)  

This is how I enable JSP support:

Java.classpath.concat([
  "org.mortbay.jetty:jsp-api-2.1:jar:#{Buildr::Jetty::VERSION}",
  "org.mortbay.jetty:jsp-2.1:jar:#{Buildr::Jetty::VERSION}"
])

Buildr::Jetty::VERSION is 6.1.3 in buildr 1.4.1.

I agree with Antoine that the duplicate JSP libs are probably a problem.  I think it may also be that the classpath is already committed before you invoke Java::Commands.java, though I've never used java with :classpath so I'm not sure how buildr handles it.

Rhett


> 
> Thanks,
> 
> Antoine
> <http://github.com/apache/buildr/blob/trunk/addon/buildr/jetty.rb>
> 
> 2010/8/11 Juan Carlos Méndez <ju...@gkudos.com>
> 
>> I'm trying to run jetty using TestServer but the following error is thrown:
>> "JSP support not configured"
>> 
>> Any ideas?
>> 
>> This is my config:
>> 
>> JETTY = [
>> 'org.mortbay.jetty:jetty:jar:6.1.25',
>> 'org.mortbay.jetty:jetty-util:jar:6.1.25',
>> 'org.mortbay.jetty:jsp-2.1-jetty:jar:6.1.25',
>> transitive('org.mortbay.jetty:maven-jetty-plugin:jar:6.1.25'),
>> 'org.mortbay.jetty:maven-jetty-jspc-plugin:jar:6.1.25',
>> 'sun-servlet:jsp-api:jar:2.4',
>> 'javax.servlet:jsp-api:jar:2.0',
>> 'org.apache.ant:ant:jar:1.8.1',
>> 'xerces:xercesImpl:jar:2.9.1',
>> ]
>> 
>> 
>> 
>> task :run => :compile do
>>       Java::Commands.java('JettyTestServer',:classpath
>> =>compile.dependencies +
>> [compile.target.to_s]+package(:war).libs+artifacts(JETTY))
>>   end
>> 
>> 
>> ********
>> import org.mortbay.jetty.Server;
>> import org.mortbay.jetty.webapp.WebAppContext;
>> import org.slf4j.Logger;
>> import org.slf4j.LoggerFactory;
>> 
>> /**
>> *
>> * @author
>> *
>> */
>> class JettyTestServer {
>> 
>>   private static final Logger log =
>> LoggerFactory.getLogger(JettyTestServer.class);
>> 
>>   /**
>>    *
>>    * @param args
>>    */
>>   public static void main(String[] args){
>> 
>>       try {
>>           Server server = new Server(9080);
>>           WebAppContext webAppContext =   new
>> WebAppContext("src/main/webapp", "/mywebapp");
>> 
>>           String[] configClasses =
>> {"org.mortbay.jetty.webapp.WebInfConfiguration",
>>                   "org.mortbay.jetty.webapp.WebXmlConfiguration"};
>>           webAppContext.setConfigurationClasses(configClasses);
>>           server.addHandler(webAppContext);
>>           server.start();
>>           server.join();
>>       } catch (Exception e) {
>>           log.error(e.getMessage(), e);
>>       }
>> 
>>   }
>> }
>> *********
>> 
>> 
>> Juan Carlos
>> 


Re: Jetty error: JSP support not configured

Posted by Antoine Toulme <an...@lunar-ocean.com>.
Juan, I work with Jetty, and I heard bad things about JSPs. It seems there
are multiple implementations of the standard.
I see your dependencies contain twice a JSP api jar. I would probably
contact the Jetty project to get the right jar to use (I know Jetty 7 use
javax.jsp 2.1 from glassfish).

I am wondering if you could use our own jetty addon ?
http://github.com/apache/buildr/blob/trunk/addon/buildr/jetty.rb

Thanks,

Antoine
<http://github.com/apache/buildr/blob/trunk/addon/buildr/jetty.rb>

2010/8/11 Juan Carlos Méndez <ju...@gkudos.com>

> I'm trying to run jetty using TestServer but the following error is thrown:
> "JSP support not configured"
>
> Any ideas?
>
> This is my config:
>
> JETTY = [
>  'org.mortbay.jetty:jetty:jar:6.1.25',
>  'org.mortbay.jetty:jetty-util:jar:6.1.25',
>  'org.mortbay.jetty:jsp-2.1-jetty:jar:6.1.25',
>  transitive('org.mortbay.jetty:maven-jetty-plugin:jar:6.1.25'),
>  'org.mortbay.jetty:maven-jetty-jspc-plugin:jar:6.1.25',
>  'sun-servlet:jsp-api:jar:2.4',
>  'javax.servlet:jsp-api:jar:2.0',
>  'org.apache.ant:ant:jar:1.8.1',
>  'xerces:xercesImpl:jar:2.9.1',
> ]
>
>
>
> task :run => :compile do
>        Java::Commands.java('JettyTestServer',:classpath
> =>compile.dependencies +
> [compile.target.to_s]+package(:war).libs+artifacts(JETTY))
>    end
>
>
> ********
> import org.mortbay.jetty.Server;
> import org.mortbay.jetty.webapp.WebAppContext;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
>
> /**
>  *
>  * @author
>  *
>  */
> class JettyTestServer {
>
>    private static final Logger log =
> LoggerFactory.getLogger(JettyTestServer.class);
>
>    /**
>     *
>     * @param args
>     */
>    public static void main(String[] args){
>
>        try {
>            Server server = new Server(9080);
>            WebAppContext webAppContext =   new
> WebAppContext("src/main/webapp", "/mywebapp");
>
>            String[] configClasses =
> {"org.mortbay.jetty.webapp.WebInfConfiguration",
>                    "org.mortbay.jetty.webapp.WebXmlConfiguration"};
>            webAppContext.setConfigurationClasses(configClasses);
>            server.addHandler(webAppContext);
>            server.start();
>            server.join();
>        } catch (Exception e) {
>            log.error(e.getMessage(), e);
>        }
>
>    }
> }
> *********
>
>
> Juan Carlos
>