carookee - group communication for you
Home / JavaForum / Java allgemein
Infos   |   Features   |   Gold-Edition   |   Kundenservice   
java
  Übersicht
  Forum
Beginner
Java allgemein
JDBC
JNI
Networking
Online-Ressourcen
Swing + AWT
XML
Meckerecke
  Mitglieder
LOGIN





· Passwort vergessen
· Kostenlos anmelden
  Information
  Demo
  Features
  Im Vergleich
  Anmeldung
SUCHE
Beiträge, Foren oder Verfasser finden:
  Kundenservice
  Impressum
  Datenschutz
  AGB
Status
5.272 User online
0 User eingeloggt
 

Beiträge
   Antworten     Neuer Beitrag    

Beitrag 1455 von 2212 (66%) |<   <   >   >|

Autor mseele
Datum 21.02.03, 16:03
Betreff URLClassLoader exception


was mach ich falsch??? exception:

java.lang.ClassNotFoundException: de.guhsoft.dbdesigner.DDimension
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:217)
at ClassLoad.loadClass(ClassLoad.java:27)
at ClassLoad.(ClassLoad.java:11)
at ClassLoad.main(ClassLoad.java:41)
java.lang.NullPointerException
at ClassLoad.loadClass(ClassLoad.java:36)
at ClassLoad.(ClassLoad.java:11)
at ClassLoad.main(ClassLoad.java:41)
Exception in thread "main" Process terminated with exit code 1

String locationString = "E:\\tmp\\tests\\XXX.jar";
String driverClassName = "de.guhsoft.dbdesigner.DDimension";
URL urls[] = new URL[1];
try {
urls[0] = new File(locationString).toURL();
} catch (MalformedURLException e) {
e.printStackTrace();
}
DDimension dim = null;
try {
ClassLoader loader = new URLClassLoader(urls);
//Class c = loader.loadClass(driverClassName);
Class c = Class.forName(driverClassName, false, loader);
dim = (DDimension)c.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
dim.setSize(400, 400);
System.out.println(dim);

ps: DDimension ist nur ne abgeleitete Dimension klasse!!!




 Auf diesen Beitrag antworten
 Neuen Beitrag verfassen


|<   <   >   >|

                                                                                                                                                                                                                           

Impressum  · Datenschutz  · AGB  · Infos  · Presse
Ein modernes Forum: teamturn.com