[jboss-user] [Javassist user questions] - 3.1: Use of .class causes VerifyError

hlship do-not-reply at jboss.com
Tue Sep 26 12:22:34 EDT 2006


Whenever I try to use the .class construct inside a Javassist method body, I get a VerifyError.

The text below is from my class transformer; it represents the additions and changes made to a particular class as it is loaded.


  | [DEBUG] RenderableUser Finished class transformation: InternalClassTransformation[
  | public org.apache.tapestry.integration.app1.components.RenderableUser extends java.lang.Object
  |   implements org.apache.tapestry.runtime.ComponentLifecycle
  | 
  | add field: protected org.apache.tapestry.internal.InternalComponentResources _$resources;
  | 
  | extend method: public org.apache.tapestry.ComponentResources getComponentResources()
  | return _$resources;
  | 
  | add field: protected org.apache.tapestry.services.Environment _$environment;
  | 
  | add method: private org.apache.tapestry.Renderable _$environment_read_renderable()
  | return ($r) _$environment.peek(org.apache.tapestry.Renderable.class);
  | 
  | replace read _renderable: _$environment_read_renderable();
  | 
  | add method: private void _write__renderable(org.apache.tapestry.Renderable $1)
  | throw new java.lang.RuntimeException("Field org.apache.tapestry.integration.app1.components.RenderableUser._renderable is read-only.");
  | 
  | replace write _renderable: _write__renderable();
  | 
  | extend method: public void beginRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.LifecycleEvent $2)
  | {
  |   if ($2.isAborted()) return;
  |   render($1);
  | }
  | 
  | 
  | convert default constructor: initializer();
  | 
  | add constructor: org.apache.tapestry.integration.app1.components.RenderableUser(org.apache.tapestry.internal.InternalComponentResources $1, org.apache.tapestry.services.Environment $2)
  | {
  |   _$resources = $1;
  |   _$environment = $2;
  |   initializer();
  | 
  | }
  | 
  | ]
  | 

Results in:

  | java.lang.VerifyError: (class: org/apache/tapestry/integration/app1/components/RenderableUser, method: _$environment_read_renderable signature: ()Lorg/apache/tapestry/Renderable;) Inconsistent args_size for opc_invokeinterface
  | 	at java.lang.Class.getDeclaredConstructors0(Native Method)
  | 	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
  | 	at java.lang.Class.getConstructors(Class.java:1446)
  | 	at org.apache.tapestry.internal.services.ReflectiveInstantiator.findConstructor(ReflectiveInstantiator.java:60)
  | 	at org.apache.tapestry.internal.services.ReflectiveInstantiator.<init>(ReflectiveInstantiator.java:48)
  | 	at org.apache.tapestry.internal.services.InternalClassTransformationImpl.createInstantiator(InternalClassTransformationImpl.java:1043)
  | 

Has anyone else had any luck using .class?

I think, in my situation, I'll be able to work around this using the $type production.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974278#3974278

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974278



More information about the jboss-user mailing list