First, this code runs fine under Java 8. I only get the error on Java 17.
I have code that dynamically loads a Groovy class from Groovy source code
and ends up with a class object. I then try to get a pointer to the method
via reflection.
I have:
Class<?> groovyClass;
which has a valid groovy class.
I am executing:
groovyClass.getMethod(methodName, argTypes);
The actual backtrace looks as follows:
java.lang.NoSuchMethodException: timedTasks.Test.main(java.lang.Object)
at java.lang.Class.getMethod(Class.java:2227) ~[?:?]
at org.kissweb.restServer.GroovyClass.getMethod(GroovyClass.java:71)
~[Kiss.jar:?]
at org.kissweb.Cron$CronLine.runLine(Cron.java:191) ~[Kiss.jar:?]
at org.kissweb.Cron$CronLine.lambda$process$0(Cron.java:181) ~[Kiss.jar:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
So, it is acting like my method isn't there, but it is. The code runs fine
under Java 8. I debugged into it to find the point of failure and it is as
I described. The NoSuchMethodException is occurring at
isGrallAvailable:114, JreCompat (org.apache.tomcat.util.compat). The
exception is bubbling up incorrectly.
Thanks.
Blake
On Sat, Jun 10, 2023 at 8:58 AM Paul King <[email protected]> wrote:
> But what exception?
>
>
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
> Virus-free.www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
> <#m_2092868211654702617_m_-8986209765137685919_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> On Sat, Jun 10, 2023 at 11:44 PM Blake McBride <[email protected]>
> wrote:
>
>> Thanks for the response, Paul!
>>
>> It is an exception. The top of the backtrace is: isGrallAvailable:114,
>> JreCompat (org.apache.tomcat.util.compat)
>>
>> Other elements on the stack trace are as I indicated.
>>
>> No. Not using GraalVM.
>>
>> This is code that ran fine on Java 8. The only change was switching to
>> Java 17.
>>
>> I am seeing the error reported elsewhere on the net, but no clear answer.
>>
>> Thanks.
>>
>> Blake
>>
>> On Sat, Jun 10, 2023 at 8:33 AM Paul King <[email protected]> wrote:
>>
>>> What is the actual error? Also, are you using GraalVM?
>>>
>>>
>>>
>>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>>> Virus-free.www.avast.com
>>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>>> <#m_2092868211654702617_m_-8986209765137685919_m_3152328054999322224_m_8909220699781526507_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>
>>> On Sat, Jun 10, 2023 at 11:35 AM Blake McBride <[email protected]>
>>> wrote:
>>>
>>>> I should add that in the stack trace I am seeing:
>>>>
>>>> loadClass:862 GroovyClassLoader (groovy.lang)
>>>> loadClass:973 GroovyClassLoader (groovy.lang)
>>>> loadClass:960 GroovyClassLoader(groovy.lang)
>>>> loadClass:593, GroovyClassLoader$InnerLoader (groovy.lang)
>>>>
>>>> Thanks!
>>>>
>>>> Blake
>>>>
>>>> On Fri, Jun 9, 2023 at 8:29 PM Blake McBride <[email protected]>
>>>> wrote:
>>>>
>>>>> Greetings,
>>>>>
>>>>> I am running a tomcat app and getting the following error as follows:
>>>>>
>>>>> isGrallAvailable:114, JreCompat (org.apache.tomcat.util.compat)
>>>>>
>>>>> The reason I post it to this group is that it happens when I try to
>>>>> run some dynamic Groovy code. I thought you'll might have an idea.
>>>>>
>>>>> Java 17
>>>>> Tomcat 9.0.65
>>>>> Groovy 4.0.11
>>>>>
>>>>> Sure appreciate any ideas.
>>>>>
>>>>> Thanks!
>>>>>
>>>>> Blake McBride
>>>>>
>>>>