Jersey - Massive Latency Calling Service Method From Resource - java

I have a Jersey REST service with a resource class that calls methods on a service class. During testing we've noticed a latency between the time the resource method's "Entering" log statement and the service's. This latency can be as much as 5 minutes although normally it's in the 2 minute range. Once in awhile, the latency is minimal (milliseconds).
Here's what our classes look like:
Resource
#Stateless
#Path("/provision")
public class ProvisionResource
{
private final Logger logger = LoggerFactory.getLogger(ProvisionResource.class);
#EJB
private ProvisionService provisionService;
#GET
#Produces(MediaType.APPLICATION_XML)
#Path("/subscriber")
public SubscriberAccount querySubscriberAccount(
#QueryParam("accountNum") String accountNum)
{
logger.debug("Entering querySubscriberAccount()");
final SubscriberAccount account;
try
{
account = provisionService.querySubscriber(accountNum);
}
catch (IllegalArgumentException ex)
{
logger.error("Illegal argument while executing query for subscriber account",
ex);
throw new WebApplicationException(Response.Status.BAD_REQUEST);
}
catch (Exception ex)
{
logger.error("Unexpected exception while executing query for subscriber account",
ex);
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
}
logger.debug("Exiting querySubscriberAccount()");
return account;
}
}
Service:
#Singleton
public class ProvisionService
{
private final Logger logger = LoggerFactory.getLogger(ProvisionService.class);
public SubscriberAccount querySubscriber(final String accountNum) throws IllegalArgumentException, Exception
{
logger.debug("Entering querySubscriber()");
if (null == accountNum)
{
throw new IllegalArgumentException("The argument {accountNum} must not be NULL");
}
SubscriberAccount subscriberAccount = null;
try
{
// do stuff to get subscriber account
}
catch (Exception ex)
{
throw new Exception("Caught exception querying {accountNum}=["
+ accountNum + "]", ex);
}
finally
{
logger.debug("Exiting querySubscriber()");
}
return subscriberAccount;
}
Here's some samples from our logs showing the timestamps of when we enter the methods.
2012 Feb 07 15:31:06,303 MST [http-thread-pool-80(1)] DEBUG my.package.ProvisionResource - Entering querySubscriberAccount()
2012 Feb 07 15:31:06,304 MST [http-thread-pool-80(1)] DEBUG my.package.ProvisionService - Entering querySubscriber()
2012 Feb 07 15:35:06,359 MST [http-thread-pool-80(1)] DEBUG my.package.ProvisionResource - Entering querySubscriberAccount()
2012 Feb 07 15:40:33,395 MST [http-thread-pool-80(1)] DEBUG my.package.ProvisionService - Entering querySubscriber()
2012 Feb 07 15:34:06,345 MST [http-thread-pool-80(2)] DEBUG my.package.ProvisionResource - Entering querySubscriberAccount()
2012 Feb 07 15:37:24,372 MST [http-thread-pool-80(2)] DEBUG my.package.ProvisionService - Entering querySubscriber()
2012 Feb 07 15:33:06,332 MST [http-thread-pool-80(4)] DEBUG my.package.ProvisionResource - Entering querySubscriberAccount()
2012 Feb 07 15:34:15,349 MST [http-thread-pool-80(4)] DEBUG my.package.ProvisionService - Entering querySubscriber()
2012 Feb 07 15:37:24,371 MST [http-thread-pool-80(4)] DEBUG my.package.ProvisionResource - Entering querySubscriberAccount()
2012 Feb 07 15:40:36,004 MST [http-thread-pool-80(4)] DEBUG my.package.ProvisionService - Entering querySubscriber()
2012 Feb 07 15:32:06,317 MST [http-thread-pool-80(5)] DEBUG my.package.ProvisionResource - Entering querySubscriberAccount()
2012 Feb 07 15:34:15,325 MST [http-thread-pool-80(5)] DEBUG my.package.ProvisionService - Entering querySubscriber()
2012 Feb 07 15:36:06,373 MST [http-thread-pool-80(5)] DEBUG my.package.ProvisionResource - Entering querySubscriberAccount()
2012 Feb 07 15:40:34,956 MST [http-thread-pool-80(5)] DEBUG my.package.ProvisionService - Entering querySubscriber()
As you can see, the first one called the querySubscriber method in the service almost immediately after entering the resource's querySubscriberAccount. However, subsequent calls to the webservice take ~1 to 5 minutes. There's really nothing happening in the resource that would hold up processing/calling the service.
The webservice is deployed on a Linux server in Glassfish 3.1.1.
Has anyone seen anything like this before?? Any suggestions on what's going on?
EDIT
Just a little more information...
The domain into which the web service war is deployed has 4 applications deployed in it:
the Jersey webservice war which is having issues
an ear which uses a client to the Jersey webservice
a servlet war used to test connections etc. used by the ear (including the Jersey webservice)
another servlet war which does not use the webservice
When we disabled the ear and "other" war file (only the Jersey war and the test servlet were enabled), the latency issue goes away. We re-enabled the war and ear and things still continued to respond in a timely manner. When we redeployed Jersey webservice war (made some logging changes), the latency problem immediately came back.

Thread dump can be used to find out what code (including stack traces) is running and the current moment inside Java process. jps tool will help in get getting PID of the required JVM instance.

Related

Session timeout is immediately followed with a page reload, starting a new session

When the VaadinSession timeout happens, the page automatically reloads starting a new VaadinSession.
Vaadin 23.0.5
Below, I have included the Chrome console log as the session ends and the reload happens.
There is nothing indicating why this is going on in the java logs.
This appears (to me) to be initiated in the browser, possibly by the service worker?
Suggestions for further diagnostics, or just an outright solution (I can dream) would be greatly appreciated.
Here is the Chrome console as the Session terminates...
Received push (websocket) message: for(;;);[{"syncId":4,"clientId":2,"meta":{"async":true,"sessionExpired":true},"timings":[5,0]}]
FlowClient.js?2d7e:1004 Handling message from server
FlowClient.js?2d7e:944 Handling dependencies
FlowClient.js?2d7e:193 handleUIDLMessage: 0 ms
vaadinPush.js?v=23.0.4:3323 Mon Jun 06 2022 13:41:09 GMT+1000 (Australian Eastern Standard Time) Atmosphere: beforeunload event
FlowClient.js?2d7e:193 Setting heartbeat interval to -1sec.
FlowClient.js?2d7e:835 Disabling heartbeat
FlowClient.js?2d7e:936 Closing push connection
vaadinPush.js?v=23.0.4:3323 Mon Jun 06 2022 13:41:09 GMT+1000 (Australian Eastern Standard Time) Atmosphere: Closing (AtmosphereRequest._close() called)
vaadinPush.js?v=23.0.4:3323 Mon Jun 06 2022 13:41:09 GMT+1000 (Australian Eastern Standard Time) Atmosphere: Firing onClose (unsubscribe case)
FlowClient.js?2d7e:1006 Push connection closed
vaadinPush.js?v=23.0.4:3323 Mon Jun 06 2022 13:41:09 GMT+1000 (Australian Eastern Standard Time) Atmosphere: Request already closed, not firing onClose (unsubscribe case)
vaadinPush.js?v=23.0.4:3323 Mon Jun 06 2022 13:41:09 GMT+1000 (Australian Eastern Standard Time) Atmosphere: invoking .close() on WebSocket object
FlowClient.js?2d7e:193 Processing time was 5ms
vaadinPush.js?v=23.0.4:3323 Mon Jun 06 2022 13:41:09 GMT+1000 (Australian Eastern Standard Time) Atmosphere: Request already closed, not firing onClose (unsubscribe case)
logger.js?aa4d:46 workbox No route found for: /?v-r=push&v-uiId=0&v-pushId=09139213-af19-48d7-8a55-278da41b839f&X-Atmosphere-Transport=close&X-Atmosphere-tracking-id=3c2a0c76-86d7-4952-a1c4-80786dd19bd0
vaadinPush.js?v=23.0.4:3323 Mon Jun 06 2022 13:41:09 GMT+1000 (Australian Eastern Standard Time) Atmosphere: websocket.onclose
vaadinPush.js?v=23.0.4:3323 Websocket closed, reason: Normal closure; the connection successfully completed whatever purpose for which it was created. - wasClean: true
log # vaadinPush.js?v=23.0.4:3323
warn # vaadinPush.js?v=23.0.4:3329
_websocket.onclose # vaadinPush.js?v=23.0.4:1537
vaadinPush.js?v=23.0.4:3323 Mon Jun 06 2022 13:41:09 GMT+1000 (Australian Eastern Standard Time) Atmosphere: Request already closed, not firing onClose (closed case)
vaadinPush.js?v=23.0.4:3323 Mon Jun 06 2022 13:41:09 GMT+1000 (Australian Eastern Standard Time) Atmosphere: Request already closed, not firing onClose (closed case)
vaadinPush.js?v=23.0.4:3323 Websocket closed normally
Which is immediately followed with the page reloading...
logger.js?aa4d:46 workbox The navigation route / is being used.
logger.js?aa4d:46 workbox Router is responding to: /
logger.js?aa4d:46 workbox Network request for '/' returned a response with status '200'.
logger.js?aa4d:46 workbox Using NetworkOnly to respond to '/'
​ Mon Jun 06 2022 13:41:11 GMT+1000 (Australian Eastern Standard Time) Atmosphere: unload event
logger.js?aa4d:46 workbox No route found for:
https://api.breadbutter.io/apps/xxxxxxxxxxxxxxxx/prerelease/page_engagement
logger.js?aa4d:46 workbox Router is responding to: /VAADIN/build/vaadin-bundle-52a045587b10cc017547.cache.js
logger.js?aa4d:46 workbox Found a cached response in 'workbox-precache-v2-https://mylocalhost/'.
logger.js?aa4d:46 workbox Precaching did not find a match for /?v-r=init&location=
logger.js?aa4d:46 workbox No route found for: /?v-r=init&location=
logger.js?aa4d:46
Yes, this is intended behavior.
You need to setup servlet initialized listener and there define customized system messages, there sessionExpiredURL needs to be not null (null is the default value, and if it is null, page will reload upon session expired)
getService()
.setSystemMessagesProvider(new SystemMessagesProvider() {
#Override
public SystemMessages getSystemMessages(
SystemMessagesInfo systemMessagesInfo) {
CustomizedSystemMessages messages = new CustomizedSystemMessages();
messages.setSessionExpiredNotificationEnabled(
false); // or true
messages.setSessionExpiredURL( USE NON-NULL VALUE HERE );
return messages;
}
});

SOAP UI Restful : An error occurred [Illegal character in path at index

I am currently developing a Web Service RESTFUL.
To test the Web Service, I'm using SOAP UI.
While performing testing, I got the error Illegal character in path.
May I know what is the cause of the error? How to fix the issue?
Below is the detail of the problem.
Error Log:
Wed Nov 28 17:05:26 SGT 2018:ERROR:java.net.URISyntaxException: Illegal character in path at index 62: http://127.0.0.1:8080/AdaptiveAuthWSApps/rest/AdaptiveService/{uuid}/{browserinfo}/{ipint}/{lat}/{longitude}/{sessionid}/{spid}/{tr}/{jsnum}/{fingerprint}/{methodset}
java.net.URISyntaxException: Illegal character in path at index 62: http://127.0.0.1:8080/AdaptiveAuthWSApps/rest/AdaptiveService/{uuid}/{browserinfo}/{ipint}/{lat}/{longitude}/{sessionid}/{spid}/{tr}/{jsnum}/{fingerprint}/{methodset}
SOAP UI Log:
Wed Nov 28 17:05:26 SGT 2018:ERROR:An error occurred [Illegal character in path at index 62: http://127.0.0.1:8080/AdaptiveAuthWSApps/rest/AdaptiveService/{uuid}/{browserinfo}/{ipint}/{lat}/{longitude}/{sessionid}/{spid}/{tr}/{jsnum}/{fingerprint}/{methodset}], see error log for details
Wed Nov 28 17:05:26 SGT 2018:DEBUG:Attempt 1 to execute request
Wed Nov 28 17:05:26 SGT 2018:DEBUG:Sending request: POST /?uuid=iz23456&browserinfo=Mozilla%2F8.0%20%28Windows%20NT%206.1%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F49.0.2623.112%20Safari%2F537.36&ipint=16885247&lat=1&longitude=0&sessionid=12w3e4&spid=https%3A%2F%2Fuap%2Fowa&tr=10&jsnum=2&fingerprint=yh8u87&methodset=1%2C1 HTTP/1.1
Wed Nov 28 17:05:26 SGT 2018:DEBUG:Receiving response: HTTP/1.1 200
Wed Nov 28 17:05:26 SGT 2018:DEBUG:Connection can be kept alive indefinitely
Below is the WADL that I used when creating the Test Suite in SOAP UI.
http://127.0.0.1:8080/AdaptiveAuthWSApps/rest/application.wadl
SOAP UI parameter initialize:
I believe the problem is the value of your uuid parameter.
A uuid should consist solely of hexadecimal characters. That is 0-9 and a-f (and also the "-" of course)
You've written iz123456, and neither "i" or "z" are valid.
If the uuid also should be an actual uuid, then it should look something like this: 13a1a079-4a39-4625-91a4-ddbf09c2c324
Try copy/pasting this uuid into your uuid parameter, and run it again.
It looks like you're getting your parameter styles mixed up. If you define a style of QUERY, the key/value pairs are added after the question mark in the URL, not added to the resource path. Using {uuid}/{browserinfo}/... is a TEMPLATE style.
So, remove {uuid}/{browserinfo}/... from your resource path and just leave the key/value pairs after the question mark.

SOAP UI displays faultstring even after error 500 is received. need to view the same in JAVA

Here's the story:
Sending a request from SOAPUI (5.2.1) gives me either correct response or, in case of invalid parameters, the error in form of xml.
Looking at SoapUI log this is what i see:
Wed Jan 18 16:32:39 EST 2017:DEBUG:Attempt 1 to execute request
Wed Jan 18 16:32:39 EST 2017:DEBUG:Sending request: POST/XBC/services/TranslateGeometryService HTTP/1.1
Wed Jan 18 16:32:48 EST 2017:DEBUG:Receiving response: HTTP/1.1 401 Unauthorized
Wed Jan 18 16:32:48 EST 2017:DEBUG:Connection can be kept alive for 10000 MILLISECONDS
Wed Jan 18 16:32:48 EST 2017:DEBUG:Target requested authentication
Wed Jan 18 16:32:48 EST 2017:DEBUG:Authorization challenge processed
Wed Jan 18 16:32:48 EST 2017:DEBUG:Authentication scope: BASIC 'Spring Security Application'#mywebservice:80
Wed Jan 18 16:32:48 EST 2017:INFO:mywebservice:80 requires authentication with the realm 'Spring Security Application'
Wed Jan 18 16:32:48 EST 2017:DEBUG:Found credentials
Wed Jan 18 16:32:48 EST 2017:DEBUG:Attempt 2 to execute request
Wed Jan 18 16:32:48 EST 2017:DEBUG:Sending request: POST/XBC/services/TranslateGeometryService HTTP/1.1
Wed Jan 18 16:33:14 EST 2017:DEBUG:Receiving response: HTTP/1.1 500 Internal Server Error
Wed Jan 18 16:33:14 EST 2017:DEBUG:Connection shut down
Wed Jan 18 16:33:14 EST 2017:INFO:Got response for [TranslateGeometrySoap11.getLocationFromTramPoleTrackOffset:Request 1] in 35794ms (312 bytes)
(Note that those 312 bytes come after error 500 and connection shut down messages)
Response window, at the same time, in SOAPUI shows this:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring xml:lang="en">Error: No Track exists with Track Code: CHS-CSK-UP-TW</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
This is perfect and works as i expect it to work.
Now for my problem that is seriously driving me mad.
When i attempt to send exactly the same request from my java code that is supposed to return the error above, i receive IOException that says:
Server returned HTTP response code: 500 for URL: http://mywebservice/XBC/services/TranslateGeometryService
So, pretty much same as what SOAPUI shows in its log.
But...
No matter what i do in my code i cannot get that message in faultstring that SOAPUI displays: "No Track exists with Track Code: CHS-CSK-UP-TW".
How is SOAPUI doing it after it receives error 500? Or, more importantly - how do i get it in JAVA after receiving error 500?
Tried playing with SoapFaultException class and SoapFault, but i could not find anything more anywhere.
Thanks to anyone who tries to answer this question.
Cheers,
Pierre
The next code in Java handler uses SOAPMessageContext TO detect SOAP fault and extract fault string from SOAPBody:
public bool handleFault(SOAPMessageContext context)
{
try {
if (context.getMessage().getSOAPBody().hasFault()) {
SOAPFault fa = context.getMessage().getSOAPBody().getFault();
System.err.println(fa.getFaultCode());
System.err.println(fa.getFaultString());
}
return true;
} catch (SOAPException ex) {
System.err.println("Fault parsing Exception:" + ex.getMessage());
return true;
}
return false;
}

How to use Twitter4j to show tweets

I have followed this tutorial http://www.javacodegeeks.com/2012/03/twitter-api-on-your-java-application.html and did the exact same thing. But I am getting an error which is shown below. Am I missing something? Should I be setting some permissions in any file? I have checked in many places but still couldn't fix this. Please help
Exception in thread "main" 401:Authentication credentials
(https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set
valid conumer key/secret, access token/secret, and the system clock in in sync.
error - Not authorized
request - /1/statuses/user_timeline.json?
TwitterException{exceptionCode=[ced778ef-115a04e4], statusCode=401, retryAfter=-1,
rateLimitStatus=RateLimitStatusJSONImpl{remainingHits=145, hourlyLimit=150,
resetTimeInSeconds=1362901, secondsUntilReset=1235, resetTime=Sun Mar 10 13:15:51 IST
2013}, featureSpecificRateLimitStatus=null, version=2.2.5}
at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:185)
at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:65)
at twitter4j.internal.http.HttpClientWrapper.get(HttpClientWrapper.java:85)
at twitter4j.TwitterImpl.get(TwitterImpl.java:1895)
at twitter4j.TwitterImpl.getUserTimeline(TwitterImpl.java:254)
at com.jdwb.twitterapi.tweet.main(tweet.java:33)
public class tweet {
public static void main(String[] args) throws TwitterException {
Twitter twitter = new TwitterFactory().getInstance();
ResponseList < Status > a = twitter.getUserTimeline(new Paging(1, 5));
for (Status b: a) {
System.out.println(b.getText());
}
}
}
-------------------------Properties file-------------
debug=true
oauth.consumerKey=***************
oauth.consumerSecret=***********
oauth.accessToken=*******************
oauth.accessTokenSecret=***********************
[Sun Mar 10 14:41:26 IST 2013]status: 401 Unauthorized
[Sun Mar 10 14:41:26 IST 2013]x-ratelimit-remaining: 143
[Sun Mar 10 14:41:26 IST 2013]content-encoding: gzip
[Sun Mar 10 14:41:26 IST 2013]date: Sun, 10 Mar 2013 09:11:26 GMT
[Sun Mar 10 14:41:26 IST 2013]x-ratelimit-reset: 1362908664
[Sun Mar 10 14:41:26 IST 2013]x-transaction: 58f6c286bb1aa6de
[Sun Mar 10 14:41:26 IST 2013]pragma: no-cache
[Sun Mar 10 14:41:26 IST 2013]cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
[Sun Mar 10 14:41:26 IST 2013]{"request":"\/1\/statuses\/user_timeline.json?include_rts=true&include_entities=true&include_my_retweet=1&count=5&page=1","error":"Not authorized"}
Exception in thread "main" 401:Authentication credentials
(https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have
set valid conumer key/secret, access token/secret, and the system clock in in sync.
error - Not authorized
I presume that you have not got your authorization set up correctly
have a look here for how to set up the properties file.
you need to sign up to the twitter dev to get your API keys so that you can fill in the information that you need.

Apache Commons IO Tailer delivers old log messages

My code is given below.
public static void main(String[] args) {
// TODO code application logic here
File pcounter_log = new File("c:\development\temp\test.log");
try {
Tailer tailer = new Tailer(pcounter_log, new FileListener("c:\development\temp\test.log",getLogPattern()), 5000,true);
Thread thread = new Thread(tailer);
thread.start();
} catch (Exception e) {
System.out.println(e);
}
}
public class FileListener extends TailerListenerAdapter {
public void handle(String line) {
for (String logPattern : pattern) {
if (line.contains(logPattern)) {
logger.info(line);
}
}
}
}
Here getLogPattern() returns an ArrayList containing values like [info,error,abc.catch,warning]. When running this code, I get old log message followed by new log message. I.e. the output is like this:
20 May 2011 07:06:02,305 INFO FileListener:? - 20 May 2011 07:06:01,230 DEBUG - exiting readScriptErrorStream()
20 May 2011 07:06:55,052 INFO FileListener:? - 20 May 2011 07:06:55,016 DEBUG - readScriptErrorStream()
20 May 2011 07:06:56,056 INFO FileListener:? - 20 May 2011 07:06:55,040 DEBUG - exiting readScriptErrorStream()
20 May 2011 07:07:01,241 INFO FileListener:? - 20 May 2011 07:07:01,219 DEBUG - readScriptErrorStream()
20 May 2011 07:07:02,245 INFO FileListener:? - 20 May 2011 07:07:01,230 DEBUG - exiting readScriptErrorStream()
20 May 2011 07:07:55,020 INFO FileListener:? - 20 May 2011 07:07:55,016 DEBUG - readScriptErrorStream()
20 May 2011 07:07:56,024 INFO FileListener:? - 20 2011 07:07:55,030 DEBUG - exiting readScriptErrorStream()
20 May 2011 07:08:01,269 INFO FileListener:? - 20 May 2011 07:08:01,227 DEBUG - readScriptErrorStream()
20 May 2011 07:08:02,273 INFO FileListener:? - 20 May 2011 07:08:01,230 DEBUG - exiting readScriptErrorStream()
20 May 2011 07:08:21,234 INFO FileListener:? - 20 May 2011 06:40:02,461 DEBUG - readScriptErrorStream()
20 May 2011 07:08:22,237 INFO FileListener:? - 20 May 2011 06:40:02,468 DEBUG - exiting readScriptErrorStream()
20 May 2011 07:08:23,242 INFO FileListener:? - 20 May 2011 06:41:01,224 DEBUG - readScriptErrorStream()
20 May 2011 07:08:24,250 INFO FileListener:? - 20 May 2011 06:41:01,232 DEBUG - exiting readScriptErrorStream()
20 May 2011 07:08:25,261 INFO FileListener:? - 20 May 2011 06:42:01,218 DEBUG - readScriptErrorStream()
20 May 2011 07:08:26,265 INFO FileListener:? - 20 May 2011 06:42:01,230 DEBUG - exiting readScriptErrorStream()
20 May 2011 07:08:27,272 INFO FileListener:? - 20 May 2011 06:43:01,223 DEBUG - readScriptErrorStream()
20 May 2011 07:08:28,275 INFO FileListener:? - 20 May 2011 06:43:01,231 DEBUG - exiting readScriptErrorStream()
How to avoid to get old log messages from log file like this?
Oh boy, I have wasted an entire day thinking it was my dodgy threading, but I now see others have shared my pain. Oh well, at least I won't waste another day looking at it.
But I did look at the source code. I am sure the error is occuring here in the Tailer.java file:
boolean newer = FileUtils.isFileNewer(file, last); // IO-279, must be done first
...
...
else if (newer) {
/*
* This can happen if the file is truncated or overwritten with the
* exact same length of information. In cases like this, the file
* position needs to be reset
*/
position = 0;
reader.seek(position);
...
It seems it's possible that the file modification data can change before the data is written. I'm no expert on why this would be. I am getting my log files from the network, so perhaps all sorts of caching is going on that means you are not garunteed that a newer file will contain any more data.
I have updated the source and removed this section. For me, the chances of a file getting truncated/recreated with exactly the same number of bytes is minimal. I'm referencing 10MB rolling log files.
I see that this is a known issue ( IO-279 LINK HERE ). However, it's marked as resolved and that's clearly not the case. I'll contact the developers to see if there's something in the pipeline. It would seem they're of the same opinion as me about the fix.
https://issues.apache.org/jira/browse/IO-279?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
What version of commons.io are ( were ) you using?
I experienced this error with 2.0.1. I updated to 2.3, and it seems to be working properly ( so far )
I know that this is a very old thread, but I just ran into a similar issue with Tailer. It turned out that Tailer had two threads reading the file concurrently.
I traced it back to how I had created the Tailer instance. Rather than using one of their 3 recommendations (static helper method, Executor, or Thread) I had created the instance with the static helper method and then fed the instance created into a Thread which seemed to result in two threads reading the file.
Once I corrected this (by removing the call to the static helper method and just using one of the overloaded Tailer constructors and a Thread) the issue went away.
Hope this helps someone.

Categories