Re: [jnc-users] Null PointerException at java.net.URLClassLoader.getPermissions
Status: Beta
Brought to you by:
soapy
|
From: Marco T. <ma...@mt...> - 2009-11-22 20:10:17
|
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();
}
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
|