Why does sbt fail with java.io.IOException: Permission denied at startup? - sbt

I've installed sbt on Mac OS X 10.9 via MacPorts.
If I run sbt as root - all works fine, but as a user - I got an exception.
java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:1012)
at scala.reflect.io.AbstractFile.fileOrSubdirectoryNamed(AbstractFile.scala:235)
at scala.reflect.io.AbstractFile.fileNamed(AbstractFile.scala:246)
at scala.tools.nsc.backend.jvm.BytecodeWriters$class.getFile(BytecodeWriters.scala:34)
at scala.tools.nsc.backend.jvm.BytecodeWriters$class.scala$tools$nsc$backend$jvm$BytecodeWriters$$getFile(BytecodeWriters.scala:37)
at scala.tools.nsc.backend.jvm.BytecodeWriters$ClassBytecodeWriter$class.writeClass(BytecodeWriters.scala:89)
at scala.tools.nsc.backend.jvm.GenASM$AsmPhase$$anon$4.writeClass(GenASM.scala:67)
at scala.tools.nsc.backend.jvm.GenASM$JBuilder.writeIfNotTooBig(GenASM.scala:459)
at scala.tools.nsc.backend.jvm.GenASM$JMirrorBuilder.genMirrorClass(GenASM.scala:2980)
at scala.tools.nsc.backend.jvm.GenASM$AsmPhase.run(GenASM.scala:114)
at sbt.compiler.Eval$$anonfun$compile$1$1.apply$mcV$sp(Eval.scala:159)
at sbt.compiler.Eval$$anonfun$compile$1$1.apply(Eval.scala:159)
at sbt.compiler.Eval$$anonfun$compile$1$1.apply(Eval.scala:159)
at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:207)
at sbt.compiler.Eval.compile$1(Eval.scala:159)
at sbt.compiler.Eval.compileAndLoad(Eval.scala:164)
at sbt.compiler.Eval.evalCommon(Eval.scala:135)
at sbt.compiler.Eval.eval(Eval.scala:86)
at sbt.EvaluateConfigurations$.evaluateSetting(EvaluateConfigurations.scala:144)
at sbt.EvaluateConfigurations$$anonfun$9.apply(EvaluateConfigurations.scala:106)
at sbt.EvaluateConfigurations$$anonfun$9.apply(EvaluateConfigurations.scala:105)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at sbt.EvaluateConfigurations$.evaluateSbtFile(EvaluateConfigurations.scala:105)
at sbt.Load$.sbt$Load$$loadSettingsFile$1(Load.scala:507)
at sbt.Load$$anonfun$sbt$Load$$memoLoadSettingsFile$1$1.apply(Load.scala:502)
at sbt.Load$$anonfun$sbt$Load$$memoLoadSettingsFile$1$1.apply(Load.scala:501)
at scala.Option.getOrElse(Option.scala:120)
at sbt.Load$.sbt$Load$$memoLoadSettingsFile$1(Load.scala:501)
at sbt.Load$$anonfun$loadSettings$1$2.apply(Load.scala:500)
at sbt.Load$$anonfun$loadSettings$1$2.apply(Load.scala:500)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at sbt.Load$.loadSettings$1(Load.scala:500)
at sbt.Load$.sbt$Load$$expand$1(Load.scala:523)
at sbt.Load$.loadSettings(Load.scala:528)
at sbt.Load$.sbt$Load$$loadSbtFiles$1(Load.scala:464)
at sbt.Load$.defaultLoad$1(Load.scala:475)
at sbt.Load$.loadTransitive(Load.scala:478)
at sbt.Load$.loadProjects$1(Load.scala:418)
at sbt.Load$.loadUnit(Load.scala:419)
at sbt.Load$$anonfun$15$$anonfun$apply$11.apply(Load.scala:256)
at sbt.Load$$anonfun$15$$anonfun$apply$11.apply(Load.scala:256)
at sbt.BuildLoader$$anonfun$componentLoader$1$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(BuildLoader.scala:93)
at sbt.BuildLoader$$anonfun$componentLoader$1$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(BuildLoader.scala:92)
at sbt.BuildLoader.apply(BuildLoader.scala:143)
at sbt.Load$.loadAll(Load.scala:312)
at sbt.Load$.loadURI(Load.scala:264)
at sbt.Load$.load(Load.scala:260)
at sbt.Load$.load(Load.scala:251)
at sbt.Load$.apply(Load.scala:134)
at sbt.Load$.buildPluginDefinition(Load.scala:613)
at sbt.Load$.buildPlugins(Load.scala:579)
at sbt.Load$.plugins(Load.scala:567)
at sbt.Load$.loadUnit(Load.scala:411)
at sbt.Load$$anonfun$15$$anonfun$apply$11.apply(Load.scala:256)
at sbt.Load$$anonfun$15$$anonfun$apply$11.apply(Load.scala:256)
at sbt.BuildLoader$$anonfun$componentLoader$1$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(BuildLoader.scala:93)
at sbt.BuildLoader$$anonfun$componentLoader$1$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(BuildLoader.scala:92)
at sbt.BuildLoader.apply(BuildLoader.scala:143)
at sbt.Load$.loadAll(Load.scala:312)
at sbt.Load$.loadURI(Load.scala:264)
at sbt.Load$.load(Load.scala:260)
at sbt.Load$.load(Load.scala:251)
at sbt.Load$.apply(Load.scala:134)
at sbt.Load$.defaultLoad(Load.scala:37)
at sbt.BuiltinCommands$.doLoadProject(Main.scala:473)
at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:467)
at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:467)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:60)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:60)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:62)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:62)
at sbt.Command$.process(Command.scala:95)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:100)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:100)
at sbt.State$$anon$1.process(State.scala:179)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:100)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:100)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.MainLoop$.next(MainLoop.scala:100)
at sbt.MainLoop$.run(MainLoop.scala:93)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:71)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:66)
at sbt.Using.apply(Using.scala:25)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:66)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:49)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:33)
at sbt.MainLoop$.runLogged(MainLoop.scala:25)
at sbt.StandardMain$.runManaged(Main.scala:57)
at sbt.xMain.run(Main.scala:29)
at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:129)
at xsbt.boot.Launch$.run(Launch.scala:109)
at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:36)
at xsbt.boot.Launch$.launch(Launch.scala:117)
at xsbt.boot.Launch$.apply(Launch.scala:19)
at xsbt.boot.Boot$.runImpl(Boot.scala:44)
at xsbt.boot.Boot$.main(Boot.scala:20)
at xsbt.boot.Boot.main(Boot.scala)
~/.sbt/* ~/.ivy2/* are owned by my user
/opt/local/share/sbt - in which sbt script and sbt-launch.jar resides has 777 permission with this files.
Seems sbt wants to create file somewhere and fails, if you don't know exact solution for this, please advise how can I debug. Is it possible to see some sbt log, or maybe there is some system tool to define where sbt want to create the file.
Thanks in advise.

One cause of this problem might be that you ran sbt as root :). When you did that, sbt created things in your directory (like the target directories) as root, and now they're owned by root. When you re-run sbt as yourself, you can't access those directories anymore.
You now either have to fix all of the directory/file ownerships/permissions, or delete them all. When you re-run sbt from your account, it will re-create those directories/files under your account, and it will work.
If you're working from a git repo, just re-clone the project and re-run sbt as yourself instead of root.

Related

Error install sbt

I tried to install sbt on high sierra,
I have installed the build tool using : "brew install sbt" , after that i tried to run the sbt on "./.brew/Cellar/sbt/1.1.0/bin/sbt
i got that error.
java.io.IOException: Operation not supported
at sun.nio.ch.FileDispatcherImpl.lock0(Native Method)
at sun.nio.ch.FileDispatcherImpl.lock(FileDispatcherImpl.java:90)
at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1115)
at java.nio.channels.FileChannel.tryLock(FileChannel.java:1155)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:88)
at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99)
at xsbt.boot.Using$.withResource(Using.scala:10)
at xsbt.boot.Using$.apply(Using.scala:9)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
at xsbt.boot.Locks$.apply0(Locks.scala:31)
at xsbt.boot.Locks$.apply(Locks.scala:28)
at xsbt.boot.Launch.locked(Launch.scala:238)
at xsbt.boot.Launch.app(Launch.scala:147)
at xsbt.boot.Launch.app(Launch.scala:145)
at xsbt.boot.Launch$.run(Launch.scala:102)
at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
at xsbt.boot.Launch$.launch(Launch.scala:117)
at xsbt.boot.Launch$.apply(Launch.scala:18)
at xsbt.boot.Boot$.runImpl(Boot.scala:41)
at xsbt.boot.Boot$.main(Boot.scala:17)
at xsbt.boot.Boot.main(Boot.scala)
Error during sbt execution: java.io.IOException: Operation not supported
You actually don't need homebrew to install SBT. Download it directly at https://www.scala-sbt.org/download.html, then extract and drop it into your home directory.
With Terminal, update permissions:
chmod -R 700 sbt/bin/sb
Open the Bash Profile.
nano .bash_profile
Add the following line to the end of the file:
export PATH=/Users/username/sbt/bin:$PATH
Username is your user name. For example, export PATH=/Users/john/sbt/bin:$PATH
To test, close and re-open Terminal. Run:
sbt --version
I wrote step-by-step instructions on my blog earlier.

Unable to run meteor from Webstorm

I want to run the meteor application from some IDE so that I can debug the server side code.
For now I have setup the meteor application on the Webstorm. When I try to run the application I get following error message . Really appreciate your help.
/Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173
throw(ex);
^ Error: EACCES, permission denied '/Users/jackal/rschtml5/ageroRSCHTML/.meteor/local/build'
at Object.fs.renameSync (fs.js:548:18)
at Object.files.renameDirAlmostAtomically (/Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/files.js:644:8)
at _.extend.complete (/Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/builder.js:485:11)
at writeSiteArchive (/Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/bundler.js:1836:13)
at /Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/bundler.js:2206:20
at /Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/buildmessage.js:250:13
at _.extend.withValue (/Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/fiber-helpers.js:112:14)
at /Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/buildmessage.js:243:29
at _.extend.withValue (/Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/fiber-helpers.js:112:14)
at /Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/buildmessage.js:241:18
at _.extend.withValue (/Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/fiber-helpers.js:112:14)
at /Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/buildmessage.js:232:23
at _.extend.withValue (/Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/fiber-helpers.js:112:14)
at Object.capture (/Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/buildmessage.js:231:19)
at Object.exports.bundle (/Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/bundler.js:1926:31)
at bundleApp (/Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/run-app.js:509:28)
at _.extend._runOnce (/Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/run-app.js:527:24)
at _.extend._fiber (/Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/run-app.js:744:28)
at /Users/jackal/.meteor/packages/meteor-tool/.1.0.35.mewx50++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/run-app.js:380:12
I'm not sure about my answer for your specific scenario: I had a similar problem and the cause was the npm permissions, I had to run meteor as root: sudo meteor
I see in your paste: Error: EACCES, permission denied '/Users/jackal/rschtml5/ageroRSCHTML/.meteor/local/build' at Object.fs.renameSync
Some permission is wrong. I usually use the terminal in WebStorm, not the built-in build and run. Probably you haven't noticed because you're root. Try to create a new user and run meteor create testProject. I had this issue on my Meteor install.
Edit:
Check if any of these links solves your problems:
https://github.com/oortcloud/meteorite/blob/master/README.md#permission-woes
https://github.com/meteor/meteor/issues/893

Issues running CAMEL JAR file built in windows using Eclipse when run in Linux command line using JAVA or MVN command

I have built a Camel project in Eclipse with Maven dependencies.
It ran successfully and also Built the Jar file and ran it from the command prompt
which is running as required. But when I moved the JAR file onto to our Linux machine
which is like a Job Manager server and when I try to run the JAR file as below
I am getting the below error message.
When I try to run with the below command
$ java –jar mycamelproject
I am getting the below error, but I do have the below mentioned dependency in the Dependency-Jars folder.
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/c
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
at java.lang.Class.getMethod0(Class.java:2774)
at java.lang.Class.getMethod(Class.java:1663)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.springframework.context.support
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more
Then I tried running with the below command.
$ mvn -X exec:java -Dexec.mainClass=mycamelpackage.mycamelmainclass
I am getting a series of the below errors such as below
[DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in local (/home/ec2-user/.m2/repository)
[DEBUG] Skipped remote update check for org.codehaus.mojo/maven-metadata.xml, already updated during this session.
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from
http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): proxy.host.net
[ERROR] No plugin found for prefix 'exec' in the current project
and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo]
available from the repositories
How should java –jar mycamelproject work if no classpath is set? And mycamelproject should be a JAR file anyway (and if it is, you should add the *.jar extension).
Beside that, I guess your local Maven repository may be corrupt. That's usually the reason why you see the resolution will not be reattempted error message. The easiest way to fix this is to remove the corrupt directories and start Maven again.

Workers not starting in Storm (backtype.storm.daemon.worker class not found)

I’m a newbie with Storm and I have setup a Storm-on-Yarn on an HDP cluster using the instructions at the HDP Storm-on-Yarn page and the storm-yarn-master from anfeng's storm-yarn git project.
I’m able to get Nimbus running and even submit topologies and see them on Storm UI. However, the spouts and the bolts don’t seem to be “working” (0 counts of tuples emitted).
I did some digging around and realized that my worker daemons are not starting. The supervisor log spits out these:
2014-03-13 11:22:03 b.s.d.supervisor [INFO] 18bf93a1-1cea-4e99-93da-8f36a4e9c056 still hasn't started
I tried launching the worker command from the “Launching worker with command” line in the supverviser log and I got this error:
Exception in thread "main" java.lang.NoClassDefFoundError: backtype/storm/daemon/worker
Caused by: java.lang.ClassNotFoundException: backtype.storm.daemon.worker
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:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: backtype.storm.daemon.worker. Program will exit.
It looks like it can’t find the worker class although it’s present in the storm-core jar.
Any ideas on how I can proceed with troubleshooting this? I’ve attached the nimbus and the supervisor logs. The worker logs don't seem to have been created.
Nimbus Log - http://paste.ubuntu.com/7089418/
Supervisor Log - http://paste.ubuntu.com/7089422/
Hadoop Version - 2.2
Storm Version - 0.9.0-wip21
I've had an issue like this when the JAR file I was creating did not exclude the storm binaries. i.e. in the pom.xml file, make sure that you have the storm-core dependency set with:
<scope>provided</scope>
As well, I had issues where multiple versions of netty were installed in the storm lib folder (had to delete the old version JAR). This was also causing NoClassDefFoundErrors to be thrown (albeit, different than the one you are experiencing).
I would suggest looking at the classpath that shows up when you submit the topolgies (you can do that by doing ps -Af | grep storm)

Netbeans Project Deployment Error

My Netbeans is just freaking out. 20 minutes ago it worked fine, but now it is not. I did recall all changes but it is not working.
Initializing...
deploy?DEFAULT=C:\Users\TheIntersect\Documents\NetBeansProjects\webWord\build\web&name=webWord&force=true failed on GlassFish Server 3.1
Error occurred during deployment: Exception while preparing the app : Error in generating security policy for webWord -- Error in generating security policy for webWord -- Unable to open Policy file: C:\Users\TheIntersect\.netbeans\7.0\config\GF3\domain1/generated/policy\webWord/webWord\granted.policy. Please see server.log for more details.
C:\Users\TheIntersect\Documents\NetBeansProjects\webWord\nbproject\build-impl.xml:736:
The module has not been deployed.
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:187)
at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:106)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)
Don't think this is still actual, but still may help someone else.
try to manualy copy granted.policy file into glassfish appropriate directory
(PATH_TO_GF\glassfish-3.1\glassfish\domains\<domain_name>\generated\policy\app_name\app_name>\).
If you don't have that file anywhere, just create it with following content
grant {
permission javax.security.jacc.WebResourcePermission "/";
permission javax.security.jacc.WebUserDataPermission "/";
};
I just reainstall the Netbeans IDE and it solverd. But while you are deleting netbeans you should delete all files related about netbeans except project files.

Resources