I tried to run the java version of Nachos on Windows 7 and Redhat Linux, but both failed due to RuntimePermission problem as below.
user\nachos\proj1> java nachos.machine.Machine nachos.conf
nachos 5.0j initializing... config interrupt timer user-check
Lacked permission: (java.lang.RuntimePermission createClassLoader)
Exception in thread "main" nachos.machine.AssertionFailureError
at nachos.machine.Lib.assertTrue(Lib.java:77)
at nachos.machine.Lib.assertNotReached(Lib.java:96)
at nachos.machine.Lib.checkMethod(Lib.java:565)
at nachos.machine.Machine.checkUserClasses(Machine.java:262)
at nachos.machine.Machine.main(Machine.java:57)
Searching on Google using keywords RuntimePermission and createClassLoader, found some solutions that need to modify the file: $(JAVA HOME)\jre\lib\security\java.policy. So I appended following lines to it.
grant {
permission java.security.AllPermission;
};
However, it still can't work. Can anyone provide any clues on this problem? Thanks.
Related
I have installed NiFi but when I try to start it from the command line, with bin\run-nifi.bat, I get the following error:
Error: Could not find or load main class org.apache.nifi.bootstrap.RunNiFi
I have:
Windows 10 SO 19042.867
Java 8 1.8.0_291-b10
I tried doing it from administrator but it still doesn't work.... can anyone help me?
Thankyou!
SOLVED the exact same problem by granting permissions (full control) to Users and Authenticated Users; I assume only one of these groups was necessary but shotgunned it, and it now runs correctly
I recently upgraded my MacOSX system to Catalina and several files were placed automatically into "Relocated items" folder on my Desktop. I recently tried to run the following code which had previously worked:
qualimap bamqc -bam Sample1_sorted.bam -c -outdir QualiMap/Sample1_sorted
and received the following error:
Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Error: Unable to initialize main class org.bioinfo.ngs.qc.qualimap.main.NgsSmartMain
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
I have seen many other posts related to this error but am unsure how to even go about trying some of the suggested solutions. I do not work directly with some of the applications/files mentioned in these forums, such as JAVA, Maven, AppAssembler, and the pom.xml file (I could not even find that file). As a result, I wished to ask about this error from the perspective of a biologist using qualimap.
How can I fix this error (with little knowledge of the above applications/files)? I can certainly work with these applications/files, but I would probably need more detailed/basic/low-level advice on how to access and modify them. Thank you!
It seems what qualimap is a java application someone else wrote. I would raise a ticket with whomever wrote this app.
When starting for example Elasticsearch 5.5 :
main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
Workaround with Oracle Java 1.8.0_131 is to open file <jre>/lib/security/java.policy and add this line to grant section (i.e. between curly brackets):
permission javax.management.MBeanTrustPermission "register";
Why workaround? The upright solution would be to specify extra grant section which code exactly should get this permission.
got the same error and the answer is here java.security.AccessControlException when using Ant, but runs ok when invoking java from console
Append the grant section in java.policy file with
permission javax.management.MBeanTrustPermission "register";
I had this same issue when moving from a single instance to two instances locally.
I tried what Alice suggested above. Even re-installed Elasticsearch (5.5.0).
I also updated my Java to the latest one for Linux provided by Oracle.
Nothing was working. Then I discovered, that I couldn't just take the elasticsearch-5.5.0/config directory and rename it to elasticsearch-5.5.0/node1.
So... I had to leave that config directory in place and clone it to node1/node2.
EVEN if I configure path.config in the runtime args, ES still needs that base line config directory.
Hope this helps.
I faced same issue on Ubuntu-16.04 system.
Solution:
ElasticSeearch service is not allowed to run for "ROOT" user. That's why change the ownership of elasticsearch folder with below command:
go to Elasticseach installation directory
$ sudo chown -R user_name:user_Group elasticsearch-5.5.0
$/bin/elasticsearch
this will start elasticsearch service. It is working form me perfectly.
When running the Java quickstart sample at https://developers.google.com/drive/web/quickstart/java?hl=hu in NetBeans, I'm receiving the error code:
Jun 04, 2015 12:12:11 AM com.google.api.client.util.store.FileDataStoreFactory setPermissionsToOwnerOnly
WARNING: unable to change permissions for everybody:
C:\Users\Quibbles\credentials\drive-api-quickstart
What am I doing wrong?
Edit: This is the complete error message.
Jun 04, 2015 5:11:39 PM com.google.api.client.util.store.FileDataStoreFactory setPermissionsToOwnerOnly
WARNING: unable to change permissions for owner: C:\Users\Quibbles\.credentials\drive-api-quickstart
Exception in thread "main" java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:78)
at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
at DriveQuickstart.authorize(DriveQuickstart.java:64)
at DriveQuickstart.getDriveService(DriveQuickstart.java:87)
at DriveQuickstart.main(DriveQuickstart.java:96)
Java Result: 1
Had the same issue and wasted hours before realizing that "unable to change permissions for owner: C:\Users\Quibbles.credentials\drive-api-quickstart"
is just a warning.
The real issue is the null pointer here.
InputStream in =
DriveQuickstart.class.getResourceAsStream("/client_secret.json");
This line was the issue in my case. "in" was null and hence the null pointer.
InputStream in = new FileInputStream("<Full Path>\\client_secret.json");
This resolved my issue.
The actual problem is a bug in Google's API code for setPermissionsToOwnerOnly
The code was written to only work on Linux/Unix based systems and not Windows ACL based systems.
You can ignore the warning or write your own DataStore class that sets the permissions correctly for Windows.
I'm going to try to file a bug with Google on it too.
I was facing same issue in Eclipse. Here’s a solution:
Run eclipse in admin mode
Clear the directory
C:/Users/<username>.credentials/calendar-java-quickstart.json
Copy the .json file the bin directory, e.g. bin/main/resources/client_secret.json
You are free to run now.
Basically if you already enabled de Drive API and created credentials.json file at Google Drive API Rest, now you need :
1 - Remove the tokens directory generated in you last execution. In this directory contains a file StoredCredential.
2 - Change de SCOPE to DriveScopes.DRIVE like sample bellow:
private static List SCOPES = Collections.singletonList(DriveScopes.DRIVE);
3 - Re run the program. It will be request that you login in your google account to give the access consent.
4 - It will be generated a new one tokens directory in your project and now with with read and write permissions at google Drive.
This work for me.
I just ran into the same issue with the https://developers.google.com/google-apps/calendar/quickstart/java example. I suspect that the issue is that you are running it in Windows and the JVM that you are running it does not have Adminsitrator rights for changing the file permissions in Windows.
See Run Java application as administrator on Windows
Had the same problem when running the example given in the tutorial "https://developers.google.com/drive/v2/web/quickstart/java". Followed the instruction ditto as given the in the tutorial, but kept getting this permission exception. Eventually, managed to sort it out by moving the "client_secret.json" to the "\build\classes\main\classes" folder. Also, before building the project with "gradle -q run" for the first time, delete any files in the "C:\Users\userName\.credentials" folder.
Just make sure that client_secret.json is under main/resources/ directory.
InputStream in =
DriveQuickstart.class.getResourceAsStream("/json/client_secret.json");
Was able to resolve the issue by deleting the StoredCredentials files under the token folder. I had to reauthenticate again with google the next time the program was executed.
I am reading the tutorial on java security by oracle.
(http://download.oracle.com/javase/tutorial/security/toolsign/rstep4.html)
I duplicate all the files and everything from the tutorial basically.
I am able to run the file with security manager using the following approach in unix:
java -Djava.security.manager -Djava.security.policy=recvPolicy -cp sCount.jar Count ../../test
But when I try to specify a new policy.url in the java.security file like this:
policy.url.1=file:${java.home}/lib/security/java.policy
policy.url.2=file:${user.home}/.java.policy
policy.url.3=file:/home/myhome/SigningTest/recvPolicy
it gives me an exception when I run:
java -Djava.security.manager -cp sCount.jar Count ../../test
The exception is this:
Exception in thread "main" java.security.AccessControlException: access denied (java.io.FilePermission ../../test read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
at java.io.FileInputStream.<init>(FileInputStream.java:100)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at Count.main(Count.java:17)
thanks for feedback
Okay, I did a quick test of this and it works for me. So the only thing that could be causing this problem (my guess) is that you have two jdks installed on your unix box. So make sure that the "java" that you are using for the command line execution is the same version whose java.security you have modified.
The default sun java 6 security file (if you are using ubuntu) is located at:
/etc/java-6-sun/security/java.security
So make sure you are editing the correct version of java.security