UrlConnection not getting latest content
I have an applet that reads the contents of a file on the server once per second and displays it. The file contains one line that describes the status of a process. The problem is there is a 15-20 second delay between when the file is updated and when the applet displays the new status. Here is my applet run() method:
public void run() {
Thread currentThread = Thread.currentThread();
StatusField.setText("Testing");
String host ="192.168.3.14";
String protocol ="http";
int port =80;
int count = 0;
BufferedReader bufferedReader = null;
String stat = "";
try {
while (currentThread == theThread) {
URL url = new URL(protocol, host, port, fileName);
URLConnection urlConnection = url.openConnection();
//turn off cache
urlConnection.setUseCaches(false);
urlConnection.setDoInput (true);
bufferedReader = new BufferedReader(new
InputStreamReader(urlConnection.getInputStream(), "UTF8"));
stat = bufferedReader.readLine();
System.out.println("Status: " + stat);
StatusField.setText(stat);
bufferedReader.close();
bufferedReader = null;
urlConnection = null;
url = null;
System.gc();
currentThread.sleep(1000);
}catch (Exception e) {
StatusField.setText(e.getMessage());
}
Thanks, but I don't think the problem is with the applet not painting immediately. The System.out.println shows that the BufferedReader is still reading old content even after the file has changed. I also added code to the above to show a dot in the status field every time the file is read. This dot is appearing corectly in the applet every time the file is read.
Similar Messages
-
Not getting the content of the image
I am not able to get the content in the following code CALL METHOD cl_mime_repository_api=>if_mr_api~get_api
RECEIVING
r_mr_api = gv_mr_api.
CALL METHOD gv_mr_api->get
EXPORTING
i_url = '/SAP/PUBLIC/mac.gif'
IMPORTING
e_is_folder = is_folder
e_content = gv_content
e_loio = l_loio
EXCEPTIONS
parameter_missing = 1
error_occured = 2
not_found = 3
permission_failure = 4
OTHERS = 5.
It is throwing the permission_failure exception kindly help me on this
I am stuck for a while on thistry by passing I_CHECK_AUTHORITY as blank by default its 'X' and will check for authority.
-Rajeev -
I use a MacBook Pro
After purchasing an Adobe PDF Pack, I still don't get the Content Editing option on my Tools bar
please adviseThanks Sara, however my understanding is what I purchased enabled me to
convert pdf into word for editing, please see screen shot attached. I
believe this shows that in the PDF Pack which i have purchased I am able to
do this.
Please further advise
Cheers
Therese
Therese S
[private information removed by moderator]
On Thu, Mar 12, 2015 at 5:48 AM, Sara.Forsberg <[email protected]> -
Yesterday I have upgraded my itune and icloud on my PC, now I notice my photo stream in my PC doesn't get latest picture I took from my iphone 4s (IOS 7.0.4). Whenever I open icloud photo, my PC prompts me the message below. Please advice what to do?
Hello
Try restoring the device and setting up as new.
If it is still shows an iCloud activation lock, then it's on an iCloud account
The wrong device was removed from an iCloud account.
Check any other Apple IDs you might have at
iCloud.com
Get signed into them and remove that device.
I wish this was the first time I seen this.
Best of Luck -
Could not get exact contents from pdf using adobe acrobat professional
Hi,
I am using acrobat professional to extract contents from a pdf into HTML. During extraction of pdf into HTML some contents are getting rendered as images. But with pdf to xml extraction i can get the exact contents. But i need HTML file from pdf. Any suggestions. Thanks in advance.You might want to see if you can select the background with the object touchup tool. If so, can you then just delete the selected object. May take a while to go through the document, but if it solves the problem you are ahead. You may be able to select it with JavaScript and repeat the process. My point of using the object touchup tool is that it may not be a background set by Acrobat, but something that is simply labeled as an image from the Acrobat viewpoint.
-
JTable not getting latest data (unless mouse is focussed out of the cell)
Hi,
I am using JDK 1.4.2. I am having a basic problem of reading the data present in a JTable.
JTable table = new JTable(9, 9);
JButton solveButton = new JButton("Solve");
solveButton.addActionListener(new DumpListener(table));The dump listener just dumps the data in the table.
I have a 6*6 jtable where each value is a number. Now i focus the mouse on say square (1,2) and enter some data, then on square (5,5) and enter data say "4". There is a button in this panel, and which on being clicked, gets the table data and does some operation on it.
Problem is when i use the "getValueAt" API, it gives correct data for square(1,2) but not for (5,5). This is because the mouse focus is still on square (5,5). However if i focus out of square (5,5) using my mouse (to some other random square) then the data comes up properly. Am i missing something here?
I understand it is to do with the data model getting altered only when the mouse if focussed out? But this seems to be very trivial. Is there a way of getting the data out without focusing the mouse out of the cell?My solution uses a JFrame instead of a JApplet.
But I think the effect is the same.
First of all, the setVisible(true) should be put after all components are added.
Secondly, when you retrieve data in the table, you'd synchronized() the model.
Thirdly, I didn't find any problem when I call stopCellEditing(). Perhaps I'm using Java 5. Anyway, please try whether the following code works.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.TableModel;
public class DummyFrame extends JFrame {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
DummyFrame frame = new DummyFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
public DummyFrame() {
JTable table = new JTable(9, 9);
JButton data = new JButton("DATA");
data.addActionListener(new SimpleButtonListener(table));
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(table, BorderLayout.CENTER);
panel.add(data, BorderLayout.SOUTH);
getContentPane().setLayout(new BorderLayout());
getContentPane().add(panel);
class SimpleButtonListener implements ActionListener {
JTable table;
public SimpleButtonListener(JTable table) {
this.table = table;
public void actionPerformed(ActionEvent e) {
synchronized (table) {
if (table.isEditing()) {
System.out.println("Is Editing!");
table.getCellEditor(table.getEditingRow(), table.getEditingColumn()).stopCellEditing();
printArray(getData());
String[][] getData() {
synchronized (table) {
TableModel model = table.getModel();
synchronized (model) {
String[][] question = new String[9][9];
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
question[i][j] = model.getValueAt(i,j) == null ? null : model.getValueAt(i,j).toString();
return question;
void printArray(String[][] question) {
int rows = question.length, columns = question[0].length;
for (int i = 0; i < rows; i++) {
for (int j = 0; j < columns; j++) {
System.out.println("[" + i + ", " + j + "] -> "
+ question[i][j]);
}And ... please don't forget to give me the 5 Duke dollars if it works.
Thank you!
Asuka Kenji (UserID = 289)
(Duke Dollars Hunting now ...) -
SSMS not getting latest errorlog
Hello.
I'm running sql server 2005.
I verified the sql server errorlog is being written to, in F:\errorlog\errorlog.
I copied this file to another name so I'd be able to read it.
It has current output, with today's date.
But when I read sql server errorlog, it only shows data up to 5/24/2014, even though the file properties show today's date.
I'm using SSMS for sql server 2005, the same version as the server.
Please advise why this may be, and how to see latest data in ssms.
Any help or suggestions would be appreciated.
Thanks very much.Hello Richard,
in SSMS 2005 the content of ErrorLog is sorted by event date in ascending order; in never version in descending order. Have you scroll down the log to see the latest events?
Olaf Helper
[ Blog] [ Xing] [ MVP] -
Hi all,
I am following below Steps:
Going to Library Setting.
After Click on Some Custom Content Types in content Type section.
Click on
Document
Set settings in Settings.
Brows and Upload Document Template in “Default Content” Section.
Click OK.
After Uploading Default Template I want these uploade template in my newly created Sub site (After saving Site as Template) which is created with wsp.
When i create new subsite i am not getting Default Content which have brwsed and Uploaded in Contenten Types.
Please Give some idea regarding below Screen Shot.
Thanks In Advance. Your help will be heighly appreciable.
For example i have given Document Link from any Library/List but not getting that link in new subsite which was created with wsp.
Thanks In Advance. Your help will be heighly appreciable.
Thanks,
Vivek PandeyHi Christoph,
From the article you mentioned, it needs add JPG file type to Search Service Application, which was not supported for SharePoint online.
I tried to add Picture content type to normal document library and tested the issue, it still displayed as item in Search results.
However, if I created a Picture Library and add Document content type to it, both image and document can be previewed in search result.
Regards,
Rebecca Tu
TechNet Community Support -
Hi - Even though block popup windows is unchecked in content tab of options, I am still not getting any popups. Please suggest how to over come this problem.
Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
*Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
*Do NOT click the Reset button on the Safe Mode start window
*https://support.mozilla.org/kb/Safe+Mode
*https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
Did you make sure that your security software isn't blocking the pop-ups?
Boot the computer in Windows Safe Mode with network support (press F8 on the boot screen) as a test.
*http://www.bleepingcomputer.com/tutorials/how-to-start-windows-in-safe-mode/ -
Jcr:content not getting replaced by _jcr_content
Hi,
we have a problem with some image paths rendered in the markup which points to a specific image rendition, i.e the "jcr:content" node is a part of the path. For some of the image paths, "jcr:content" is not getting replaced by "_jcr_content" causing the dispatcher to reply with 403 responses for theses images since ':' is a reserved character. We also see different behaviour in different environments (test vs prod).
Anybody who has an idea why this happens for some images?
Thanks,
JoakimSome time disabling namespace mangling under sling resource resolver can cause this as well.
-
I have an ipod nano 7th generation and can not get it recognised by my Windows 8.1 laptop (it appears briefly on My computer, then disappears). This happened after I updated iTunes to the latest version. Does that have something to do with it?
Hello there, kiwilucea.
The following Knowledge Base article offers up some in-depth steps for troubleshooting your issue:
iPod not recognized in My Computer and in iTunes for Windows
http://support.apple.com/kb/ts1369
Keep in mind if you get to Step 12 Reinstall iTunes, those steps need to be followed exactly as outlined for the reinstall to be effective.
Thanks for reaching out to Apple Support Communities.
Cheers,
Pedro. -
great, but my MBA did not come with an installion disc, only a tiny jump drive that is not recognized by windows; and I can't get the contents of that burned to a DVD either. So how the heck do I get the drivers into Windows 7? My MBA has bootcamp 3.0.4.
Here's what I get:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0 mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 00:11:24:7d:e7:1e
media: autoselect (none) status: inactive
supported media: none autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback>
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet6 fe80::211:24ff:fe28:2e71%en1 prefixlen 64 scopeid 0x5
inet 169.254.115.141 netmask 0xffff0000 broadcast 169.254.255.255
ether 00:11:24:28:2e:71
media: autoselect status: active
supported media: autoselect
fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 2030
lladdr 00:11:24:ff:fe:7d:e7:1e
media: autoselect <full-duplex> status: inactive
supported media: autoselect <full-duplex> -
Contents of new costing variant, valuation variant and costing sheet not getting transported
In our development client,I have created a new costing variant, a new valuation variant and a new costing sheet in separate transports.
When I release the transports to move into the Test client, the contents of the configuration are not getting transported at all.
I tried to do them again manually using Table view - Transport , but again, if I view the transports in SE10,they don't show the table contents, etc.
Any help on this will be highly appreciated.Ajay,
Let me make sure I understand.
Create a new TR using SE01
Go to transaction OKKN (costing variant)
Select the costing variant and then choose Table view - transport
Provide the transport number
At what point to I say 'include in request'
If I try to use the menu option Edit-Transport-Include in request in the beginning itself, the 'Include in request' is greyed out.
This is where I'm stuck -
I received a message that my iphone 4S was unlocked and that I should connect to iTunes to complete the process. When I connect to itunes I do not get the message "Congratulations you iphone has been unlocked". I have the latest itunes. Welcome help.
ihabf
[email protected]See Here
https://discussions.apple.com/message/15290457#15290457
From the More Like This on the right... -
I want to back up an Iphone 3G and put all the content into Iphone 4. After I have backed up the Ipone 3G and then when Iphone 4 is connected to Itunes I do not get an Option to restore back up from Iphone 3G. The only devive is see in the drop down list is my Iphone 4. The IOS on Iphone 3G is 4.2.1 and on Iphone 4 is 4.1.
Please share if anyone has any solution to such a problem.You will first have to update your iPhone 4 in order to restore it from the backup of your 3G. Follow the directions here:
http://support.apple.com/kb/HT4972
This is an erase/restore deal, so make sure all of your data is on your computer before you begin. iOS 6.1.2 will be installed on your iPhone 4.
Once done, on your iPhone 4: Settings>General>Reset>Erase All Content & Settings. You'll now be able to restore your 3G backup to your iPhone 4.
Maybe you are looking for
-
What can I do? Please help!
-
NAT MODERATE IS ANNOYING.
Time and time again, I have searched for a way to fix this problem, going to the router's settings' and repeatably enabled and disabled ports and I still have gotten the same result. MODERATE.. MODERATE! I am using A WRT160Nv3 Router and it is connec
-
GUI Form Builder (Netbeans)
Hello! I use the form builder to create and position 100 buttons. To address these "builder formed" buttons in other code, I created an array ....... ArrayList<JButton> buttons = new ArrayList<JButton>(); The "Form Built" buttons are added to my arra
-
[SOLVED] Can't chroot into Arch32 with custom 2.6.27 kernel
As usual, I'm in over my head. I run Arch64. I installed kernel26zenmm-git from AUR, which builds kernel 2.6.27-rc1. Everything's fine except that I can't seem to chroot into /opt/arch32*, from where I run 32-bit apps I get this error message when I
-
Hi I have to calculate median on Age. here Age is nothing but the difference between the created date and today's date. how to do this in reporting. Thanks Shiva Shankar