B4J Question [SOLVED][Server] How I can compile/build HelloWorld example for Synology NAS?

hatzisn

Expert
Licensed User
Longtime User
I googled it and it is multitasking so technically one can run two web apps side by side.

I also found this to start the web app at synology nas boot (don't shoot the messenger - I do not own a synology nas yet but checking around for possible implementations - there might be an easier solution of doing this):

Scroll down to the autostart section:
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
It should be, it is a custom Linux OS

Yes I noticed that with the code in the link in post#21. I wasn't aware of it though when I asked the question.
 
Upvote 0

Elric

Well-Known Member
Licensed User

Make sure that you has already installed Java8.

In your folder "/volume1/web/webapp/HelloWorld" you have to copy both "WebAppHelloWorld.jar" and the "www" folder from your project in B4J.

Then you have to make it running on NAS: go in "Panel Control -> Task Scheduler" -> click on "Create" button -> "Triggered Task -> User-defined script" or "Scheduled Task > User-defined script" (depends on your necessity: try with "Triggered Task" at "Boot-up", user "root"). Remember to select "Enable".

Put the code with your path:
B4X:
cd /volume1/web/webapp/HelloWorld
nohup /var/packages/Java8/target/j2sdk-image/bin/java -jar /volume1/web/webapp/HelloWorld/WebAppHelloWorld.jar > /volume1/web/webapp/HelloWorld/nohup.out
don't forget the first line!

Click on "Run" button or restart the NAS.

I think that you should manage more than one task and server but not on the same port.
 
Upvote 0

Dadaista

Active Member
Licensed User
Longtime User
You must copy the entire www folder as it is in B4j objects folder.

In your folder "/volume1/web/webapp/HelloWorld" you have to copy both "WebAppHelloWorld.jar" and the "www" folder from your project in B4J.

Did it

Make sure that you has already installed Java8.
Sure!

don't forget the first line!
added!

Click on "Run" button or restart the NAS.

I think that you should manage more than one task and server but not on the same port.

That is not working for me. Well, never mind. I keep trying in the future

Thx!!!!
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Connect to the NAS with SSH and try the commands in the command line to see what’s happening before adding the line to the NAS script
 
Upvote 0

Dadaista

Active Member
Licensed User
Longtime User
Connect to the NAS with SSH and try the commands in the command line to see what’s happening before adding the line to the NAS script
0K.. I am going to try right now

EDIT:
Putty says: "-sh: /volume1/web/webapp/HelloWorld/nohup.out: No such file or directory"
No idea what is happening

EDIT2: (problems with uppercase)
Putty says: "nohup: ignoring input and redirecting stderr to stdout"
nohup.out says: "Error: Unable to access jarfile volume1/web/webapp/helloworld/WebAppHelloWorld.jar"
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…