Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Java Help

Java Help Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-15-2008, 11:57 AM
RRocha RRocha is offline
Newbie
 
Join Date: May 2008
Posts: 1
Rep Power: 0
RRocha is on a distinguished road
Default classLoader 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Peculiar UI Problem Needs Tackling adriyel C# Programming 2 04-06-2008 07:46 AM
Problem read pwd protected Access2K dbase - CR9 & VB6 mrbar Visual Basic Programming 2 03-10-2008 04:50 AM
How to tackle a programming problem? TcM General Programming 10 01-07-2008 11:29 AM
i have a problem please help me!!!???? stack Java Help 8 09-22-2007 03:17 PM
[C] Comparison problem Alhazred C and C++ 1 08-29-2007 04:58 AM


All times are GMT -5. The time now is 10:24 AM.

Contest Stats

dargueta ........ 93.00000
John ........ 87.50000
Xav ........ 50.00000
MeTh0Dz ........ 20.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000

Contest Rules

Ads