Posted By : Date : fanuzzi | 02-13-2021
If you are reading this post then, probably, you need to execute your java app as a Linux service. This can be done in 4 really easy steps Create the servicecreate a bash scriptgive execution permission to the bash fileenable and start your brand new service Step 1: create the system service sudo nano /etc/systemd/system/MyFantasticJavaApp.service it will open the nano editor. Add the following, changing the working directory and the User values based on your convenience [Unit] Description=good old Java application [Service] User=root # The configuration file application.properties should be…
Read More
0 Comments
Posted By : Date : fanuzzi | 05-28-2019
right click --> Source --> generate toString() --> Generated code fieldset --> Edit button --> New.. button --> give a name (ex. JSON) --> copy and paste this pattern: {"${member.name()}":"${member.value}", "${otherMembers}"} That's it. Hope this help!
Read More
1 Comments
Exceptions in the life: Checked vs Unchecked problems
Posted By : Date : fanuzzi | 01-26-2019
In Java, as well as in your life, there two type of exception: checked exception that are the expected problemsunchecked exception, that are the unexpected problems. As in the life, for the expected events you are prepared because you plain to have that problem. So you are organized to intercept and block that problem. For example, if you are a student, or you have been a student, you know that your teacher could exam you. To avoid a negative vote, or problem with you parents , you (theoretically) study. If…
Read More
0 Comments
Posted By : Date : fanuzzi | 01-16-2019
What is a domain? A domain, in weblogic world, is a set of weblogic (WL) instances that can be managed by the same administration console. That's why they are call managed servers. Each WL instance can run on the same machine of the administration server or remotely What is a weblogic instance? It is just an ip and port address where the single weblogic listen Why to use (or at least to be aware) If you have different weblogic servers that you need to manage (remotely for example) you can…
Read More
0 Comments
Posted By : Date : fanuzzi | 01-16-2019
To debug with eclipse to remote server follow below instructions In the menu Run --> Debug configurations… In the window popup select Remote Java Application Right click, then select New On the right a new fieldset appears In the Project field browse the java project to attach In the Connection Type field: Select "Standard (Socket Attach)" - int the 99% of cases -, if you want to attach your eclipse to a server (which listen on a ip and port). In this case you should specify the IP/name and the…
Read More
0 Comments
Posted By : Date : fanuzzi | 01-16-2019
The label in Java (from version 7) is a way of giving a logic name to a loop statement. Why naming a statement in Java? Just because in case, of very deeper loops, you want to break/continue that specific statement. How to give a name to a statement?Specifying a name (as a class style) followed by ":" How can you break using label? Simple, with break and continue followed by the label name. That's it. Example Task: { (loop statement){ if (condition){ break Task; } } } In the above…
Read More
0 Comments