groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Blake McBride <blake1...@gmail.com>
Subject Re: Class not found errors on 2.5.9
Date Sun, 09 Feb 2020 23:45:58 GMT
Now that I have some time I have been looking into it.  Interestingly, my
Gradle build line looks like this:

compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.15'
     or
compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.5.9'

If I build a WAR file with the 2.4.15 I get the following in the
WEB-INF/lib directory od my WAR file:

abcl.jar                         log4j-1.2.17.jar
ojdbc6-12.1.0.1-atlassian-hosted.jar  sqlite-jdbc-3.21.0.1.jar
c3p0-0.9.5.2.jar                 mchange-commons-java-0.2.11.jar
 postgresql-42.2.2.jar
dynamic-loader-1.4-SNAPSHOT.jar  mssql-jdbc-6.4.0.jre8.jar
 slf4j-api-1.7.25.jar
groovy-all-2.4.15.jar            mysql-connector-java-6.0.6.jar
slf4j-simple-1.7.25.jar

If I just change the 2.4.15 to 2.5.9 I get:

abcl.jar                         groovy-jmx-2.5.9.jar
 junit-jupiter-engine-5.4.0.jar
ant-1.9.13.jar                   groovy-json-2.5.9.jar
junit-platform-commons-1.4.0.jar
ant-antlr-1.9.13.jar             groovy-jsr223-2.5.9.jar
junit-platform-engine-1.4.0.jar
ant-junit-1.9.13.jar             groovy-macro-2.5.9.jar
 junit-platform-launcher-1.4.0.jar
ant-launcher-1.9.13.jar          groovy-nio-2.5.9.jar
 log4j-1.2.17.jar
apiguardian-api-1.0.0.jar        groovy-servlet-2.5.9.jar
 mchange-commons-java-0.2.11.jar
c3p0-0.9.5.2.jar                 groovy-sql-2.5.9.jar
 mssql-jdbc-6.4.0.jre8.jar
commons-cli-1.4.jar              groovy-swing-2.5.9.jar
 mysql-connector-java-6.0.6.jar
dynamic-loader-1.4-SNAPSHOT.jar  groovy-templates-2.5.9.jar
 ojdbc6-12.1.0.1-atlassian-hosted.jar
groovy-2.5.9.jar                 groovy-test-2.5.9.jar
opentest4j-1.1.1.jar
groovy-ant-2.5.9.jar             groovy-test-junit5-2.5.9.jar
 picocli-4.0.1.jar
groovy-cli-commons-2.5.9.jar     groovy-testng-2.5.9.jar
postgresql-42.2.2.jar
groovy-cli-picocli-2.5.9.jar     groovy-xml-2.5.9.jar
 qdox-1.12.1.jar
groovy-console-2.5.9.jar         hamcrest-core-1.3.jar
slf4j-api-1.7.25.jar
groovy-datetime-2.5.9.jar        jcommander-1.72.jar
slf4j-simple-1.7.25.jar
groovy-docgenerator-2.5.9.jar    jline-2.14.6.jar
 sqlite-jdbc-3.21.0.1.jar
groovy-groovydoc-2.5.9.jar       junit-4.12.jar
 testng-6.13.1.jar
groovy-groovysh-2.5.9.jar        junit-jupiter-api-5.4.0.jar

What?

Why isn't it loading groovy-all-2.5.9.jar instead of all of those sub-jars?

Thanks!

Blake









On Wed, Feb 5, 2020 at 5:01 PM Blake McBride <blake1024@gmail.com> wrote:

> Greetings,
>
> All of the code is at https://github.com/blakemcbride/Kiss/
> It runs as-is.  If I just change Groovy from 2.4.15 to 2.5.9 I get the
> following when I run it with: ./gradlew tomcatRun
>
> $ ./gradlew clean
>
> BUILD SUCCESSFUL in 1s
> 1 actionable task: 1 executed
> $ ./gradlew tomcatRun
> 16:45:28 INFO  Configuring / with
> file:/home/blake/intellijProjects/Kiss/build/inplaceWebapp/META-INF/context.xml
> Feb 05, 2020 4:45:29 PM org.apache.coyote.AbstractProtocol init
> INFO: Initializing ProtocolHandler ["http-nio-8080"]
> Feb 05, 2020 4:45:29 PM org.apache.tomcat.util.net.NioSelectorPool
> getSharedSelector
> INFO: Using a shared selector for servlet write/read
> Feb 05, 2020 4:45:29 PM org.apache.catalina.core.StandardService
> startInternal
> INFO: Starting service Tomcat
> Feb 05, 2020 4:45:29 PM org.apache.catalina.core.StandardEngine
> startInternal
> INFO: Starting Servlet Engine: Apache Tomcat/8.0.51
> Feb 05, 2020 4:45:29 PM org.apache.catalina.startup.ContextConfig
> getDefaultWebXmlFragment
> INFO: No global web.xml found
> Feb 05, 2020 4:45:32 PM org.apache.jasper.servlet.TldScanner scanJars
> INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable
> debug logging for this logger for a complete list of JARs that were scanned
> but no TLDs were found in them. Skipping unneeded JARs during scanning can
> improve startup time and JSP compilation time.
> Feb 05, 2020 4:45:32 PM org.apache.coyote.AbstractProtocol start
> INFO: Starting ProtocolHandler ["http-nio-8080"]
> 16:45:32 INFO  Tomcat 8.0.51 started and listening on port 8080
> 16:45:32 INFO   runs at:
> 16:45:32 INFO    http://localhost:8080
>
> > Task :tomcatRun
> Press any key to stop the server.
>
> * * * Context path = /home/blake/intellijProjects/Kiss/build/inplaceWebapp/
> * * * Is running with source
> * * * Application path set to
> /home/blake/intellijProjects/Kiss/src/main/application/
> Feb 05, 2020 4:45:44 PM org.apache.catalina.core.StandardWrapperValve
> invoke
> SEVERE: Servlet.service() for servlet [org.kissweb.rest.MainServlet] in
> context with path [] threw exception [Servlet execution threw an exception]
> with root cause
> java.lang.NoSuchMethodError:
> org.apache.groovy.util.SystemUtil.getSystemPropertySafe(Ljava/lang/String;)Ljava/lang/String;
>         at
> org.codehaus.groovy.control.CompilerConfiguration.<init>(CompilerConfiguration.java:411)
>         at
> org.codehaus.groovy.control.CompilerConfiguration$1.<init>(CompilerConfiguration.java:122)
>         at
> org.codehaus.groovy.control.CompilerConfiguration.<clinit>(CompilerConfiguration.java:122)
>         at groovy.lang.GroovyClassLoader.<init>(GroovyClassLoader.java:160)
>         at groovy.lang.GroovyClassLoader.<init>(GroovyClassLoader.java:184)
>         at groovy.lang.GroovyClassLoader.<init>(GroovyClassLoader.java:140)
>         at org.kissweb.rest.GroovyClass.<init>(GroovyClass.java:54)
>         at
> org.kissweb.rest.GroovyService.loadGroovyClass(GroovyService.java:155)
>         at
> org.kissweb.rest.GroovyService.internalGroovy(GroovyService.java:41)
>         at
> org.kissweb.rest.MainServlet.initializeSystem(MainServlet.java:70)
>         at org.kissweb.rest.MainServlet.doPost(MainServlet.java:51)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
>         at
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
>         at
> org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:458)
>         at
> org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:177)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
>         at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:608)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
>         at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
>         at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
>         at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
>         at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>         at java.lang.Thread.run(Thread.java:748)
>
> * * * Context path = /home/blake/intellijProjects/Kiss/build/inplaceWebapp/
> * * * Is running with source
> * * * Application path set to
> /home/blake/intellijProjects/Kiss/src/main/application/
> Feb 05, 2020 4:45:44 PM org.apache.catalina.core.StandardWrapperValve
> invoke
> SEVERE: Servlet.service() for servlet [org.kissweb.rest.MainServlet] in
> context with path [] threw exception [Servlet execution threw an exception]
> with root cause
> java.lang.NoClassDefFoundError: Could not initialize class
> org.codehaus.groovy.control.CompilerConfiguration
>         at groovy.lang.GroovyClassLoader.<init>(GroovyClassLoader.java:160)
>         at groovy.lang.GroovyClassLoader.<init>(GroovyClassLoader.java:184)
>         at groovy.lang.GroovyClassLoader.<init>(GroovyClassLoader.java:140)
>         at org.kissweb.rest.GroovyClass.<init>(GroovyClass.java:54)
>         at
> org.kissweb.rest.GroovyService.loadGroovyClass(GroovyService.java:155)
>         at
> org.kissweb.rest.GroovyService.internalGroovy(GroovyService.java:41)
>         at
> org.kissweb.rest.MainServlet.initializeSystem(MainServlet.java:70)
>         at org.kissweb.rest.MainServlet.doPost(MainServlet.java:51)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
>         at
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
>         at
> org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:458)
>         at
> org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:177)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
>         at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:608)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
>         at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
>         at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
>         at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
>         at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>         at java.lang.Thread.run(Thread.java:748)
>
> * * * Context path = /home/blake/intellijProjects/Kiss/build/inplaceWebapp/
> * * * Is running with source
> * * * Application path set to
> /home/blake/intellijProjects/Kiss/src/main/application/
> Feb 05, 2020 4:45:44 PM org.apache.catalina.core.StandardWrapperValve
> invoke
> SEVERE: Servlet.service() for servlet [org.kissweb.rest.MainServlet] in
> context with path [] threw exception [Servlet execution threw an exception]
> with root cause
> java.lang.NoClassDefFoundError: Could not initialize class
> org.codehaus.groovy.control.CompilerConfiguration
>         at groovy.lang.GroovyClassLoader.<init>(GroovyClassLoader.java:160)
>         at groovy.lang.GroovyClassLoader.<init>(GroovyClassLoader.java:184)
>         at groovy.lang.GroovyClassLoader.<init>(GroovyClassLoader.java:140)
>         at org.kissweb.rest.GroovyClass.<init>(GroovyClass.java:54)
>         at
> org.kissweb.rest.GroovyService.loadGroovyClass(GroovyService.java:155)
>         at
> org.kissweb.rest.GroovyService.internalGroovy(GroovyService.java:41)
>         at
> org.kissweb.rest.MainServlet.initializeSystem(MainServlet.java:70)
>         at org.kissweb.rest.MainServlet.doPost(MainServlet.java:51)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
>         at
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
>         at
> org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:458)
>         at
> org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:177)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
>         at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:608)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
>         at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
>         at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
>         at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
>         at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>         at java.lang.Thread.run(Thread.java:748)
>
> <===========--> 87% EXECUTING [13m 12<===========--> 87% EXECUTING [13m
> 57s]
> > IDLE
> > IDLE
> > IDLE
> > IDLE
> > IDLE
> > :tomcatRun                         > :tomcatRun
> > IDLE
> > IDLE
>
>
>
> On Wed, Feb 5, 2020 at 4:31 PM Paul King <paulk@asert.com.au> wrote:
>
>> Also, we would be interested in your classpath. It might be that both 2.4
>> and 2.5 jars are on the classpath somehow. Doesn't appear to be the case in
>> the scan but depends on how the tomcatRun task is defined I guess as to
>> where its classpath is set up.
>>
>> On Thu, Feb 6, 2020 at 8:28 AM Paul King <paulk@asert.com.au> wrote:
>>
>>>
>>> Hi Blake,
>>>
>>> Do you have a stack trace? That's really what we were after in the scan,
>>> but may not be possible to get via that means in your case.
>>>
>>> Thanks, Paul.
>>>
>>>
>>> On Thu, Feb 6, 2020 at 5:58 AM Blake McBride <blake1024@gmail.com>
>>> wrote:
>>>
>>>> Yes but as I said initially, when I run:  gradle tomcatRun
>>>> I get:
>>>>
>>>> java.lang.NoSuchMethodError:
>>>> org.apache.groovy.util.SystemUtil.getSystemPropertySafe(Ljava/lang/String;)Ljava/lang/String;
>>>>
>>>> java.lang.NoClassDefFoundError: Could not initialize class
>>>> org.codehaus.groovy.control.CompilerConfiguration
>>>>
>>>> The system ran and runs fine until I update Groovy.
>>>>
>>>> Thanks.
>>>>
>>>> Blake
>>>>
>>>>
>>>> On Sun, Feb 2, 2020 at 3:48 AM Daniel.Sun <sunlan@apache.org> wrote:
>>>>
>>>>> Hi Blake,
>>>>>
>>>>>      The build is *SUCCESSFUL*...
>>>>>
>>>>> https://scans.gradle.com/s/yxiyvmlpnq5ui/console-log?anchor=13
>>>>> ```
>>>>> :compileJava UP-TO-DATE
>>>>> :processResources NO-SOURCE
>>>>> :classes UP-TO-DATE
>>>>> :war
>>>>> :assemble
>>>>> :compileTestJava NO-SOURCE
>>>>> :processTestResources NO-SOURCE
>>>>> :testClasses UP-TO-DATE
>>>>> :test NO-SOURCE
>>>>> :check UP-TO-DATE
>>>>> :build
>>>>> BUILD SUCCESSFUL in 16s
>>>>> 2 actionable tasks: 1 executed, 1 up-to-date
>>>>> ```
>>>>>
>>>>> Cheers,
>>>>> Daniel.Sun
>>>>>
>>>>>
>>>>>
>>>>> -----
>>>>> Apache Groovy committer & PMC member
>>>>> Blog: http://blog.sunlan.me
>>>>> Twitter: @daniel_sun
>>>>>
>>>>> --
>>>>> Sent from:
>>>>> http://groovy.329449.n5.nabble.com/Groovy-Users-f329450.html
>>>>>
>>>>

Mime
View raw message