Problem with Groovlets on Windows Tomcat

View: New views
12 Messages — Rating Filter:   Alert me  

Problem with Groovlets on Windows Tomcat

by grkuntzmd :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Has anyone actually gotten Groovlets to work on Tomcat on Windows Vista?

I am running Tomcat 6.0.18 on Vista with Java 6_07. I installed tomcat using both the service installer and from the zip file. In both cases, I installed a groovlet sample in the webapps directory with the three required jar files (groovy, antlr, asm) in the WEB-INF/lib directory. I keep getting the error that the class javax.servlet.http.HttpServlet cannot be found. I can run regular servlets and JSP files (written in Java). I also tried moving those libraries to the $CATALINA_HOME/lib directory and got the same error.

I have succeeded with Glassfish though.

Any ideas? Anyone have this working? How?

Thanks.
G. Ralph Kuntz, MD

Re: Problem with Groovlets on Windows Tomcat

by Stand Trooper :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have the latest tomcat release running on windows vista with Groovlets.

This is with the service installer from scratch. (http://groovy.codehaus.org/Groovlets)

To simplify this for the easiest test for your case, I went into webapps/root and changed only the web.xml to reflect the Groovlet necessities.  I copied the jar files from groovy/lib to WEB-INF/lib and made an index.groovy from the Groovlet example page.

I'm running jdk 6.05

Everything runs without any issues at all.

what does the sample groovlet code you're running look like?

timo

On Thu, Aug 21, 2008 at 2:13 PM, grkuntzmd <grk@...> wrote:

Has anyone actually gotten Groovlets to work on Tomcat on Windows Vista?

I am running Tomcat 6.0.18 on Vista with Java 6_07. I installed tomcat using
both the service installer and from the zip file. In both cases, I installed
a groovlet sample in the webapps directory with the three required jar files
(groovy, antlr, asm) in the WEB-INF/lib directory. I keep getting the error
that the class javax.servlet.http.HttpServlet cannot be found. I can run
regular servlets and JSP files (written in Java). I also tried moving those
libraries to the $CATALINA_HOME/lib directory and got the same error.

I have succeeded with Glassfish though.

Any ideas? Anyone have this working? How?

Thanks.

-----
G. Ralph Kuntz, MD
Chief Software Architect
meridianEMR, Inc.
--
View this message in context: http://www.nabble.com/Problem-with-Groovlets-on-Windows-Tomcat-tp19095055p19095055.html
Sent from the groovy - user mailing list archive at Nabble.com.

Re: Problem with Groovlets on Windows Tomcat

by grkuntzmd :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Still getting the same error.

I copy/pasted the first example from http://groovy.codehaus.org/Groovlets into ROOT/index.groovy. I added the web.xml lines to ROOT/WEB-INF/web.xml. I created the directory ROOT/WEB-INF/lib and copied the jar files from C:\Groovy\lib to it (groovy, antlr, and asm).

I did NOT make the context change to server.xml. I wonder if that is the problem. The ROOT webapp is implicitly defined I believe.

Here is part of the error I get:

java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
G. Ralph Kuntz, MD

Re: Problem with Groovlets on Windows Tomcat

by Stand Trooper :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I didn't not make the context change either... Root webapp is implicitly defined.

that is strange... the only thing different would be that I copied all of the jars from the groovy/lib directory to the web-inf/lib and the difference in jvms... but that shouldn't affect the HttpServlet in any way, especially if you're having no issues running jsps...

can you put a plain jsp into the webapp/ROOT directory and run it just fine?

timo

On Thu, Aug 21, 2008 at 3:32 PM, grkuntzmd <grk@...> wrote:

Still getting the same error.

I copy/pasted the first example from http://groovy.codehaus.org/Groovlets
into ROOT/index.groovy. I added the web.xml lines to ROOT/WEB-INF/web.xml. I
created the directory ROOT/WEB-INF/lib and copied the jar files from
C:\Groovy\lib to it (groovy, antlr, and asm).

I did NOT make the context change to server.xml. I wonder if that is the
problem. The ROOT webapp is implicitly defined I believe.

Here is part of the error I get:

java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet


-----
G. Ralph Kuntz, MD
Chief Software Architect
meridianEMR, Inc.
--
View this message in context: http://www.nabble.com/Problem-with-Groovlets-on-Windows-Tomcat-tp19095055p19096304.html
Sent from the groovy - user mailing list archive at Nabble.com.


Re: Problem with Groovlets on Windows Tomcat

by grkuntzmd :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I put a simple test.jsp into the ROOT directory containing only html, body, h1, HELLO and got a great big "HELLO" in the browser.

I also copied everything from C:\Groovy\lib to the WEB-INF/lib directory.

Still the same error.

I also added an environment variable "CATALINA_HOME" and restarted the service. No change.
G. Ralph Kuntz, MD

Re: Problem with Groovlets on Windows Tomcat

by Alexander Veit-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> From: grkuntzmd wrote:
> [...]
> Any ideas?

What Groovy version are you trying to run.

-Alex


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Problem with Groovlets on Windows Tomcat

by grkuntzmd :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

1.5.6
G. Ralph Kuntz, MD

RE: Problem with Groovlets on Windows Tomcat

by Alexander Veit-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> grkuntzmd wrote:
> 1.5.6

Does your sample code try to load or instantiate the
javax.servlet.http.HttpServlet class?

To cite the Tomcat 6 docs: "Last, any JAR containing servlet API classes
will be ignored by the [WebappX] classloader."

So this could be part of the problem.


-Alex



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Problem with Groovlets on Windows Tomcat

by Alexander Veit-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> grkuntzmd wrote:
> Anyone have this working? How?

Just tested with WinXP Pro SP3, Groovy 1.5.6, Sun JDK 1.6.0_07, Tomcat
6.0.14, antlr-2.7.6.jar, asm-2.2.jar, and groovy-1.5.6.jar. First Example
from http://groovy.codehaus.org/Groovlets.

It works for me.

-Alex


This is the web.xml I used:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
   version="2.5">

    <description>
      Groovlet Examples.
    </description>
    <display-name>Groovlet Examples</display-name>


        <servlet>
                <servlet-name>Groovy</servlet-name>
                <servlet-class>groovy.servlet.GroovyServlet</servlet-class>
        </servlet>

        <servlet-mapping>
                <servlet-name>Groovy</servlet-name>
                <url-pattern>*.groovy</url-pattern>
        </servlet-mapping>

</web-app>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Problem with Groovlets on Windows Tomcat

by Stand Trooper :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, the other difference is that I'm not using the service... Installed with the service, but I'm running the tomcat6 from the bin directory.

let me startup the service and see what that does

timo

On Thu, Aug 21, 2008 at 4:44 PM, Alexander Veit <alexander.veit@...> wrote:
> grkuntzmd wrote:
> Anyone have this working? How?

Just tested with WinXP Pro SP3, Groovy 1.5.6, Sun JDK 1.6.0_07, Tomcat
6.0.14, antlr-2.7.6.jar, asm-2.2.jar, and groovy-1.5.6.jar. First Example
from http://groovy.codehaus.org/Groovlets.

It works for me.

-Alex


This is the web.xml I used:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  version="2.5">

   <description>
     Groovlet Examples.
   </description>
   <display-name>Groovlet Examples</display-name>


       <servlet>
               <servlet-name>Groovy</servlet-name>
               <servlet-class>groovy.servlet.GroovyServlet</servlet-class>
       </servlet>

       <servlet-mapping>
               <servlet-name>Groovy</servlet-name>
               <url-pattern>*.groovy</url-pattern>
       </servlet-mapping>

</web-app>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Re: Problem with Groovlets on Windows Tomcat

by Stand Trooper :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Nope still works for me, but I did notice I'm running groovy 1.6  none of this should make a difference tho.

Ok, so let's go through the checklist again

$TOMCAT_HOME$/webapps/ROOT/$NAME$.groovy (whatever the servlet is you're trying to run)
$TOMCAT_HOME$/webapps/ROOT/WEB-INF/lib (where all of the groovy jars are)
$TOMCAT_HOME$/webapps/ROOT/WEB-INF/web.xml (covered in two posts up... which is all I have in my web.xml as well)

either through the service or via the bin/tomcat6 startup (via run as administrator) I have no problems running Groovlets on Tomcat (latest version) against Groovy 1.6 Beta 1 on Windows Vista against jdk 1.6.05

good so far or do you have any differences from this other than jdk or groovy versions?

timo

On Thu, Aug 21, 2008 at 5:20 PM, Stand Trooper <standtrooper@...> wrote:
Ok, the other difference is that I'm not using the service... Installed with the service, but I'm running the tomcat6 from the bin directory.

let me startup the service and see what that does

timo


On Thu, Aug 21, 2008 at 4:44 PM, Alexander Veit <alexander.veit@...> wrote:
> grkuntzmd wrote:
> Anyone have this working? How?

Just tested with WinXP Pro SP3, Groovy 1.5.6, Sun JDK 1.6.0_07, Tomcat
6.0.14, antlr-2.7.6.jar, asm-2.2.jar, and groovy-1.5.6.jar. First Example
from http://groovy.codehaus.org/Groovlets.

It works for me.

-Alex


This is the web.xml I used:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  version="2.5">

   <description>
     Groovlet Examples.
   </description>
   <display-name>Groovlet Examples</display-name>


       <servlet>
               <servlet-name>Groovy</servlet-name>
               <servlet-class>groovy.servlet.GroovyServlet</servlet-class>
       </servlet>

       <servlet-mapping>
               <servlet-name>Groovy</servlet-name>
               <url-pattern>*.groovy</url-pattern>
       </servlet-mapping>

</web-app>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email

Re: Problem with Groovlets on Windows Tomcat [SOLVED]

by grkuntzmd :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Success at last!

I had put a link to groovy-all-1.5.6.jar in JAVA_HOME/jre/lib/ext so that I could run Groovy compiled code without setting the classpath. This appears to be the culprit. I removed it from both the JRE and the JDK/JRE ext directories and Tomcat works fine now.

Thanks to all for the help.
G. Ralph Kuntz, MD