How does streamFilesToServer works ?

Questions, tips and tricks and techniques for scripting in Servoy

Re: How does streamFilesToServer works ?

Postby Harjo » Thu Jan 20, 2011 10:59 pm

I have the file plugin working in my localhost (servoy-admin) and see under server plugins, and emtpy line where I can fill in the path.
I have zipped my plugins & beans & libs folder and deployed them to my prod server. (they where already signed by the signtester)

Now when I start the server, I get this error in the log:
Schermafbeelding 2011-01-20 om 21.46.06.png
Schermafbeelding 2011-01-20 om 21.46.06.png (36.06 KiB) Viewed 3397 times


and I don't see the plugin under server plugins in de servoy-admin page.!
Also no entry is found, in the servoy.properties file.

I have checked, and there is a folder: ...ROOT/uploads.
I have started the application_server as a system service, and all system users has full read-write access to that folder.

I'm using 5.2.4..
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: How does streamFilesToServer works ?

Postby jcompagner » Thu Jan 20, 2011 11:11 pm

what is exactly the user dir when you start as a server (so the start up dir)

if you start the server by hand in the application_server dir does it then work?

But in the end the file plugin should just show those errors in the log but not bomb out...
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: How does streamFilesToServer works ?

Postby ptalbot » Fri Jan 21, 2011 12:21 am

Not sure why it cannot resolve the upload directory, if the "servoy.FileServerService.defaultFolder" is null or empty (you can always set it yourself in the servoy.properties file), the plugin will try looking for the ROOT/uploads from the place where it was started, which could be the bat or sh file if you launch it from the command line, or the inside of the Servoy.app bundle on Mac OS X when you launch from Developer, or the user home (the user being the one who launched Servoy) if all else fail... In the case if your error, none of these tries worked and we ended up with a null default folder... Being launched as a service, I'm guess it first tried at the wrong place so I will have a look at that, but even so, it should at least find the home folder...

In any case, I agree that it shouldn't bomb out and I will try to reproduce in service mode to get a better idea of where it starts and hopefully look at the right place.
But if it cannot resolve an upload directory in the end, none of the streaming functions will work, so I can trap that exception and output an ERROR in the log, although it is the subsequent calls to any streaming function which will bomb out.
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: How does streamFilesToServer works ?

Postby ptalbot » Fri Jan 21, 2011 5:55 am

I have found a fix for this: the plugin is now also searching for ROOT from the /service sub-folder (which is the 'home' dir path when launched from a service).
Have also caught the exception so that the plugin outputs an ERROR in the log but still loads and allow for setting the default upload folder.

Of course if this exception is found in the log, the plugin's streaming functionality won't be available, but the rest of the plugin will still work reliably.
So it will be up to you to give it a path to a default upload folder. The property will show in the admin.
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: How does streamFilesToServer works ?

Postby Harjo » Fri Jan 21, 2011 9:36 am

Thanks Patrick!!
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: How does streamFilesToServer works ?

Postby ptalbot » Mon Jan 24, 2011 7:31 am

Patch submitted (and committed https://www.servoyforge.net/projects/servoy/repository/revisions/2185)
Another patch followed allowing streaming byte[] to the server.
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Previous

Return to Methods

Who is online

Users browsing this forum: No registered users and 10 guests