Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when trying to compile code #40

Open
ishagadekar opened this issue Jul 24, 2017 · 9 comments
Open

Issue when trying to compile code #40

ishagadekar opened this issue Jul 24, 2017 · 9 comments

Comments

@ishagadekar
Copy link

Hi,

I am trying to run the code on my local machine and I am getting the below error:

[error] C:\amiunique\website\app\controllers\FPController.java:346: non-static method generateToken() cannot be referenced from a static context
[error] Crypto.generateToken
[error] C:\amiunique\website\app\controllers\FPController.java:347: non-static method encryptAES(java.lang.String) cannot be referenced from a static context
[error] Crypto.encryptAES
[error] C:\amiunique\website\app\controllers\StatsController.java:28: non-static method decryptAES(java.lang.String) cannot be referenced from a static context
[error] Crypto.decryptAES

Please let me know what could be the issue.

Thanks in Advance!

@plaperdr
Copy link
Contributor

Hi! Thanks for your interest in AmIUnique!
Can you give me the version of Java and Play you are using? It could help me sort this out.

@ishagadekar
Copy link
Author

I am using Java 8 and Play 2.4.6.

@SyBen
Copy link

SyBen commented Jul 28, 2017

Starting with Play 2.4.x, Crypto methods stopped being static. Try with play 2.3.x

@ishagadekar
Copy link
Author

I tried with Play 2.3. It worked. Thanks!

@ishagadekar
Copy link
Author

Also, in the table "fpdata", for the "id" column, I get value "Not Supported". Can you tell me what does that mean?
Thanks.

@plaperdr
Copy link
Contributor

Thanks a lot @SyBen for finding out the cause of the problem! The site will probably go through a small refresh this year so we may upgrade to a more recent version of Play and this will change.

@ishagadekar The id value comes from the cookie we setup in the browser. If you get "Not Supported", it is either because cookies are blocked or the path may not be correct (i.e. if you run the site locally on your machine, it may not work).

@ishagadekar
Copy link
Author

@plaperdr Cookies are not blocked on my system and even if other person hits the website from their system, it gives "Not Supported" value. Can you tell me where are the paths configured? Also, what is the purpose of "id" vs "addressHttp" fields?
Thanks.

@plaperdr
Copy link
Contributor

The main path for cookies is defined on this line HERE. You can see that "amiunique.org" is directly in the code. The last two boolean values are to only allow the cookie to be used in the context of a secure connection (HTTPS) and to be delivered only through HTTP (no possibility to access it through JavaScript). If you want to use it on your own, I recommend setting at least the second-to-last boolean value (HTTPS one) to "false".
The difference between "id" and "addressHttp" is simple. The "id" column is for the cookie value, the "addressHttp" is an hashed version of the IP address.

@ishagadekar
Copy link
Author

Okay. I will try doing that. Thank You!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants