Struts 2 FileUpload in EC2 Glassfish 3 deployed not working - file-upload

I have spent numerous hours searching for a solution to this, not sure where else to turn. Our main app is deployed on amazon EC2, GlassFish 3.1. One of our pages handles file uploads. It works fine on my local development box, and on several other local deployments and other developer boxes. I've done a number of different logging options, and every time on local boxes the changed logging options appear correctly.
The problem is, no matter what I've tried, in amazon EC2, the file when uploaded never shows up in the various temporary paths I've tried (including changing all permissions to the path and parent paths to 777.. bad.. I know but trying anything to get this to work), the file always shows empty, and the logging indicates no errors. I've modified the file types allowed, the max file size supported, to no avail.
At this point, I am thinking it has something to do with EC2, since it works in several other deployments in different networks (team in India, local box, etc). I can't find anything in the EC2 console that sheds any light on any changes needed to permit a file upload. Heck, I can scp the .war file up to the instance and deploy it just fine, so I can't imagine anything would block file uploads from the web app itself from a browser.
Any help at all is much appreciated as this is unfortunately the only thing holding up our initial alpha release.
Thank you.

Related

NW.js app can't connect to specific web domain and that happens only on one single laptop

After thinking about this for 2 weeks, I have to ask this question.
I've created a NW.js app that works smoothly and nice on 7 different laptops and PCs. The app shows html videos and contains a bunch of javascripts, I've got deloped since 2 years. Alls this works fine on every laptop/PC.
Here comes the problem:
On one laptop the app works, too, but the app isn't able neither to show HTML frame contents nor to execute js scripts from a specific web domain. This only occurs with a specific domain (that I'm the owner of).
The strange thing is, that this happens only on one laptop.
The laptop uses the same internet connection as some other devices. I reinstalled the app, deleted all subfolders from the app folder, but the error is back. In the frame I see the silly message, that the website is down or moved.
You likely have a system-wide proxy configured or possibly some AV software installed on that laptop is blocking that site. Attempt to access the same URL through another browser (Chrome, Edge, Firefox, etc.) to confirm.
Could be related to your hosts file.
C:\Windows\System32\drivers\etc\hosts
That is a plain text file without an extension. You can put URL's or IP addresses in it and it will block any access to them globally on the computer.
Though Sysrage is probably right, it's more likely that you just have some AV/firewall/security software blocking stuff it shouldn't (happens all the time, they can be "over protective" sometimes)
If it is something related to your NW.js install, and it isn't happening on other machines (so you know your app code is correct), then you could try deleting the app data folder for you app. To find it's location on the computer run console.log(nw.App.dataPath). It should be something like:
C:\Users\YOUR USER NAME\AppData\Local\YOUR APP NAME
You can just delete the whole folder (make sure your app isn't running first). Then the next time you open your app it will recreate that folder (it's a chromium thing). Things like saved passwords or dev tool customization or spellcheck dictionary modifications are stored in there. So maybe there's just something funky that needs cleared out.

Moving Images between Pirhana Websites

When uploading images on my local development environment, and uploading the contents of the Uploads and Content Folders up to the live environment the images do not show even after updating the application pool - do you know what step i am missing. I am using Piranha in passive mode?
Well without any further information it's hard to come up with something that will qualify as an answer :) However, if you have copied both the database and the binary files located in ~/App_Data/Content/ my guess would be that Windows is playing a prank on you and that the IIS pool of the live environment either:
Doesn't have permission to access the App_Data/Content folder, or
That permissions from your dev server have been copied to the live server so that the IIS app pool doesn't have permission to the copied files.
Regards
HÃ¥kan

wkhtmltopdf hangs on 10% and does not generate PDF

I'm using WKHtmlToPdf to generate some docs here at work, in internal applications, for over one and half year without any problem. Some applications are coded in C++, some in AutoIt3, and today, after restarting all the computers due to external reasons (power generator would be tested), wkhtmltopdf stopped working on all machines at my company.
I can't even run it from command line. Whether I try to convert a webpage or a local HTML file, it always hangs on 10%. All our machines are Windows 8 32 bits and runs their own install (the applications aren't running under a network share).
I tried downloading wkhtmltopdf again from the website, installing it, etc, but nothing worked. I also tried adding --disable-javascript option, which also didn't work. Cleaning %TEMP% folder did not help too.
I never faced anything like this. All the machines were restarted normally, going to start menu, etc. And it does not look like a network issue, since I'm accessing internet to write this, and we are a small company, we use a standard Wi-Fi router, just like your house. Nothing was changed, no file deleted, no Windows update, no network settings... just a restart. I saw some guys facing the same problem when trying to run wkhtmltopdf from PHP, but in this case, I have this problem even by running it from DOS, as anyone would do.
wkhtmltoimage is working fine. Just wkhtmltopdf stopped working.
Screenshot
In my case, wkhtmltopdf was hanging on files locally stored after the progress counter had made an initial jump to the percentage corresponding to 1 page. It turned out that I had an http_proxy variable set to some unaccessible proxy server. Clearing this environment variable solved the issue.

How to bypass red5 demo page on start up?

At present, I start up red5 in linux command line ./red5.sh and it runs the script. Then I go to http://localhost:5080 demos page to set up my camera and audio input and all works fine in testing the stream both on demo page and in swf of my webpage.
Question is, do I need to include some java and/or action script for the swf player to
bypass the red5 demo page so I can directly connect my input and stream in the code of the page? Also so only logged in webpage viewers can connect?
Overall wondering if there is a way of hiding the server stream from anyone not logged in to view it on my site? I understand in webapps folder somewhere there is the hosts list of IP but it would be impossible to know the IP of the viewers as opposed to unwanted viewers or bandwidth stealers.
I am trying to set up a site for poetry readings and make it so readers can record live to my server and then logged in viewers can view from my website. I am trying to figure out whether I must have that red5 page open and if that doesn't pose some kind of risk.
Found my own way of doing this just by removing and renaming files and folders.
If you go to usr/local/red5/webapps here lies all the directories for viewing when you go to default port 5080 so I simply installed the applications I needed and then took everything out of there except those applications I wanted and needed to run. I took out all and placed it in a folder in /var directory named it red5_movedstuff in case I want access to further applications later on.Then I renamed the applications I am using in webapps folder and kept admin folder to access them but I renamed my applications and had to importantly rename also in WEB-INF for each application name change.
Now if someone goes to myip:5080 they get a blank page and by changing names of applications I've hidden my directories beyond that including list of streams.

Issue in hosting a webapplication in a local machine

I have developed a webapplication in my local machine. the application is hosted on tomcat 7.0.22 server. the application is accessed using http://localhost:8080/app
When i use this in my localmachine, I am not facing any problems. But when I intend to share the link with my fellow team mates using the links http://myipaddress:8080/app, I am getting Javascript errors. I placed the js files in the build path of the application.
Even i have noticed the tables width are changed in the same browser
I am unable to find the problem. Can any one help
Thanks,
Vamsi
When testing on your own machine, use your own IP instead of "localhost" and should be able to compare apples with apples and avoid confusing cause and effect.
I would say to check the configuration of your host or vhost files, but if all included JS files are on the same host, that is unlikely to be the problem.
My guess is that you hard coded a path somewhere or that the problem is related to some other difference between testing from your machine and their machine (different browser, versions, plugins, etc) and not actually related at all to the domain. Could possibly also be a file permission problem (but that is a wild guess).