groovy

java.lang.IllegalAccessError: tried to access method org.codehaus.groovy.reflection.CachedClass.coerceArgument(Ljava/lang/Object;)Ljava/lang/Object; from class org.codehaus.groovy.runtime.dgm$328

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.5.2
  • Component/s: None
  • Labels:
    None
  • Environment:
    WindowsXP, java 6, groovy rev 10326
  • Number of attachments :
    0

Description

I get this stacktrace

java.lang.IllegalAccessError: tried to access method org.codehaus.groovy.reflection.CachedClass.coerceArgument(Ljava/lang/Object;)Ljava/lang/Object; from class org.codehaus.groovy.runtime.dgm$328
	at org.codehaus.groovy.runtime.dgm$328.doMethodInvoke(Unknown Source)
	at org.codehaus.groovy.runtime.CallSiteArray$PojoCall.call(CallSiteArray.java:72)
	at org.codehaus.groovy.runtime.CallSiteArray.call(CallSiteArray.java:40)
	at app.web.controllers.SearchLanesController$_closure1_closure3.doCall(SearchLanesController.groovy]:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:227)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:873)
	at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:947)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:76)
	at app.web.controllers.SearchLanesController$_closure1_closure3.doCall(SearchLanesController.groovy])
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:227)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:873)
	at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:947)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:710)
	at groovy.lang.Closure.call(Closure.java:292)
	at groovy.lang.Closure.call(Closure.java:287)
	at ronnie.gosh.UnboundClosure.call(UnboundClosure.java:25)
	at ronnie.gosh.ApplicationContext.call(ApplicationContext.java:86)
	at ronnie.gosh.ApplicationContext.call(ApplicationContext.java:97)
	at ronnie.gosh.GoshDispatcherServlet.doService(GoshDispatcherServlet.java:97)
	at app.web.HtmlDispatcherServlet.doService(HtmlDispatcherServlet.java:43)
	at ronnie.gosh.GoshDispatcherServlet.service(GoshDispatcherServlet.java:112)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:619)

I didn't get that with a previous revision.

At line 48 of SearchLanesController.groovy I have

def lanes = laneService.search( session.user, origRegions, null, 
		null, destRegions, null, 
		null, null, null,
		(int)0, (boolean)true, (int)( args.maxResults + 1 ), null, 
		(int)0, null, null, null, null, 
		(boolean)false, (boolean)false )

It tries to call a java class method of a business component:

public List search( SessionUser sessionUser, List originRegionCodes, List originCountryCodes,
		List originStationCodes, List destinationRegionCodes, List destinationCountryCodes,
		List destinationStationCodes, List productGroupCodes, final String laneProductGroupType,
		final int currentTransitTimeValue, boolean includeAuthorizedFlag, int maxResults, List daysOfWeek,
		final int pickupCutoff, Long minEtp, Long maxEtp, Long minTargetDay, Long maxTargetDay,
		boolean includeProposed, final boolean getETP )

This method is also in an interface. Together they form a spring bean with transactions, so that there is a proxy around it.
It worked in a previous revision of groovy 1.6 beta 1.

Activity

Hide
René de Bloois added a comment -

I have also tried

def lanes = laneService.search( session.user, origRegions, null, 
	null, destRegions, null, 
	null, null, null,
	0, true, args.maxResults + 1, null, 
	0, null, null, null, null, 
	false, false )

but that gives the same exception.

Alex, I see that you changed the fix version to 1.6. Do you have a workaround for this issue when 1.5.2 comes out? Or is 1.6 the next version that will be released?

Show
René de Bloois added a comment - I have also tried
def lanes = laneService.search( session.user, origRegions, null, 
	null, destRegions, null, 
	null, null, null,
	0, true, args.maxResults + 1, null, 
	0, null, null, null, null, 
	false, false )
but that gives the same exception. Alex, I see that you changed the fix version to 1.6. Do you have a workaround for this issue when 1.5.2 comes out? Or is 1.6 the next version that will be released?
Hide
Alex Tkachman added a comment -

All changes which cause this problem will go to 1.6 only, not to 1.5.x

Really I feel the problem is more about class loaders not about compilation. What happen is we try to evaluate args.maxResults + 1 via special MetaMethod and fail.

Could you please check that you have only one copy of groovy jars in your classpath?

Show
Alex Tkachman added a comment - All changes which cause this problem will go to 1.6 only, not to 1.5.x Really I feel the problem is more about class loaders not about compilation. What happen is we try to evaluate args.maxResults + 1 via special MetaMethod and fail. Could you please check that you have only one copy of groovy jars in your classpath?
Hide
René de Bloois added a comment -

Well, actually, I think it has more to do with the fact that the method 'coerceArgument' is protected. It can't be called from another package.

If I make it public, the exception does not occur.

With that, I would really like it to be fixed in 1.5.2.

Show
René de Bloois added a comment - Well, actually, I think it has more to do with the fact that the method 'coerceArgument' is protected. It can't be called from another package. If I make it public, the exception does not occur. With that, I would really like it to be fixed in 1.5.2.
Hide
Alex Tkachman added a comment -

Such a stupid bug. A have no idea why it was not catched by tests.
Could you please try trunk and let me know if I can close the issue.

Show
Alex Tkachman added a comment - Such a stupid bug. A have no idea why it was not catched by tests. Could you please try trunk and let me know if I can close the issue.
Hide
René de Bloois added a comment -

Yes, it is fixed. Thanx.

Show
René de Bloois added a comment - Yes, it is fixed. Thanx.
Hide
Paul King added a comment -

close off release 1.5.4

Show
Paul King added a comment - close off release 1.5.4

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: