You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Keheliya Gallaba <ke...@gmail.com> on 2010/03/02 06:38:48 UTC

Failed to load Main-Class manifest attribute from ldap-proxy-0.2-SNAPSHOT.jar

 Dear Apache Directory Developers,

For trying out the LDAP Proxy GUI prototype I checked it out from
"http://svn.apache.org/repos/asf/directory/sandbox/old/proxy/"
Then, since it is a maven project I used "mvn one:convert" to make the
pom.xml to build it in maven2. After manually downloading some
resources that was not automatically downloaded it was compiled and
built successfully. But now when I issue the command  "java -jar
ldap-proxy-0.2-SNAPSHOT.jar" it gives the error "Failed to load
Main-Class manifest attribute from ldap-proxy-0.2-SNAPSHOT.jar"
I found many instances of MainFrame.class built inside the target
folder like MainFrame$1.class MainFrame$2.class MainFrame$2$1.class
MainFrame$3.class

I will be very grateful if one of you can point me out to where I went wrong
Thank You
-- 
Keheliya Gallaba
http://galpotha.wordpress.com
http://twitter.com/keheliya

Re: Failed to load Main-Class manifest attribute from ldap-proxy-0.2-SNAPSHOT.jar

Posted by Keheliya Gallaba <ke...@gmail.com>.
Hey Emmanuel,
Thanks for pointing that out. But it seems problem is not with using
GNU java. I configured it to run with Sun java and result is an error
almost same as earlier...

Exception in thread "main" java.lang.NoClassDefFoundError:
ldap-proxy-0/2-SNAPSHOT/org/apache/ldap/proxy/gui/MainFrame
Caused by: java.lang.ClassNotFoundException:
ldap-proxy-0.2-SNAPSHOT.org.apache.ldap.proxy.gui.MainFrame
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class:
ldap-proxy-0.2-SNAPSHOT.org.apache.ldap.proxy.gui.MainFrame.  Program
will exit.

Your guidance for me is very much appreciated.
Thank you

On 2 March 2010 13:56, Emmanuel Lecharny <el...@gmail.com> wrote:
> Use a supported JVM, like Sun one. There is no guarantee the project can
> work with GCJ.
>
> On 3/2/10 8:59 AM, Keheliya Gallaba wrote:
>>
>> Sorry for troubling you again. But I found I have mistaken when
>> entering the command for running the jar. I later entered the command
>> " java ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame"
>>
>> and got the result
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame
>>    at gnu.java.lang.MainThread.run(libgcj.so.90)
>> Caused by: java.lang.ClassNotFoundException:
>> ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame not found
>> in gnu.gcj.runtime.SystemClassLoader{urls=[file:./],
>> parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
>>    at java.net.URLClassLoader.findClass(libgcj.so.90)
>>    at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.90)
>>    at java.lang.ClassLoader.loadClass(libgcj.so.90)
>>    at java.lang.ClassLoader.loadClass(libgcj.so.90)
>>    at gnu.java.lang.MainThread.run(libgcj.so.90)
>>
>> Please clarify me on the correct path I should have taken
>>
>> Thank you
>>
>>
>>
>> On 2 March 2010 11:08, Keheliya Gallaba<ke...@gmail.com>
>>  wrote:
>>
>>>
>>>  Dear Apache Directory Developers,
>>>
>>> For trying out the LDAP Proxy GUI prototype I checked it out from
>>> "http://svn.apache.org/repos/asf/directory/sandbox/old/proxy/"
>>> Then, since it is a maven project I used "mvn one:convert" to make the
>>> pom.xml to build it in maven2. After manually downloading some
>>> resources that was not automatically downloaded it was compiled and
>>> built successfully. But now when I issue the command  "java -jar
>>> ldap-proxy-0.2-SNAPSHOT.jar" it gives the error "Failed to load
>>> Main-Class manifest attribute from ldap-proxy-0.2-SNAPSHOT.jar"
>>> I found many instances of MainFrame.class built inside the target
>>> folder like MainFrame$1.class MainFrame$2.class MainFrame$2$1.class
>>> MainFrame$3.class
>>>
>>> I will be very grateful if one of you can point me out to where I went
>>> wrong
>>> Thank You
>>> --
>>> Keheliya Gallaba
>>> http://galpotha.wordpress.com
>>> http://twitter.com/keheliya
>>>
>>>
>>
>>
>>
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.nextury.com
>
>
>



-- 
Keheliya Gallaba
http://galpotha.wordpress.com
http://twitter.com/keheliya

Re: Failed to load Main-Class manifest attribute from ldap-proxy-0.2-SNAPSHOT.jar

Posted by Emmanuel Lecharny <el...@gmail.com>.
Use a supported JVM, like Sun one. There is no guarantee the project can 
work with GCJ.

On 3/2/10 8:59 AM, Keheliya Gallaba wrote:
> Sorry for troubling you again. But I found I have mistaken when
> entering the command for running the jar. I later entered the command
> " java ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame"
>
> and got the result
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame
>     at gnu.java.lang.MainThread.run(libgcj.so.90)
> Caused by: java.lang.ClassNotFoundException:
> ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame not found
> in gnu.gcj.runtime.SystemClassLoader{urls=[file:./],
> parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
>     at java.net.URLClassLoader.findClass(libgcj.so.90)
>     at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.90)
>     at java.lang.ClassLoader.loadClass(libgcj.so.90)
>     at java.lang.ClassLoader.loadClass(libgcj.so.90)
>     at gnu.java.lang.MainThread.run(libgcj.so.90)
>
> Please clarify me on the correct path I should have taken
>
> Thank you
>
>
>
> On 2 March 2010 11:08, Keheliya Gallaba<ke...@gmail.com>  wrote:
>    
>>   Dear Apache Directory Developers,
>>
>> For trying out the LDAP Proxy GUI prototype I checked it out from
>> "http://svn.apache.org/repos/asf/directory/sandbox/old/proxy/"
>> Then, since it is a maven project I used "mvn one:convert" to make the
>> pom.xml to build it in maven2. After manually downloading some
>> resources that was not automatically downloaded it was compiled and
>> built successfully. But now when I issue the command  "java -jar
>> ldap-proxy-0.2-SNAPSHOT.jar" it gives the error "Failed to load
>> Main-Class manifest attribute from ldap-proxy-0.2-SNAPSHOT.jar"
>> I found many instances of MainFrame.class built inside the target
>> folder like MainFrame$1.class MainFrame$2.class MainFrame$2$1.class
>> MainFrame$3.class
>>
>> I will be very grateful if one of you can point me out to where I went wrong
>> Thank You
>> --
>> Keheliya Gallaba
>> http://galpotha.wordpress.com
>> http://twitter.com/keheliya
>>
>>      
>
>
>    


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.nextury.com



Re: Failed to load Main-Class manifest attribute from ldap-proxy-0.2-SNAPSHOT.jar

Posted by Keheliya Gallaba <ke...@gmail.com>.
Dear All,

I'm so happy I got the proxy GUI working. I would like to share how I
made it to work for the benefit of all who will face the same problem.

As you said problem was with, badly referencing to the dependency jars
when main method is called since they were in the maven repository. So
with the help of maven-dependency-plugin I copied all the dependencies
to the target folder and set it as the class path. Then the command
was " java -jar -cp . ldap-proxy-0.2-SNAPSHOT.jar " for executing the
jar.

Thanks  Jörg, Emmanuel and all who helped and was patient. Now back to
Apache Directory development. Good Luck for everybody including me.
;-)

- Keheliya




On 2 March 2010 17:02, Jörg Schaible <jo...@gmx.de> wrote:
> Keheliya Gallaba wrote at Dienstag, 2. März 2010 08:59:
>
>> Sorry for troubling you again. But I found I have mistaken when
>> entering the command for running the jar. I later entered the command
>> " java ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame "
>>
>> and got the result
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame
>>    at gnu.java.lang.MainThread.run(libgcj.so.90)
>> Caused by: java.lang.ClassNotFoundException:
>> ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame not found
>> in gnu.gcj.runtime.SystemClassLoader{urls=[file:./],
>> parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
>>    at java.net.URLClassLoader.findClass(libgcj.so.90)
>>    at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.90)
>>    at java.lang.ClassLoader.loadClass(libgcj.so.90)
>>    at java.lang.ClassLoader.loadClass(libgcj.so.90)
>>    at gnu.java.lang.MainThread.run(libgcj.so.90)
>>
>> Please clarify me on the correct path I should have taken
>
> Please have a look at the documentation for the command line options. You
> either provide the jar and let java find itself the Main class from the
> manifest or you provide the Main class yourself (like you did here) and java
> must find the class in the provided classpath.
>
> None of this have to do with Apache Directory though.
>
> - Jörg
>
>



-- 
Keheliya Gallaba
http://galpotha.wordpress.com
http://twitter.com/keheliya

Re: Failed to load Main-Class manifest attribute from ldap-proxy-0.2-SNAPSHOT.jar

Posted by Jörg Schaible <jo...@gmx.de>.
Keheliya Gallaba wrote at Dienstag, 2. März 2010 08:59:

> Sorry for troubling you again. But I found I have mistaken when
> entering the command for running the jar. I later entered the command
> " java ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame "
> 
> and got the result
> 
> Exception in thread "main" java.lang.NoClassDefFoundError:
> ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame
>    at gnu.java.lang.MainThread.run(libgcj.so.90)
> Caused by: java.lang.ClassNotFoundException:
> ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame not found
> in gnu.gcj.runtime.SystemClassLoader{urls=[file:./],
> parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
>    at java.net.URLClassLoader.findClass(libgcj.so.90)
>    at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.90)
>    at java.lang.ClassLoader.loadClass(libgcj.so.90)
>    at java.lang.ClassLoader.loadClass(libgcj.so.90)
>    at gnu.java.lang.MainThread.run(libgcj.so.90)
> 
> Please clarify me on the correct path I should have taken

Please have a look at the documentation for the command line options. You 
either provide the jar and let java find itself the Main class from the 
manifest or you provide the Main class yourself (like you did here) and java 
must find the class in the provided classpath.

None of this have to do with Apache Directory though.

- Jörg


Re: Failed to load Main-Class manifest attribute from ldap-proxy-0.2-SNAPSHOT.jar

Posted by Keheliya Gallaba <ke...@gmail.com>.
Sorry for troubling you again. But I found I have mistaken when
entering the command for running the jar. I later entered the command
" java ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame "

and got the result

Exception in thread "main" java.lang.NoClassDefFoundError:
ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame
   at gnu.java.lang.MainThread.run(libgcj.so.90)
Caused by: java.lang.ClassNotFoundException:
ldap-proxy-0.2-SNAPSHOT1.org.apache.ldap.proxy.gui.MainFrame not found
in gnu.gcj.runtime.SystemClassLoader{urls=[file:./],
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.90)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.90)
   at java.lang.ClassLoader.loadClass(libgcj.so.90)
   at java.lang.ClassLoader.loadClass(libgcj.so.90)
   at gnu.java.lang.MainThread.run(libgcj.so.90)

Please clarify me on the correct path I should have taken

Thank you



On 2 March 2010 11:08, Keheliya Gallaba <ke...@gmail.com> wrote:
>  Dear Apache Directory Developers,
>
> For trying out the LDAP Proxy GUI prototype I checked it out from
> "http://svn.apache.org/repos/asf/directory/sandbox/old/proxy/"
> Then, since it is a maven project I used "mvn one:convert" to make the
> pom.xml to build it in maven2. After manually downloading some
> resources that was not automatically downloaded it was compiled and
> built successfully. But now when I issue the command  "java -jar
> ldap-proxy-0.2-SNAPSHOT.jar" it gives the error "Failed to load
> Main-Class manifest attribute from ldap-proxy-0.2-SNAPSHOT.jar"
> I found many instances of MainFrame.class built inside the target
> folder like MainFrame$1.class MainFrame$2.class MainFrame$2$1.class
> MainFrame$3.class
>
> I will be very grateful if one of you can point me out to where I went wrong
> Thank You
> --
> Keheliya Gallaba
> http://galpotha.wordpress.com
> http://twitter.com/keheliya
>



-- 
Keheliya Gallaba
http://galpotha.wordpress.com
http://twitter.com/keheliya

Re: Failed to load Main-Class manifest attribute from ldap-proxy-0.2-SNAPSHOT.jar

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 3/2/10 6:38 AM, Keheliya Gallaba wrote:
>   Dear Apache Directory Developers,
>
> For trying out the LDAP Proxy GUI prototype I checked it out from
> "http://svn.apache.org/repos/asf/directory/sandbox/old/proxy/"
> Then, since it is a maven project I used "mvn one:convert" to make the
> pom.xml to build it in maven2. After manually downloading some
> resources that was not automatically downloaded it was compiled and
> built successfully. But now when I issue the command  "java -jar
> ldap-proxy-0.2-SNAPSHOT.jar" it gives the error "Failed to load
> Main-Class manifest attribute from ldap-proxy-0.2-SNAPSHOT.jar"
> I found many instances of MainFrame.class built inside the target
> folder like MainFrame$1.class MainFrame$2.class MainFrame$2$1.class
> MainFrame$3.class
>
> I will be very grateful if one of you can point me out to where I went wrong
> Thank You
>    
Don't waste your time trying to convert the project automatically. 
Create a new Maven 2 project from scratch, it should not take you more 
than half an hour.



-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.nextury.com