groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter McNeil <pe...@mcneils.net>
Subject Re: Simple question.. how to call a java class method in Groovy Script
Date Tue, 23 May 2017 00:08:50 GMT
Unusual for a Java Class to have a lower case name... just sayin'


On 23/05/17 03:40, RJ wrote:
> Here is my script. Highlighted the method call.. tried some google 
> searches for the syntax. Thanks for the help!
>
> import java.util.*
> import com.example.auth.user;
>
> class EBSAttrRelease {
>     def Map<UserString, List<UserObject>> run(final UserObject... args) {
>     def userid=com.example.auth.user.getId()
>     return [MYLOGINID:userid]
>     }
> }
>
> Error:
> 2017-05-22 13:32:56,986 ERROR - <groovy.lang.MissingMethodException: 
> No signature of method: static com.example.auth.user.getId() is 
> applicable for argument types: () values: []
> Possible solutions: getAt(java.lang.String), wait(), find(), grep(), 
> wait(long), grep(java.lang.Object)>

-- 
web: http://nerderg.com
Twitter: http://twitter.com/pmcneil
Google+: https://plus.google.com/u/0/communities/110661434396927001866


Mime
View raw message