Re: need help about code mobility

Niclas Hedhman <[email protected]>
Newsgroups gmane.comp.java.sun.jini
Organization Private
Message-ID <[email protected]>
On Friday 29 December 2006 03:20, Mark Zaini wrote:
> I have a exception with JVM I don't believe who I have 
> problems with Apache

Arrogance doesn't solve problems, and will only alienate the people from whom 
you are seeking help.
 
Both I and Gregg asked the first thing that pops up in our mind when debugging 
these kinds of problems. Does the codebase location work? Common decency is 
to validate that, especially since it is such a simply operation;
1) Open a browser.
2) Key in a URL
3) Extract the entry from the log file and provide it to us.
4) If it works, we can exclude one source of problems from the list, as well 
as getting a confirmation of the *actual* codebase location (see below).

> URLClassLoader ld = new URLClassLoader( new URL[]

Does your superclass sit in the System Classloader or in a classloader 
provided within your application or application platform? If you don't 
provide the parent classloader, the System Classloader will be chosen.
You probably want to add;
  ClassLoader parent = getClass().getClassLoader();
  URLClassLoader ld = new URLClassLoader( urls, parent );
(if C sits in the same classloader)

>                            new URL
> ("http://myhost:80/remoteclasses/B.class")})

You are actually wasting time of the people who are trying to help you.

This is not the URL you provided in earlier code snippet, and this one won't 
work. You provide the root location of the classes, not the class itself, in 
the URL(s).

So, I think you will do everybody a favor by posting the real code in full, 
and not manipulated snippets.

> the exception is :java.lang.NoClassDefFoundError: class B

This is also not the previously reported Exception. This Exception WILL NOT 
happen during the URLClassloader.loadClass() operation (which throws 
ClassNotFoundException).

> Class C {
> namecl="A";

Again, this is inconsistent with previous text. Now you want to load A and not 
B??

> I think that the problem is with the resolution of the hierarchy
> What do you think? 

I think you don't even know what your own statement even mean...


Conclusion;
1. Follow the requests from the people trying to help you out.
2. Paste actual output without any manual alterations.
3. Paste actual complete code without any manual alterations.
4. Drop the arrogant/"I know better" attitude.


Niclas

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]
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.