Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-15-2008, 07:33 PM
Member
 
Join Date: May 2008
Posts: 1
RRocha is on a distinguished road
defineClass problem
Hi,

I have an client-server application developed in Ecplise. The server is working on Apache Tomcat5.5 and the client is a java application...
Heres my problem, the client makes a request on a webservice and the server receives it and begins to process its request, at some point when executing the following class:

public class URIClassLoader extends ClassLoader {
public Object loadClassByURL(String location, String className, boolean jar) {
try {
if (jar)
location = "jar:" + location + "!/" + className + ".class";
URL url = new URL(location);
InputStream is = url.openStream();
byte[] classData = new byte[is.available()];
is.read(classData);
Class dynamicClass = defineClass(null, classData, 0, classData.length, null);
this.resolveClass(dynamicClass);
return dynamicClass.newInstance();
} catch (Exception e) {
System.out.println(e);
}
return null;
}
}

it simply stops at the line marked in red.

the local version of my application works just fine, but "remotely" it simply gives me this exception in the client:

java.lang.reflect.InvocationTargetException

but no exception is shown in the tomcats log.
my guess is that something is (obviously) going wrong when executing
Class dynamicClass = defineClass(null, classData, 0, classData.length, null);
but I cant understand what it is...

can anyone help me?
Regards Rui Rocha
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +3. The time now is 03:49 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org