Skip to main content

asadmin NoClassDefFoundError: Files/Java/jdk1/6/0_20/bin

4 replies [Last post]
dcweems
Offline
Joined: 2010-12-06
Points: 0

After installing GlassFish on my Windows XP Professional 2002 laptop I went to as-install\bin and executed the following whereupon I got the following traceback. Can anyone explain why I am getting this error? I do have the jdk in my PATH.
================================
C:\glassfishv3\glassfish\bin>asadmin start-domain domain1
Waiting for DAS to start .Error starting domain: domain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:

java.lang.NoClassDefFoundError: Files/Java/jdk1/6/0_20/bin
Caused by: java.lang.ClassNotFoundException: Files.Java.jdk1.6.0_20.bin
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: Files/Java/jdk1.6.0_20/bin. Program will exit.
Exception in thread "main"
Command start-domain failed.
================================
The only similar report I found on Oracle(Bug ID: 6434149) was that it was a severe error that needed fixing. It provided the following workaround but I can't edit asadmin.
================================

Change classLoader.loadClass(className) into Class.forName(className, false, classLoader).
The workaround for applications that depend on this is to set the system property  sun.lang.ClassLoader.allowArraySyntax to true (ie: -Dsun.lang.ClassLoader.allowArraySyntax=true).

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alex_katkov
Offline
Joined: 2012-08-20
Points: 0

I`ve got same error after installing soft, which modified PATH enviroment variable to "...c:\windows;c:\windows\system32\...other pathes;C:\Program Files\SoftName\" (slash at the end). After that I also get "NoClassDefFoundError: Files\java\jdk...", not C:\Program Files\java\jdk...".
Removing last slash and restarting shell helps me :)

mgainty
Offline
Joined: 2004-05-21
Points: 0

Majority of File Systems will parse C:\Program Files as
folder=C:\Program
subfolder=Files

to get around this idiosyncratic error always set ENVIRONMENT variables as 8.3 filename e.g.
C:\PROGRA~1

Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

> To: users@glassfish.java.net
> Subject: Re: asadmin NoClassDefFoundError: Files/Java/jdk1/6/0_20/bin
> From: forums@java.net
> Date: Tue, 21 Aug 2012 00:22:56 -0500
>
> I`ve got same error after installing soft, which modified PATH enviroment
> variable to "...c:\windows;c:\windows\system32\...other pathes;C:\Program
> Files\SoftName\" (slash at the end). After that I also get
> "NoClassDefFoundError: Files\java\jdk...", not C:\Program Files\java\jdk...".
> Removing last slash and restarting shell helps me :)
>
> --
>
> [Message sent by forum member 'alex_katkov']
>
> View Post: http://forums.java.net/node/732878
>
>

dcweems
Offline
Joined: 2010-12-06
Points: 0

I hate Windows! I finally figured out the root cause of this error. DOS doesn't automatically recognize spaces in directory names. So "Files/Java/jdk1/6/0_20/bin" is really supposed to be "C:\Program Files/Java/jdk1/6/0_20/bin". Now I just have to figure out where this is getting in there.

dcweems
Offline
Joined: 2010-12-06
Points: 0

The problem was that one of my environment variables to JAVA_HOME had quotes around the directory path. Why that caused the problem beats me but it worked when I removed them.