Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using reflector + Package!

807607Nov 21 2006 — edited Nov 22 2006
hello all,

i am trying to use the reflector and so i have the following code in my Client.java
 Class c = Class.forName("Job");
		
 Method meth = c.getMethod(jobServers[0].functionName);
     	 
meth.invoke(jobServers[0].objServerRef, theCallbackObjectRef, number, jobServers);
				 
the 1st problem i encounter is that the Job class is declared in a package called WorkflowFramework and when i run my program i get a class not found exception!!!

FileClient Error: Job
java.lang.ClassNotFoundException: Job
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at Client.main(Client.java:117)

In my code, i import the correct package with the "import WorkflowFramework.*;" declaration and when i put the mouse over the word Job of Class c = Class.forName("Job"); declaration i get the proper path...(I use eclipse) => WorkflowFramework/Job.java . Generated by the IDL-to-Java compiler (portable), version "3.2" from WorkflowFramework.idl

Can you help me? what is going on? why the Class.forName function cannot find my class?? why it cannot resolve the path with the package?

ps. please dont tell me to copy the java file where the client.java file is...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 20 2006
Added on Nov 21 2006
13 comments
296 views