Search Results

Search found 3 results on 1 pages for 'groovlet'.

Page 1/1 | 1 

  • Groovlet + Tomcat: "unable to resolve class" when importing libraries

    - by Rob Hruska
    I'm having some trouble running a groovy servlet (groovlet) in tomcat that imports a library class. When I don't import anything the groovlet works correctly, but if I do import something that I expect to be on the classpath (I can import the same class successfully in a regular servlet), I see the following error: groovy.util.ScriptException: Could not parse scriptName: /MyGroovlet.groovy java.lang.RuntimeException: groovy.util.ScriptException: Could not parse scriptName: /MyGroovlet.groovy at groovy.servlet.GroovyServlet$1.call(GroovyServlet.java:123) ... Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, /MyGroovlet.groovy: 1: unable to resolve class com.mycompany.mypackage.MyLibraryClass @ line 1, column 1. The jar containing MyLibraryClass is in shared/lib, which is loaded by tomcat by the following in catalina.properties: shared.loader=...,${catalina.base}/shared/lib/*.jar,... My groovlets are mapped as described in the user guide in my application's web.xml: <servlet> <servlet-name>GroovyServlet</servlet-name> <servlet-class>groovy.servlet.GroovyServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>GroovyServlet</servlet-name> <url-pattern>*.groovy</url-pattern> </servlet-mapping> And here's the code for the groovlet, MyGroovlet.groovy: import com.mycompany.mypackage.MyLibraryClass MyLibraryClass.someStaticMethod() My groovlet is deployed to WEB-INF/groovy/MyGroovlet.groovy, per the GroovyServlet API. When I visit http://localhost:8080/myapplication/MyGroovlet.groovy, the error described previously is written to my application logs. Is there some way that I need to explicitly declare the runtime classpath for GroovyServlet? I've tried moving the library jar to several places, including WEB-INF/lib and moving the actual MyLibraryClass.class file to WEB-INF/classes, but with no luck.

    Read the article

  • Groovlet not working in GWT project, container : embedded Jetty in google plugin

    - by user325284
    Hi, I am working on a GWT application which uses GWT-RPC. I just made a test groovlet to see if it worked, but ran into some problems here's my groovlet package groovy.servlet; print "testing the groovlet"; Every tutorial said we don't need to subclass anything, and just a simple script would act as a servlet. my web.xml looks like this - <!-- groovy --> <servlet> <servlet-name>testGroovy</servlet-name> <servlet-class>groovy.servlet.testGroovy</servlet-class> </servlet> <servlet-mapping> <servlet-name>testGroovy</servlet-name> <url-pattern>*.groovy</url-pattern> </servlet-mapping When I Run as - web application, i get the following error from jetty : [WARN] failed testGroovy javax.servlet.UnavailableException: Servlet class groovy.servlet.testGroovy is not a javax.servlet.Servlet at org.mortbay.jetty.servlet.ServletHolder.checkServletType(ServletHolder.java:377) at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:234) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:616) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:447) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:222) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:543) at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:421) at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1035) at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:783) at com.google.gwt.dev.DevMode.main(DevMode.java:275) What did I miss ?

    Read the article

  • Persist url parameter throughout grails app

    - by avelis
    Essentially I am looking to have a url query parameter persist throughout the life of the grails application (POST or GET). ex. http://localhost:8080/demo/controller/action/?myParam=foobar I have tried a couple routes. Dynamic method overriding redirect and customizing application tags for createLink. However, since I also use grails webflows it doesn't quite get every single URL. I also tried using a groovy servlet (groovlet) to capture every URL and append the query parameter. The last attempt hasn't been very successful. Am I missing an obvious component to grails? Am I on the right track? Is there another avenue I haven't explored yet? Thanks in advance

    Read the article

1