Quantcast

Error when running application with standalone plugin

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Error when running application with standalone plugin

mjparme
I am trying to run a standalone web application using the standalone plugin. It starts up fine; however, when I try to go to the URL it throws a ClassNotFoundException for org.apache.juli.logging.UserDataHelper. grepping through the jar that the standalone plugin created I see that that class is indeed missing. Do I need to so something else to get that class available? I have tried adding tomcat-juli.jar (the jar that class is in) to the classpath when I start my app with the -cp parameter but it had no effect.

Can anyone offer any insight?

Jun 26, 2012 3:42:12 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jun 26, 2012 3:42:12 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Jun 26, 2012 3:42:12 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.25
Jun 26, 2012 3:42:13 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
INFO: No global web.xml found
Jun 26, 2012 3:42:16 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jun 26, 2012 3:42:27 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'grails'
Jun 26, 2012 3:42:27 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Server running. Browse to http://localhost:8080/webviewer
Jun 26, 2012 3:46:39 PM org.apache.coyote.AbstractProtocol$AbstractConnectionHandler process
SEVERE: null
java.lang.NoClassDefFoundError: org/apache/juli/logging/UserDataHelper
        at org.apache.tomcat.util.http.Cookies.<clinit>(Cookies.java:42)
        at org.apache.coyote.Request.<init>(Request.java:131)
        at org.apache.coyote.AbstractProcessor.<init>(AbstractProcessor.java:44)
        at org.apache.coyote.http11.AbstractHttp11Processor.<init>(AbstractHttp11Processor.java:257)
        at org.apache.coyote.http11.Http11Processor.<init>(Http11Processor.java:55)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.createProcessor(Http11Protocol.java:161)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.createProcessor(Http11Protocol.java:99)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:549)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.UserDataHelper
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 12 more
Exception in thread "http-bio-8080-exec-1" java.lang.NullPointerException
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.release(Http11Protocol.java:136)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.release(Http11Protocol.java:99)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:638)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)


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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Error when running application with standalone plugin

mjparme
I followed the instructions at this site and got it working:

http://tedwise.com/2012/03/28/getting-the-grails-standalone-plugin-to-work-with-grails-201/


On Jun 26, 2012, at 2:50 PM, Parmeley, Michael wrote:

> I am trying to run a standalone web application using the standalone plugin. It starts up fine; however, when I try to go to the URL it throws a ClassNotFoundException for org.apache.juli.logging.UserDataHelper. grepping through the jar that the standalone plugin created I see that that class is indeed missing. Do I need to so something else to get that class available? I have tried adding tomcat-juli.jar (the jar that class is in) to the classpath when I start my app with the -cp parameter but it had no effect.
>
> Can anyone offer any insight?
>
> Jun 26, 2012 3:42:12 PM org.apache.coyote.AbstractProtocol init
> INFO: Initializing ProtocolHandler ["http-bio-8080"]
> Jun 26, 2012 3:42:12 PM org.apache.catalina.core.StandardService startInternal
> INFO: Starting service Tomcat
> Jun 26, 2012 3:42:12 PM org.apache.catalina.core.StandardEngine startInternal
> INFO: Starting Servlet Engine: Apache Tomcat/7.0.25
> Jun 26, 2012 3:42:13 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
> INFO: No global web.xml found
> Jun 26, 2012 3:42:16 PM org.apache.catalina.core.ApplicationContext log
> INFO: Initializing Spring root WebApplicationContext
> Jun 26, 2012 3:42:27 PM org.apache.catalina.core.ApplicationContext log
> INFO: Initializing Spring FrameworkServlet 'grails'
> Jun 26, 2012 3:42:27 PM org.apache.coyote.AbstractProtocol start
> INFO: Starting ProtocolHandler ["http-bio-8080"]
> Server running. Browse to http://localhost:8080/webviewer
> Jun 26, 2012 3:46:39 PM org.apache.coyote.AbstractProtocol$AbstractConnectionHandler process
> SEVERE: null
> java.lang.NoClassDefFoundError: org/apache/juli/logging/UserDataHelper
> at org.apache.tomcat.util.http.Cookies.<clinit>(Cookies.java:42)
> at org.apache.coyote.Request.<init>(Request.java:131)
> at org.apache.coyote.AbstractProcessor.<init>(AbstractProcessor.java:44)
> at org.apache.coyote.http11.AbstractHttp11Processor.<init>(AbstractHttp11Processor.java:257)
> at org.apache.coyote.http11.Http11Processor.<init>(Http11Processor.java:55)
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.createProcessor(Http11Protocol.java:161)
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.createProcessor(Http11Protocol.java:99)
> at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:549)
> at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662)
> Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.UserDataHelper
> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> ... 12 more
> Exception in thread "http-bio-8080-exec-1" java.lang.NullPointerException
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.release(Http11Protocol.java:136)
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.release(Http11Protocol.java:99)
> at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:638)
> at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662)
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Named parameters with sql.eachRow

Brad Rippe
Can someone direct me on how to use named parameters with eachRow?
 
I have the following code:
 
def subjectsQry = '''
    select stvsubj_code, stvsubj_desc
    from   stvsubj
    where  stvsubj_code like '%'
    and    stvsubj_disp_web_ind = 'Y'
    and    exists
    (select 1
           from ssbsect a, stvssts
           where  a.ssbsect_subj_code = stvsubj_code
           and    a.ssbsect_term_code like nvl(:termCode, '%')
           and    a.ssbsect_camp_code like nvl(:campusCode, '%')
           and    stvssts_code = a.ssbsect_ssts_code
           and    stvssts_active_ind = 'A')
    order by stvsubj_code'''
 
def sql = Sql.newInstance (dataSource)
sql.setEnableNamedQueries(true)

try {
    sql.eachRow(subjectsQry, [campusCode:2, termCode:'201220']) {
        //doing stuff here
    }
} catch(Exception e) {
    log.error "Exception ${query} - ${e}"
}
 
I get a groovy.lang.MissingMethodException: No signature of method: groovy.sql.Sql.eachRow() is applicable for argument types: (java.lang.String, java.util.LinkedHashMap, blah_closure6) Exception.
 
I see in the documentation for groovy.sql.Sql "Several of the methods in this class which have a String-based sql query and params in a List or Object[] support named or named ordinal parameters. These methods are useful for queries with large numbers of parameters - though the GString variations are often preferred in such cases too."
 
I'm not sure where I'm going wrong. Thanks!
 
 
Brad Rippe
IT Project Leader
North Orange County Community College District
(714) 808-4872
[hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Named parameters with sql.eachRow

geezenslaw
On 06/26/2012 02:57 PM, Brad Rippe wrote:
Can someone direct me on how to use named parameters with eachRow?
 
I have the following code:
 
def subjectsQry = '''
    select stvsubj_code, stvsubj_desc
    from   stvsubj
    where  stvsubj_code like '%'
    and    stvsubj_disp_web_ind = 'Y'
    and    exists
    (select 1
           from ssbsect a, stvssts
           where  a.ssbsect_subj_code = stvsubj_code
           and    a.ssbsect_term_code like nvl(:termCode, '%')
           and    a.ssbsect_camp_code like nvl(:campusCode, '%')
           and    stvssts_code = a.ssbsect_ssts_code
           and    stvssts_active_ind = 'A')
    order by stvsubj_code'''
 
def sql = Sql.newInstance (dataSource)
sql.setEnableNamedQueries(true)

try {
    sql.eachRow(subjectsQry, [campusCode:2, termCode:'201220']) {
        //doing stuff here
    }
} catch(Exception e) {
    log.error "Exception ${query} - ${e}"
}
 
I get a groovy.lang.MissingMethodException: No signature of method: groovy.sql.Sql.eachRow() is applicable for argument types: (java.lang.String, java.util.LinkedHashMap, blah_closure6) Exception.
 
I see in the documentation for groovy.sql.Sql "Several of the methods in this class which have a String-based sql query and params in a List or Object[] support named or named ordinal parameters. These methods are useful for queries with large numbers of parameters - though the GString variations are often preferred in such cases too."
 
I'm not sure where I'm going wrong. Thanks!
 
 
Brad Rippe
IT Project Leader
North Orange County Community College District
(714) 808-4872
[hidden email]
Try removing the Try/Catch. BTW: why the try/catch anyway? Use the ternary ?: instead.

Let me VPN and I can fix this for you.

HTH, David.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Named parameters with sql.eachRow

Brad Rippe
The issue was the params weren't a list in my previous call but a Map. I had to change the call to eachRow to:
 
sql.eachRow(subjectsQry, [[campusCode:2, termCode:'201220']]) {
    //doing stuff here
}
 
I'm using the try/catch because the code is within a method in a service object and if bad things happen, I wanted some feedback as to which method and what went wrong. Thanks!
 
Brad Rippe
IT Project Leader
North Orange County Community College District
(714) 808-4872
[hidden email]


>>> David Brown <[hidden email]> 6/26/2012 4:31 PM >>>
On 06/26/2012 02:57 PM, Brad Rippe wrote:
Can someone direct me on how to use named parameters with eachRow?
 
I have the following code:
 
def subjectsQry = '''
    select stvsubj_code, stvsubj_desc
    from   stvsubj
    where  stvsubj_code like '%'
    and    stvsubj_disp_web_ind = 'Y'
    and    exists
    (select 1
           from ssbsect a, stvssts
           where  a.ssbsect_subj_code = stvsubj_code
           and    a.ssbsect_term_code like nvl(:termCode, '%')
           and    a.ssbsect_camp_code like nvl(:campusCode, '%')
           and    stvssts_code = a.ssbsect_ssts_code
           and    stvssts_active_ind = 'A')
    order by stvsubj_code'''
 
def sql = Sql.newInstance (dataSource)
sql.setEnableNamedQueries(true)

try {
    sql.eachRow(subjectsQry, [campusCode:2, termCode:'201220']) {
        //doing stuff here
    }
} catch(Exception e) {
    log.error "Exception ${query} - ${e}"
}
 
I get a groovy.lang.MissingMethodException: No signature of method: groovy.sql.Sql.eachRow() is applicable for argument types: (java.lang.String, java.util.LinkedHashMap, blah_closure6) Exception.
 
I see in the documentation for groovy.sql.Sql "Several of the methods in this class which have a String-based sql query and params in a List or Object[] support named or named ordinal parameters. These methods are useful for queries with large numbers of parameters - though the GString variations are often preferred in such cases too."
 
I'm not sure where I'm going wrong. Thanks!
 
 
Brad Rippe
IT Project Leader
North Orange County Community College District
(714) 808-4872
[hidden email]
Try removing the Try/Catch. BTW: why the try/catch anyway? Use the ternary ?: instead.

Let me VPN and I can fix this for you.

HTH, David.

Loading...