You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-user@jakarta.apache.org by Bjoern Wuest <bj...@comtec.e-technik.uni-kassel.de> on 2003/05/01 21:40:20 UTC

RE: Incompatible argument -> Method signature

Hello

Thanks for all the help. In the first try, I also used the BCELifier but
because of any reason, it didn't work. I slightly modified the "wrapper"
template I wrote and re-BCELified it again and now it seems to work (after
some String-acrobatics :) ).
I will focus on the return type now (which is still missing), run some tests
with various kinds of methods and classes and look what will happen with
nested classes :).

If everything works fine, I will post my code again at the mailing list and
offer for download for some period of time.

Thanks for all the help.
  Bjoern


PS: I appreciate the BCELifier very much since it is an invaluable source
for learning byte-code. I am into byte-code for 6 days now (2 days net-time)
and without BCELifier I would be in the very early beginning.

-----Original Message-----
From: news [mailto:news@main.gmane.org] On Behalf Of Berin Loritsch
Sent: Dienstag, 29. April 2003 16:29
To: bcel-user@jakarta.apache.org
Subject: Re: Incompatible argument -> Method signature


Bjoern Wuest wrote:
> Hello
> 
> Thanks for the hint. I already tried this but as the 
> java.lang.reflect.Proxy class, it supports interfaces only (at least 
> this is what it says). Unfortunately, I have to wrap (proxy) classes. 
> I downloaded to code to study but got very confused because of the 
> many method invocations. I prefer to have few but efficient calls, but 
> others like to have more structure :) I hope I am not wrong but this 
> is what I found in the docu and in the pieces of source code. If you 
> have some hint or tweak how to run with classes, I would appreciate 
> very much.

Bjoern, I put some results of my experiences with BCEL on the Wiki. Perhaps
they can be of some help to you:

http://nagoya.apache.org/wiki/apachewiki.cgi?BCELUserFAQ

I ran into many of the same issues when I wrote the BCEL Compiler for my
binary XML project (http://d-haven.org/bxml).  One thing that helped me was
hand writing the code the way I thought it should be, and then using the
BCELifier (should be available in BCEL 5.1) to see how to write it useing
BCEL.

The Verifier that comes with BCEL is another invaluable tool to help find
out what is going on.  Use that in conjunction with the javap tool (comes
with the JDK), and you will be able to solve most problems.



---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org


Re: Getting JavaClass from class instance

Posted by Juozas Baliuka <ba...@mwm.lt>.
I think it is no way to implement this with standard java API or custom
ClassLoder,
classes like java.lang.reflect.Proxy call native methods to define class,
use JNI hooks if possible.

----- Original Message -----
From: "Bjoern Wuest" <bj...@gmx.net>
To: "'BCEL Users List'" <bc...@jakarta.apache.org>;
<bj...@gmx.net>
Sent: Friday, May 02, 2003 11:10 AM
Subject: Getting JavaClass from class instance


> Hello All
>
> I am working on a runtime wrapper for object instances. While I get
> everything working with classes available on secondary storage (file
> system), I have problems to use the mechanism on wrapper objects created
> in memory and now wrapped a second time.
> To solve this, I would require a method looking like:
>
> public JavaClass convert(Class MyClassInstance);
>
> Unfortunately, I could not find some similar method. The only think I
> found was the ClassLoaderRepository (CLR) of BCEL. However, this
> mechanism does not work. The CLR will use the filesystem where the class
> is not available since it is purely "in-memory".
>
> Thanks for tips
>   Bjoern
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: bcel-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org


RE: Getting JavaClass from class instance

Posted by Bjoern Wuest <bj...@gmx.net>.
Hello All

I oversee a possibility with the ClassLoaderRepository. Now I am able to
get an instance of JavaClass for "in-memory" created objects (classes).
Currently I am fighting with the constructor (telling me something about
wrong arguments) but I am quite sure to fix this problem, too.

Regards
  Bjoern


-----Original Message-----
From: Bjoern Wuest [mailto:bjoern.wuest@gmx.net] 
Sent: Freitag, 2. Mai 2003 11:10
To: 'BCEL Users List'; bjoern.wuest@gmx.net
Subject: Getting JavaClass from class instance

Hello All

I am working on a runtime wrapper for object instances. While I get
everything working with classes available on secondary storage (file
system), I have problems to use the mechanism on wrapper objects created
in memory and now wrapped a second time.
To solve this, I would require a method looking like:

public JavaClass convert(Class MyClassInstance);

Unfortunately, I could not find some similar method. The only think I
found was the ClassLoaderRepository (CLR) of BCEL. However, this
mechanism does not work. The CLR will use the filesystem where the class
is not available since it is purely "in-memory".

Thanks for tips
  Bjoern



---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org


Getting JavaClass from class instance

Posted by Bjoern Wuest <bj...@gmx.net>.
Hello All

I am working on a runtime wrapper for object instances. While I get
everything working with classes available on secondary storage (file
system), I have problems to use the mechanism on wrapper objects created
in memory and now wrapped a second time.
To solve this, I would require a method looking like:

public JavaClass convert(Class MyClassInstance);

Unfortunately, I could not find some similar method. The only think I
found was the ClassLoaderRepository (CLR) of BCEL. However, this
mechanism does not work. The CLR will use the filesystem where the class
is not available since it is purely "in-memory".

Thanks for tips
  Bjoern



---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org