Play Framework Configuration - java

I am developing a project using the Play framework. Yesterday, 'something' happened and my Play.Configuration object is null after initialisation. I have tried retracing my steps but I am unable to locate the change that I have made that has resulted in the error!
Although Google is usually my friend, I have not been able to find much information on this problem. Does anyone know where I can / should start looking to try to resolve this?

Thanks to Morten Kjetland, who provided this answer on the play-framework google group, I have found the reason for the error was as follows:
It looks like you run the test
directly in IntelliJ.
When you do it like this, Play it self
is not running - nor is it
initialized.
When running tests that use Play
features like that you have to run
them in play:
"play test" and goto
http://localhost:9000/#tests
or "play auto-test"
-Morten
Embarrassingly I did know about #tests url, but I was a little naiive and thought that if I had the Play running then intelliJ would somehow magically find that instance of Play (not sure why I thought that) and conduct the tests accordingly.
Anyway - I hope my mistake will help someone else in the future - and thanks again to the helpful people on stack overflow and particularly the play-framework google group!

Related

Downloading libGDX setup

I've recently come across libGDX for java game development and wanted to give it a try. Every tutorial i've looked up showed that i have to download the setup.jar from https://libgdx.badlogicgames.com. The problem i'm having is that upon visiting this site, i always get redirected to https://libgdx.com, where all i can find are features, a doc, news... and a git repo with code.
Can someone explain to me how i can still download the setup app. Or do i have to run the code from git? Maybe this is a completely stupid question and i'm missing something really obvious but currently i'm completely lost.
It looks like the Website of the libGdx Developers has changed.
I researched a bit and found out that they provide you useful tools for programming with libgdx.
The tool list contains the Setup Tool.
You can find a list of the tools here:
https://libgdx.com/dev/tools/
However I have had ungreat experiences with the tool.
If the tool installation does not work properly. I would recommend you to try to install it manually.
You can find informations about the Manual installation here:
https://libgdx.com/dev/project-generation/

Trouble installing the Android SDK on Windows 10 through cmd

I am having trouble installing the Android SDK on Windows 10. I am following a brazilian course on app development using react-native on android. This is a documentation page explaining how to create the development enviroment to do so: https://docs.rocketseat.dev/ambiente-react-native/android/windows (use google translate on the website to see the english version). However, on the part where they execute the following command :
$ C:\Android\Sdk\tools\bin\sdkmanager "platform-tools" "platforms;android-27" "build-tools;27.0.3"
the console returns:
Error: Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
Caused by: java.lang.ClassNotFoundException: com.android.sdklib.tool.sdkmanager.SdkManagerCli
I have searched an entire day for a solution and discovered that, to my sorrowing dissapointment, this is a incredibly generic error when working with java in general. So I tried a plethra of things to no avail.
Reinstalling java(64-bit version)
Reinstalling jdk
Checking and rechecking what could possibly be wrong with the enviroment variables(I found no problems)
Searching through a dozen tutorials on how to install de Sdk via cmd.
Trying to get the Sdk on my machine through Android Studio(but couldnt use any of the Sdk commands necessary for the tutorial)
Some other stuff(I spent an entire day trying to fix this)
TLDR: I know this question has been posted in some form or regard before, I've read through all of them though, and none of them helped me.
If anyone has any idea of what I'm dealing with here, or has gone through this before, I would very much appreciate any advice that can be given. This problem has been drilling on me for a while now and I would really like to move on from it. I'm willing to provide any details on my current configuration but must of it you can find on the tutorial I linked earlier. Thank you for your attention.
It turns out there really are a billion reasons as to why this happens, and in my experience with stack, I don't think this will be answered anytime soon. So for future reference I will be giving some advice to anyone who ends up stumbling onto this problem.
Dual-boot your machine with Linux. I know this sounds like a non solution but it really is the only feasible solution. I spent an entire week trying to solve a problem that really wasn't worth solving. There are a ton of tutorials on how to do it. It took me less than 30 minutes to set up the whole thing and voilá, everything worked as a charm. Don't waste your time trying to make stuff like this work on Windows, especially since Java is involved.
The tutorial I used: https://docs.rocketseat.dev/dual-boot-windows-linux/introducao
PS: The tutorial is in Portuguese but Google Translate works pretty much perfectly on the page, so there should be no issues.

I'm not sure if this is a java issue or a web3 issue (just need some direction)

I'm having a really stupid issue and I'm not sure if I'm an idiot or not remembering java correctly or what. I apologize in advance if this is a super dumb question.
Main issue: I'm trying to use web3j with java and I can't figure out how
Background:
1) I know JAVA (I've developed android apps in android studio) but not netbeans. Though I haven't touched java in forever.
2) I am familiar with building and interacting with ethereum contracts from the command line.
Detailed issue:
I need to connect to an ethereum contract through java, so I googled around for a while and found web3j. However... I can't figure out how to actually use/install/require it. There's a sample project, but I'm not sure how to import that to netbeans. And when I google "connect to ethereum with java" or something along those lines all the articles gloss over the web3j part and just assume it's already setup.
I guess the main question is, how do I add this library to my java project in netbeans?
this is relatively vague I know, but it's because I haven't actually been able to make any meaningful progress to say "this is what I've tried." mostly it's been research and I've not found anything that says anything about how to setup web3j other than command-line tools. which I already know how to use.
resource: https://github.com/web3j/web3j
Thanks in advance for any direction you can give me. I feel like maybe I need to redo a java primer, but I'm not sure if that's actually the issue (my possibly lapsed memory where java is concerned).
In Netbeans, create a new "Maven Java Project".
In the file pom.xml, simply add the following code. This will make the "include"
<dependency>
<groupId>org.web3j</groupId>
<artifactId>core</artifactId>
<version>3.2.0</version>
</dependency>

What are the steps to upload a java web application

After a lot of work i manage to finish a java web aplication with netbeans using primefaces/glassfish server (it is a e-shop that we developed for a school project). I use xampp (mySql) in order to fiddle around with a database that i use in the web app.
My problem is that i have no idea on how to upload this to a server. What am i supposed to install on it ?, i dont even know what os to use :/ . Im really bad at the "internet part" of this project and since this was my last school year i can not reach for my professor to ask him for help.
I know my question is vague but please help me to finish this project because it would help me a lot to find a job in the future.
I should also mention that i use a mysql-connector-java-5.1.38-bin.jar .If im not wrong this allows me to send data throw a TCP connection right? My main problem is that im missing the Full picture ,I know how to write basic code in java , i know how to build the xhtml pages and how to bind them to the java code behind but other than that i dont get how the rest of this works.
Any help is greatly appreciated.
Edit: as i said im bad at this. if you just post a generic link on "how to set up a Javaweb" i will not be able to follow . Im asking here ,on this forum because i want human answer. I need someone to post a 4-5 line explanation and like 8 bulletins on what to do like
*install linux
*Build and export your project.
*install glassfish standalone.
etc
The thinks google returns to me are like 400 pages of glassfish documentation and really hard to follow guides on how to do what i want. Of course i could waste the next month or so just reading and trying to figure out how everything comes together (witch i inevitably have to do)but i feel like im only 15 clicks away. I just want a practical answer.
You need an application server to "upload" the code. Use tomcat, its simple and has plenty of documentation available.
If you are using XAMPP, you may be familiar with Apache Server, which runs , among other things PHP. For Java, you need application server to run the server side code.
It doesnt matter which OS you want to use, Java runs on all. You just need to download and install tomcat for the OS you want to run it on.
Please refer to http://tomcat.apache.org/
I must point out that there are many more Application servers which are available. Tomcat is one of the most popular for learning purpose.

Problems with jface and RAP

I'm developing a view for an application I'm working on, and I'm using jface with RAP. I thought it wouldn't be difficult but I'm not really making any progresses. I have a sketch of what I need to do, but I can't even start the application. Google doesn't help that much :/
Any tip to help me get started?
I tried developing a minimal working example, but it simply doesn't work. Anytime I start the application, I got this error:
java.lang.IllegalStateException: No context available outside of the
request processing.
I'm pretty sure this is a noob error, but I can't fix this! Any idea on what I might be doing wrong?
The following should be a comment! But I have not enough reps.
There is too little information from you to reproduce the issue but I assume you are mixing up setup options provided by RAP. Read the Building Applications part in the Developer's Guide completely. An outstanding well worked out tutorial can be found here which might help you to understand the differences. Try to create your project with all three setup options (1 RAP with OSGi, 2 RAP with Workbench, 3 RWT Standalone).
Just guessing: In the FAQ is a quite similar error description which might help. No context available outside of the request service lifecycle.

Categories

Resources