Re: [jnc-users] Null PointerException atjava.net.URLClassLoader.getPermissions
Status: Beta
Brought to you by:
soapy
From: Keith B. <kei...@fl...> - 2009-11-23 09:02:11
|
Hi Marco, Thanks for your very speedy response. "Please read the manual. Especially the last part of step 1. This might already do the job" I do apologise, I should have specified in my original history that I have already tried the static {} references suggestion from the manual. Unfortunately that isn't making a difference. "If not, please read through the mail archive. There were some discussions about parts of libgcj not getting into the binary and how to solve it" I'll have a deeper search through the archives, great news that there is already a discussion about it. I didn't find it on my first attempts. "I wonder why people always try setting the classpath. This has nothing to do with native compilation" Is there not situations where this would be helpful (if indeed it does work)? I can think of an app I would like to develop but wouldn't get a license to distribute some of the jar dependencies and also wouldn't be allowed to compile them into my app. Thanks again Marco for your responses, hopefully I'll find what I need in the archives! Keith -------------------------------------------------- From: "Marco Trudel" <ma...@mt...> Sent: Sunday, November 22, 2009 7:43 PM To: "Keith Boynton" <kei...@fl...> Cc: <jav...@li...> Subject: Re: [jnc-users] Null PointerException atjava.net.URLClassLoader.getPermissions > Dear Keith > > Keith Boynton wrote: >> Hi, >> >> I made some good progress compiling an app I've written, I came across a >> few errors during the first few iterations of compilation. I've been >> able to resolve most problems I came across by adding missing >> dependencies (jar files) for various packages I'm using. >> >> However I've come to a particular problem that I'm really stumped with >> and would appreciate any help anyone could offer. >> >> I've compiled my app using normal methods through the UI and compilation >> and packing seems successful. However when I run the app (windows or >> linux, both behave the same and return the same errors) I was initially >> getting this error: >> >> [root@tserver tmp]# ./linux >> Exception in thread "main" java.lang.NoClassDefFoundError: >> org.apache.log4j.xml.DOMConfigurator >> at java.lang.Class.initializeClass(linux) >> at java.lang.Class.newInstance(linux) >> at >> org.apache.log4j.helpers.OptionConverter.instantiateByClassName(linux) >> at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(linux) >> at org.apache.log4j.LogManager.<clinit>(linux) >> at java.lang.Class.initializeClass(linux) >> at org.apache.log4j.LogManager.getLogger(linux) >> at org.apache.log4j.Logger.getLogger(linux) >> at com.flare.applications.FileSquirrel.App.main(linux) >> Caused by: java.lang.ClassNotFoundException: org.xml.sax.ErrorHandler > > Please read the manual. Especially the last part of step 1. > This might already do the job: > static > { > org.xml.sax.ErrorHandler.class.getName(); > } I do apologise, I should have specified in my original history that I have already tried the static {} references suggestion from the manual. Unfortunately that isn't making a difference. > If not, please read through the mail archive. There were some > discussions about parts of libgcj not getting into the binary and how to > solve it (ar x libgcj and adding the objects to the compilation). > >> not found in gnu.gcj.runtime.SystemClassLoader{urls=[], >> parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}} >> at java.net.URLClassLoader.findClass(linux) >> at java.lang.ClassLoader.loadClass(linux) >> at java.lang.ClassLoader.loadClass(linux) >> at gnu.gcj.runtime.SystemClassLoader.findClass(linux) >> at java.lang.ClassLoader.loadClass(linux) >> at java.lang.ClassLoader.loadClass(linux) >> at java.lang.Class.initializeClass(linux) >> ...8 more >> I added the libgcj jar to the classpath: >> export CLASSPATH=/tmp/libgcj-4.3.0.jar > > You try to native compile something. So you want to get a binary from > your application, not some links to a runtime lying somewhere... > I wonder why people always try setting the classpath. This has nothing > to do with native compilation... It's too bad GCJ also is a VM and this > has an effect even if GCJ is used for native compilation. > > > Hope this helps > Marco > > >> And now I'm getting this error: >> >> [root@tserver tmp]# ./linux >> Exception in thread "main" java.lang.NoClassDefFoundError: >> org.apache.log4j.xml.DOMConfigurator >> at java.lang.Class.initializeClass(linux) >> at java.lang.Class.newInstance(linux) >> at >> org.apache.log4j.helpers.OptionConverter.instantiateByClassName(linux) >> at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(linux) >> at org.apache.log4j.LogManager.<clinit>(linux) >> at java.lang.Class.initializeClass(linux) >> at org.apache.log4j.LogManager.getLogger(linux) >> at org.apache.log4j.Logger.getLogger(linux) >> at com.flare.applications.FileSquirrel.App.main(linux) >> Caused by: java.lang.NullPointerException >> at java.net.URLClassLoader.getPermissions(linux) >> at java.security.SecureClassLoader.getProtectionDomain(linux) >> at java.security.SecureClassLoader.defineClass(linux) >> at java.net.URLClassLoader.findClass(linux) >> at java.lang.ClassLoader.loadClass(linux) >> at java.lang.ClassLoader.loadClass(linux) >> at gnu.gcj.runtime.SystemClassLoader.findClass(linux) >> at java.lang.ClassLoader.loadClass(linux) >> at java.lang.ClassLoader.loadClass(linux) >> at java.lang.Class.initializeClass(linux) >> ...8 more >> This has me really stumped and any help would be greatly appreciated. >> >> Keith >> >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day >> trial. Simplify your report design, integration and deployment - and >> focus on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> javaCompiler-users mailing list >> jav...@li... >> https://lists.sourceforge.net/lists/listinfo/javacompiler-users > > > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.425 / Virus Database: 270.14.76/2519 - Release Date: 11/22/09 > 07:38:00 > |