This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 212938 - JNA: NetBeans 7.2 Does not Start on Linux
Summary: JNA: NetBeans 7.2 Does not Start on Linux
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.2
Hardware: PC Linux
: P1 normal (vote)
Assignee: Stanislav Aubrecht
URL: https://github.com/twall/jna/pull/66/...
Keywords:
: 212977 213058 213262 213319 213686 214030 214742 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-24 09:25 UTC by arthurbuliva
Modified: 2012-06-28 09:19 UTC (History)
11 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arthurbuliva 2012-05-24 09:25:52 UTC
I installed netbeans-7.2beta-ml-linux.sh by running

sh-4.2$ sudo ./netbeans-7.2beta-ml-linux.sh

My machine is:

sh-4.2$ uname -a
Linux xxxx.xxxx 3.3.5-2.fc16.i686 #1 SMP Tue May 8 12:04:02 UTC 2012 i686 i686 i386 GNU/Linux
sh-4.2$ 


Installs well but when I try to run it as a regular user, it does not start up. So I ran it in terminal and this is the trace I got:

sh-4.2$ /usr/local/netbeans-7.2beta/bin/netbeans 
-------------------------------------------------------------------------------
>Log Session: Thursday, May 24, 2012 12:18:41 PM EAT
>System Info: 
  Product Version         = NetBeans IDE 7.2 Beta (Build 201205031832) (#41d3eb3428ac)
  Operating System        = Linux version 3.3.5-2.fc16.i686 running on i386
  Java; VM; Vendor        = 1.7.0_03; Java HotSpot(TM) Client VM 22.1-b02; Oracle Corporation
  Runtime                 = Java(TM) SE Runtime Environment 1.7.0_03-b04
  Java Home               = /usr/java/jdk1.7.0_03/jre
  System Locale; Encoding = en_US (nb); UTF-8
  Home Directory          = /home/arthur
  Current Directory       = /home/arthur/Desktop
  User Directory          = /home/arthur/.netbeans/7.2beta
  Cache Directory         = /home/arthur/.cache/netbeans/7.2beta
  Installation            = /usr/local/netbeans-7.2beta/nb
                            /usr/local/netbeans-7.2beta/ergonomics
                            /usr/local/netbeans-7.2beta/ide
                            /usr/local/netbeans-7.2beta/java
                            /usr/local/netbeans-7.2beta/apisupport
                            /usr/local/netbeans-7.2beta/webcommon
                            /usr/local/netbeans-7.2beta/websvccommon
                            /usr/local/netbeans-7.2beta/enterprise
                            /usr/local/netbeans-7.2beta/mobility
                            /usr/local/netbeans-7.2beta/profiler
                            /usr/local/netbeans-7.2beta/php
                            /usr/local/netbeans-7.2beta/harness
                            /usr/local/netbeans-7.2beta/cnd
                            /usr/local/netbeans-7.2beta/dlight
                            /usr/local/netbeans-7.2beta/groovy
                            /usr/local/netbeans-7.2beta/javafx
                            /usr/local/netbeans-7.2beta/platform
  Boot & Ext. Classpath   = /usr/java/jdk1.7.0_03/jre/lib/resources.jar:/usr/java/jdk1.7.0_03/jre/lib/rt.jar:/usr/java/jdk1.7.0_03/jre/lib/sunrsasign.jar:/usr/java/jdk1.7.0_03/jre/lib/jsse.jar:/usr/java/jdk1.7.0_03/jre/lib/jce.jar:/usr/java/jdk1.7.0_03/jre/lib/charsets.jar:/usr/java/jdk1.7.0_03/jre/classes:/usr/java/jdk1.7.0_03/jre/lib/ext/sunpkcs11.jar:/usr/java/jdk1.7.0_03/jre/lib/ext/sunjce_provider.jar:/usr/java/jdk1.7.0_03/jre/lib/ext/localedata.jar:/usr/java/jdk1.7.0_03/jre/lib/ext/sunec.jar:/usr/java/jdk1.7.0_03/jre/lib/ext/dnsns.jar:/usr/java/jdk1.7.0_03/jre/lib/ext/zipfs.jar
  Application Classpath   = /usr/local/netbeans-7.2beta/platform/lib/boot.jar:/usr/local/netbeans-7.2beta/platform/lib/org-openide-modules.jar:/usr/local/netbeans-7.2beta/platform/lib/org-openide-util.jar:/usr/local/netbeans-7.2beta/platform/lib/org-openide-util-lookup.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/boot_ja.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/boot_pt_BR.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/boot_ru.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/boot_zh_CN.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/org-openide-modules_ja.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/org-openide-modules_pt_BR.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/org-openide-modules_ru.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/org-openide-modules_zh_CN.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/org-openide-util_ja.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/org-openide-util-lookup_ja.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/org-openide-util-lookup_pt_BR.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/org-openide-util-lookup_ru.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/org-openide-util-lookup_zh_CN.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/org-openide-util_pt_BR.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/org-openide-util_ru.jar:/usr/local/netbeans-7.2beta/platform/lib/locale/org-openide-util_zh_CN.jar:/usr/java/latest/lib/dt.jar:/usr/java/latest/lib/tools.jar
  Startup Classpath       = /usr/local/netbeans-7.2beta/platform/core/org-openide-filesystems.jar:/usr/local/netbeans-7.2beta/platform/core/core.jar:/usr/local/netbeans-7.2beta/platform/core/locale/core_ja.jar:/usr/local/netbeans-7.2beta/platform/core/locale/org-openide-filesystems_zh_CN.jar:/usr/local/netbeans-7.2beta/platform/core/locale/org-openide-filesystems_ja.jar:/usr/local/netbeans-7.2beta/platform/core/locale/org-openide-filesystems_pt_BR.jar:/usr/local/netbeans-7.2beta/platform/core/locale/core_zh_CN.jar:/usr/local/netbeans-7.2beta/platform/core/locale/org-openide-filesystems_ru.jar:/usr/local/netbeans-7.2beta/platform/core/locale/core_ru.jar:/usr/local/netbeans-7.2beta/platform/core/locale/core_pt_BR.jar:/usr/local/netbeans-7.2beta/nb/core/org-netbeans-upgrader.jar:/usr/local/netbeans-7.2beta/nb/core/locale/org-netbeans-upgrader_ja.jar:/usr/local/netbeans-7.2beta/nb/core/locale/org-netbeans-upgrader_zh_CN.jar:/usr/local/netbeans-7.2beta/nb/core/locale/core_nb_ja.jar:/usr/local/netbeans-7.2beta/nb/core/locale/org-netbeans-upgrader_pt_BR.jar:/usr/local/netbeans-7.2beta/nb/core/locale/core_nb.jar:/usr/local/netbeans-7.2beta/nb/core/locale/core_nb_zh_CN.jar:/usr/local/netbeans-7.2beta/nb/core/locale/org-netbeans-upgrader_ru.jar:/usr/local/netbeans-7.2beta/nb/core/locale/core_nb_ru.jar:/usr/local/netbeans-7.2beta/nb/core/locale/core_nb_pt_BR.jar
-------------------------------------------------------------------------------
WARNING [org.netbeans.core.modules]: the modules [org.netbeans.modules.db.sql.editor, org.netbeans.modules.editor.structure, org.netbeans.modules.xml.text] use org.netbeans.modules.editor.deprecated.pre65formatting which is deprecated.
java.lang.Error: Failed to create temporary file for jnidispatch library: java.io.IOException: Permission denied
	at com.sun.jna.Native.loadNativeLibraryFromJar(Native.java:762)
	at com.sun.jna.Native.loadNativeLibrary(Native.java:697)
	at com.sun.jna.Native.<clinit>(Native.java:127)
	at org.netbeans.modules.masterfs.watcher.linux.LinuxNotifier.<init>(LinuxNotifier.java:103)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
	at java.lang.Class.newInstance0(Class.java:372)
	at java.lang.Class.newInstance(Class.java:325)
	at org.openide.util.lookup.implspi.SharedClassObjectBridge.newInstance(SharedClassObjectBridge.java:64)
	at org.openide.util.lookup.MetaInfServicesLookup$P.getInstance(MetaInfServicesLookup.java:519)
	at org.netbeans.modules.masterfs.watcher.Watcher.getNotifierForPlatform(Watcher.java:414)
	at org.netbeans.modules.masterfs.watcher.Watcher.<init>(Watcher.java:85)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
	at java.lang.Class.newInstance0(Class.java:372)
	at java.lang.Class.newInstance(Class.java:325)
	at org.openide.util.lookup.implspi.SharedClassObjectBridge.newInstance(SharedClassObjectBridge.java:64)
	at org.openide.util.lookup.MetaInfServicesLookup$P.getInstance(MetaInfServicesLookup.java:519)
	at org.openide.util.lookup.AbstractLookup$R.allInstances(AbstractLookup.java:1041)
	at org.openide.util.lookup.AbstractLookup$R.allInstances(AbstractLookup.java:1021)
	at org.openide.util.lookup.ProxyLookup$LazyCollection.computeSingleResult(ProxyLookup.java:1249)
	at org.openide.util.lookup.ProxyLookup$LazyCollection.computeDelegate(ProxyLookup.java:1091)
	at org.openide.util.lookup.ProxyLookup$LazyCollection.access$900(ProxyLookup.java:1021)
	at org.openide.util.lookup.ProxyLookup$LazyCollection$1.hasNext(ProxyLookup.java:1215)
	at org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem$StatusImpl.resultChanged(FileBasedFileSystem.java:305)
	at org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem$StatusImpl.<init>(FileBasedFileSystem.java:271)
	at org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem.<init>(FileBasedFileSystem.java:81)
	at org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem.<clinit>(FileBasedFileSystem.java:79)
	at org.netbeans.modules.masterfs.filebasedfs.FileBasedURLMapper.getFileObjects(FileBasedURLMapper.java:138)
	at org.netbeans.modules.masterfs.MasterURLMapper.getFileObjects(MasterURLMapper.java:65)
	at org.openide.filesystems.URLMapper.findFileObject(URLMapper.java:212)
	at org.netbeans.modules.project.ui.LazyProject.getProjectDirectory(LazyProject.java:92)
	at org.netbeans.modules.project.ui.OpenProjectList$RecentProjectList$4.run(OpenProjectList.java:1537)
	at org.netbeans.modules.project.ui.OpenProjectList$RecentProjectList$4.run(OpenProjectList.java:1505)
	at org.openide.util.Mutex.readAccess(Mutex.java:290)
	at org.netbeans.modules.project.ui.OpenProjectList$RecentProjectList.load(OpenProjectList.java:1505)
	at org.netbeans.modules.project.ui.OpenProjectList$2.run(OpenProjectList.java:215)
	at org.netbeans.modules.project.ui.OpenProjectList$2.run(OpenProjectList.java:208)
	at org.openide.util.Mutex.readAccess(Mutex.java:290)
	at org.netbeans.modules.project.ui.OpenProjectList.getDefault(OpenProjectList.java:208)
	at org.netbeans.modules.project.ui.OpenProjectsTrampolineImpl.addPropertyChangeListenerAPI(OpenProjectsTrampolineImpl.java:95)
	at org.netbeans.api.project.ui.OpenProjects.addPropertyChangeListener(OpenProjects.java:287)
	at org.netbeans.api.project.ui.OpenProjects.<init>(OpenProjects.java:98)
	at org.netbeans.api.project.ui.OpenProjects.<clinit>(OpenProjects.java:90)
	at org.netbeans.modules.ide.ergonomics.fod.FeatureProjectFactory.<init>(FeatureProjectFactory.java:107)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
	at java.lang.Class.newInstance0(Class.java:372)
	at java.lang.Class.newInstance(Class.java:325)
	at org.openide.util.lookup.implspi.SharedClassObjectBridge.newInstance(SharedClassObjectBridge.java:64)
	at org.openide.util.lookup.MetaInfServicesLookup$P.getInstance(MetaInfServicesLookup.java:519)
	at org.openide.util.lookup.AbstractLookup$R.allInstances(AbstractLookup.java:1041)
	at org.openide.util.lookup.AbstractLookup$R.allInstances(AbstractLookup.java:1021)
	at org.openide.util.lookup.ProxyLookup$LazyCollection.computeSingleResult(ProxyLookup.java:1249)
	at org.openide.util.lookup.ProxyLookup$LazyCollection.computeDelegate(ProxyLookup.java:1091)
	at org.openide.util.lookup.ProxyLookup$LazyCollection.access$900(ProxyLookup.java:1021)
	at org.openide.util.lookup.ProxyLookup$LazyCollection$1.hasNext(ProxyLookup.java:1215)
	at org.netbeans.modules.ide.ergonomics.fod.FoDLayersProvider.noAdditionalProjects(FoDLayersProvider.java:154)
	at org.netbeans.modules.ide.ergonomics.fod.FoDLayersProvider.registerLayers(FoDLayersProvider.java:96)
	at org.openide.filesystems.Repository.findLayers(Repository.java:231)
	at org.netbeans.core.startup.NbRepository.additionalLayers(NbRepository.java:182)
	at org.netbeans.core.startup.layers.ModuleLayeredFileSystem.setURLs(ModuleLayeredFileSystem.java:245)
	at org.netbeans.core.startup.layers.ModuleLayeredFileSystem.addURLs(ModuleLayeredFileSystem.java:283)
	at org.netbeans.core.startup.NbInstaller.loadLayers(NbInstaller.java:617)
	at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:345)
	at org.netbeans.ModuleManager.enable(ModuleManager.java:1163)
	at org.netbeans.ModuleManager.enable(ModuleManager.java:986)
	at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:340)
	at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:276)
	at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:295)
	at org.netbeans.core.startup.Main.getModuleSystem(Main.java:169)
	at org.netbeans.core.startup.Main.start(Main.java:305)
	at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:123)
	at java.lang.Thread.run(Thread.java:722)
Comment 1 Tomas Danek 2012-05-24 11:16:37 UTC
passing to platform.
Comment 2 Antonin Nebuzelsky 2012-05-24 16:04:37 UTC
java.lang.Error: Failed to create temporary file for jnidispatch library:
java.io.IOException: Permission denied
    at com.sun.jna.Native.loadNativeLibraryFromJar(Native.java:762)
    at com.sun.jna.Native.loadNativeLibrary(Native.java:697)
    at com.sun.jna.Native.<clinit>(Native.java:127)

Stando, please evaluate.
Comment 3 Jaroslav Tulach 2012-05-25 07:32:17 UTC
We should not be unpacking the JNA library, it should be part of the module layout, right?
Comment 4 Stanislav Aubrecht 2012-05-25 08:59:46 UTC
It could be related to this recently fixed JNA issue: https://github.com/twall/jna/commit/2143c18459774701dd413e02ff19efb1143e4790

But NetBeans installation does include unpacked JNA binaries which the classloader should pick up instead of extracting them from JAR.
Comment 5 Tomas Danek 2012-05-28 08:40:03 UTC
*** Bug 213058 has been marked as a duplicate of this bug. ***
Comment 6 Tomas Danek 2012-05-28 08:57:33 UTC
unfoorunatelly I'm able to reproduce; this breaks 'install as root, run as user scenario' :-(
Comment 7 Stanislav Aubrecht 2012-05-28 13:06:12 UTC
JNA extracts the native library from it's JAR file because of #186000
Comment 8 Stanislav Aubrecht 2012-05-28 14:02:32 UTC
core-main 26b718ec3fcc
Comment 9 Jesse Glick 2012-05-29 18:36:52 UTC
(In reply to comment #7)
> JNA extracts the native library from it's JAR file because of #186000

How is that? I thought it was because of #186000 that we did _not_ need to extract anything at runtime, at least for commonly used architectures (like Linux x86 which reporter seems to be using).


Anyway changing the value of ${java.io.tmpdir} for the rest of the IDE session is a potentially destabilizing change in behavior. A safer fix would be something like:

String old = System.getProperty("java.io.tmpdir");
System.setProperty("java.io.tmpdir", ...whatever...);
try {
  Class.forName(Native.class.getName(), true, Native.class.getClassLoader());
} catch (ClassNotFoundException x) {
  assert false : x;
} finally {
  System.setProperty("java.io.tmpdir", old);
}
Comment 10 Quality Engineering 2012-05-30 05:30:41 UTC
Integrated into 'main-golden', will be available in build *201205300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/26b718ec3fcc
User: S. Aubrecht <saubrecht@netbeans.org>
Log: #212938 - permission denied when extracting native JNA lib
Comment 11 Stanislav Aubrecht 2012-05-30 09:22:08 UTC
(In reply to comment #9)
> (In reply to comment #7)
> > JNA extracts the native library from it's JAR file because of #186000
> 
> How is that? I thought it was because of #186000 that we did _not_ need to
> extract anything at runtime, at least for commonly used architectures (like
> Linux x86 which reporter seems to be using).
Sure, but before your fix of #186000 the NetBeans classloader was for looking for JNA native lib in 'linux' folder while the build process extracted it to 'Linux' folder. So on Linux OS the JNA native lib was always extracted from JAR.

> 
> 
> Anyway changing the value of ${java.io.tmpdir} for the rest of the IDE session
> is a potentially destabilizing change in behavior.
Well, I'd rather rollback the whole fix since it isn't needed anyway.
Comment 12 Jesse Glick 2012-05-30 19:52:04 UTC
(In reply to comment #11)
> the NetBeans classloader was for looking
> for JNA native lib in 'linux' folder while the build process extracted it to
> 'Linux' folder. So on Linux OS the JNA native lib was always extracted from
> JAR.

This was fixed a month ago, in 2ed9bef1c084. Are you saying that that was in fact the fix of this bug?

> I'd rather rollback the whole fix since it isn't needed anyway.

You mean roll back 26b718ec3fcc? Yes please.
Comment 13 Stanislav Aubrecht 2012-05-31 07:53:54 UTC
*** Bug 212977 has been marked as a duplicate of this bug. ***
Comment 14 Stanislav Aubrecht 2012-05-31 07:56:13 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > the NetBeans classloader was for looking
> > for JNA native lib in 'linux' folder while the build process extracted it to
> > 'Linux' folder. So on Linux OS the JNA native lib was always extracted from
> > JAR.
> 
> This was fixed a month ago, in 2ed9bef1c084. Are you saying that that was in
> fact the fix of this bug?
Yes, but that fix isn't in 7.2 beta where this report is coming from.
> 
> > I'd rather rollback the whole fix since it isn't needed anyway.
> 
> You mean roll back 26b718ec3fcc? Yes please.
core-main 6ca2468990ce
Comment 15 Quality Engineering 2012-06-01 05:28:23 UTC
Integrated into 'main-golden', will be available in build *201206010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6ca2468990ce
User: S. Aubrecht <saubrecht@netbeans.org>
Log: reverting fix for #212938, the correct fix is in #186000
Comment 16 Stanislav Aubrecht 2012-06-04 09:21:30 UTC
*** Bug 213319 has been marked as a duplicate of this bug. ***
Comment 17 Stanislav Aubrecht 2012-06-07 08:38:06 UTC
*** Bug 213686 has been marked as a duplicate of this bug. ***
Comment 18 Stanislav Aubrecht 2012-06-12 09:58:42 UTC
*** Bug 214030 has been marked as a duplicate of this bug. ***
Comment 19 Stanislav Aubrecht 2012-06-26 09:14:59 UTC
*** Bug 213262 has been marked as a duplicate of this bug. ***
Comment 20 Stanislav Aubrecht 2012-06-28 09:19:56 UTC
*** Bug 214742 has been marked as a duplicate of this bug. ***