We develop an application which uploads some CSV file.
In order to be sure about our code, the upload has been tested with 2 differents framework : ZK (which manages upload itself) and with classic jsp/Spring REST.
On our local server (windows, tomcat 5.5) all is ok.
On client system (Unix Solaris 10, tomcat 5.5) we have a pb : the first time the file is correctly uploaded, the second time if we change something in data (even if we delete the file) we have the same file as first upload....
It seems a cache or something else disturb the upload.
Any idea ?
Thank you.
[Edit] Additional information
For information, we are on Citrix Metaframe Program Neighborhood (a old version -> v9.0).
For those present at the customer (with or without Citrix), CSV file are uploaded correctly each time.
For us, who are outside, that's not working.
File A is uploaded, then we modified it (A') then uploaded again...and the result is : file A is deleted (as expected, by programmation) then a new file appear which is the same as A (not A' as expected).
If we stop Tomcat or even make others http request, the upload works correctly.
We test upload with 2 differents framework : ZK (which manage the upload itself) and Spring MVC (REST). Both are working on our servers with same Tomcat (5.5).
Other thing strange, we have access to an another server (by VPN not Citrix) where we deployed the application on a Tomcat 7 (already installed by the client). All is OK.
Is it possible that is an hardware problem? with a router...
First of all, it is very difficult to understand your question. With what I understood, you are not able to load any file the second time as the details of the first file are still present in memory/variables. Post your code so that it will be easy.
Try these
Start the application, load a file, say A.csv, first time, then stop
the application
Start the application again, and load another file B.csv and see if it is loaded correctly.
If steps 1 and 2 work correctly, you can be sure that no one has hard-coded anything in the code.
Now, go through your code and see if you have any static variables, being set with the contents of the file.
If removing static variables doesn't work, try printing all the variables and narrow down the issue.
Good luck!
Related
I have an application running in Tomcat 6.0.36. There was a requirement to implement CMS (content management) in our application. For this, a third party vendor is signed up to provide the static content. The CMS pages are written in PHP and hence it became necessary for us to render the PHP content using tomcat server.
To achieve this, I downloaded the “JavaBridgeTemplate621.war” (from http://sourceforge.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_6.2.1/JavaBridgeTemplate621.war/download) and deployed it in the webapps folder. Later I renamed the exploded folder and renamed it to ‘cms’ (deleted the JavaBridgeTemplate621.war file this time). The PHP files placed in this ‘webapps/cms’ folder is rendered properly by the tomcat server. This was the exact requirement.
While starting the tomcat server, the PHP-Java bridge also created a few Java processes. On the LIVE environment, these processes were killed 3-4 days after the deployment(restart) happened.
The error in the catalina log is,
PHP application terminated unexpectedly, have you started php-cgi with the environment setting PHP_FCGI_MAX_REQUESTS=5000? Error: php.java.bridge.http.FCGIConnectionException
php.java.bridge.http.FCGIConnectionException
at php.java.bridge.http.FCGIConnectionOutputStream.flush(FCGIConnectionOutputStream.java:87)
at php.java.bridge.http.FCGIConnectionOutputStream.close(FCGIConnectionOutputStream.java:71)
at php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:357)
Can someone help me understand the root cause of this issue?
The ‘memory_limit’ variable is seen to have the value 64M. Is it too low a value ? If so, what would be an ideal value that needs to be set ?
How will the setting ‘expose_php=off’ affect ?
I have a program that I've created that is meant to poll an html internal page with different IPs that update and then will run a telnet session to those IPs to see if the device still has a connection... I'm attempting to challenge myself in creating something further with a dynamic webpage instead of my program spitting out console output...
My Issue:
I dont know what technologies / libraries Java has to execute such things
I want:
A Local Server, to upload a page LOCALLY only (no security is needed as this will be strictly intranet)
My program to implement: A database of sorts to save "logs" essentially that a certain IP / device has had successful connections
in the past....maybe stored to an external file is fine i presume (my
program currently has to re-poll everytime i run it.. i want some kind
of "remembering"..
Is it possible this can all be done in one file? so if i want my computer to run this as soon as it starts up... it will run... grab
its current state of the database of IPs... poll them (periodically)
and then persist and save and update the HTML page dynamically....
I hope i'm being as descriptive as possible... Its a bit of an abstract.. I really just want some introduction to different libraries ... a friend recommended stuff like MongoDB or something but I want to stay strictly to Java programming
I have a Java web app that deploys as a WAR to Tomcat 7.0.41 (myapp.war). I noticed that when I deploy the WAR to a Tomcat that lives in one part of our network, the web pages display perfectly fine. However, and this only happens in IE 11, if I take the exact same WAR and deploy it to the exact same version/Chef-configured-instance of a Tomcat server that lives in another part of our network, the page stylings look way different and completely wrong. Again, this is specific to IE11 and the location in the network that the app is served from. If I go to the app in IE 11 from a "good" location on the network, the frontend renders perfectly fine. Or if I view the app from a "bad" location on the network, but in a non-IE browser, again all is well.
I have a feeling that we might have some IT proxy (nginx, etc.) that is preventing Tomcat from serving certain CSS/JS files, and so the end result is a partially-complete frontend that looks all wonky in the browser. And somehow, this only crops up in IE 11.
I have (sort of) confirmed this by viewing the source of all my HTML, JS and CSS files and copying them to files in a local folder. I then open up one of the HTML files (locally) in a browser and the site displays perfectly.
The problem here is that my JS files use a bunch of open source JS libraries. And those libraries have dependencies on other libraries. So on and so forth, and the dependency graph is pretty huge. It's tough for me to tell which files are not being downloaded properly/completely.
Here's the kicker: if I add in html5shiv to my app then the problem goes away entirely, no matter which browser (IE or not) or what location in the network I choose. However adding html5shiv breaks other things in my app, and for reasons outside the context of this question, can't be used.
Anyone have any idea how I could troubleshoot/fix this? Why would this only be affecting IE 11 and not other browsers? Why is html5shiv solving this?!?
You need to start using Wireshark.
What it does is capture all network traffic and allow you to view it exactly as it was sent/received by your network card.
What I would do is capture the complete traffic that occurs between your computer and the server in the location where it is working, when you visit the webpage that has the problem. Then repeat that for the server that is not working.
You will then have the complete traffic and can compare them side by side. Even if it doesn't tell you the cause of the problem Wireshark will tell you where the difference is occurring in the packets that are sent by the two different servers.
You could also do it the other way round by running TCPDump (with command like tcpdump -i eth0 -w file.cap -s 0 to get the complete packets, rather than just the first X bytes) on the server, to capture the packets sent, and then viewing the capture in Wireshark.
"Does Wireshark offer such file-level abstractions or is it all nitty-gritty, byte-level output I need to read?"
Kind of both. Basically once you have the stream in front of you, you are able to see the individual requests starting by looking for GET entries in the packets.
Once you've identified where a file starts, you can right-click on that packet, choose follow TCP stream and it will give you a summarised view of that TCP stream:
If you need the detailed difference between the files, it will be there....but tbh it's probably going to be something obvious like a file being completely truncated or mangled, rather than just a byte or two being wrong in one of the files.
We have a web application hosted on this webLogic server on a UNIX machine. Its primarily a JSP/Servlet based app. Whenever we do a modification/enhancemment to any one of those JSps or servlets, I precompile them on my local and deploy them on the UNIX system. For example, if there is a file called GetIdServlet.class, we usually rename the existing file to say GetIdServlet.class1 and then put in the new file as GetIdServlet.class. This is just to be able to revert back to the original file in case they are needed. However, I notice very strange behaviour. The application loses some functionality whenever we stop and start the server. The functionality may be back on the next or a few restarts after that. For example, a submit button that is supposed to direct it to the next page just stops working. It may start working after a few restart.
However on my local(Eclipse + webLogic) there is absolutely no issue. Everything works fine. Any ideas on what's going wrong?
You are using Unix Environment and i assume that the local desk setup used is windows OS or MAC. thus, when you copy the class files you are using some tool like WinSCP.
in case so, then please set the copy settings of such tool to use binary method of copying the files.
Example in WinSCP. go to Options->Preferences->Select Transfer in the Side Menu->under the Transfer Mode section, Select Binary option as the Transfer Mode. This will ensure that the binary replica is created on the Unix environment and that no data is lost in the transfer.
I've a production env and test env. Production has win2k3+tomcat 6.0+ and network drive mapped to a drive letter for easy access (z:\app instead of \symba\files\app). My test env has windows xp (all the software is same including the source code for servlet) and test also has the same drive letter mapping to the network drive.
Tomcat is running with the same user id in both the systems and am able to access the file via windows explorer in the test m/c and production m/c.
Now the servlet in the windows xp m/c (test m/c) throws a file not found exception if try to access an existing file (reachable via windows explorer). The servlet in production is same as in test env and production servlet happily gives the file when i request it and does not throw any error what so ever.
I've see some posts that using drive letter is not a good idea and should use UNC paths instead and i've not tried this yet. I want to know the reason why test servlet fails to get file whereas production servlet works fine.
Thank you very much for your time and help
Bo
Are you running the application server as a service? Drive letter assignments are reliable only if you use interactive programs not services.
A couple of years ago, I tried to resolve a quite identical problem but, at last, I gave up and I used JCIFS to access the files.
If you run Tomcat with a security manager, the web app code is according to the default configuration only allowed file access to its deployment directory. If you want to change the application policies, you can do that in conf/catalina.policy or you can disable the security manager, if you want your web app code to gain all privileges.
You might want to consider running the Tomcat service as the user who has access to the mapped drive.
As pointed out by andcoz, the mappings will not apply for the SYSTEM user in Windows that I presume is being utilized for running Tomcat. You could change the service configuration to run as the user owning the drive mapping and verify if the failure continues to occur.
Related:
FileNotFoundException thrown when the file does exists.