Re: org.apache.bcel.classfile.ClassFormatException: Invalid method signature...

Thomas Hawtin <[email protected]>
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
Juozas Baliuka wrote:
> Are you sure this generator is thread safe ?
> 
> ----- Original Message -----
> From: "Neeme Praks" <[email protected]>
> To: "bcel-dev" <[email protected]>
> Sent: Tuesday, June 03, 2003 9:54 AM
> Subject: org.apache.bcel.classfile.ClassFormatException: Invalid method
> signature...
> 
> 
> 
>>Does anyone have any idea, under what circumstances the following error
>>could happen?
>>
>>Unable to create new instance
>>org.apache.bcel.classfile.ClassFormatException: Invalid method
>>signature:
>>
> 
> java/lang/Long;Ljava/lang/Long;Lcom/inpoc/srv/parameters/ServiceParameters;)
> V
> 
>>        at
>>org.apache.bcel.classfile.Utility.typeOfSignature(Utility.java:1024)


> org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler.doPrepare
> (ThreadSafeComponentHandler.java:72)

I'm not familiar with Avalon, but BCEL really is not thread safe. Some 
of the methods in Utility use static variables. If two parts of a 
program both use BCEL (using the same ClassLoader context) then they'll 
have to coordinate amongst themselves not to use it at the same time.

>>The actual signature should be:
>>
> 
> (Lcom/inpoc/srv/messages/RequestMessage;Ljava/lang/Long;Ljava/lang/Long;Lcom
> /inpoc/srv/parameters/ServiceParameters;)V
> 
>>And the error is not really 100% reproduceable, sometimes it shows up,
>>sometimes not...

Certain sounds like a thread problem.

I have a large patch somewhere to fix BCELs static variable problems 
(amongst other things). When I work out how, I'll post it some time... 
In the mean time a quick synchronized around affected methods in BCEL 
should fix it.

Tom Hawtin
-- 
http://www.tackline.demon.co.uk/
Unemployed Java Developer of Central London.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.