Error seen when using WebAuthor - ro.sync.servlet.ServletDocumentModelCache

Post here questions and problems related to oXygen frameworks/document types.
gfloodgate
Posts: 3
Joined: Thu May 02, 2013 6:22 pm

Error seen when using WebAuthor - ro.sync.servlet.ServletDocumentModelCache

Post by gfloodgate »

Hello,

We are using the Oxygen web author deployment (18.0.0.6) with a customer protocal connctor.

We have deployed the application to a Tomcat container, and when we access a document, we see the following error in the logs:

15935994 ERROR [ http-nio-8080-exec-9 ] ro.sync.servlet.ServletDocumentModelCache - User with id user2711956834878428666 is trying to access a document that belongs to the user user-1474907160811.
15935994 ERROR [ http-nio-8080-exec-9 ] ro.sync.servlet.errors.DefaultExceptionHandler - java.lang.IllegalMonitorStateException
java.lang.IllegalMonitorStateException
at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:151)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1261)
at java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:457)
at ro.sync.servlet.datastore.guava.GuavaDiskDatastore$Entry.unlock(GuavaDiskDatastore.java:333)
at ro.sync.servlet.datastore.guava.GuavaDiskDatastore.release(GuavaDiskDatastore.java:190)
at ro.sync.servlet.ServletDocumentModelCache.releaseDocument(ServletDocumentModelCache.java:235)
at ro.sync.servlet.validation.AuthorDocumentAsyncValidator.schedule(AuthorDocumentAsyncValidator.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:237)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at ro.sync.ecss.webapp.j.h.doFilter(Unknown Source)
at ro.sync.ecss.extensions.api.webapp.license.LicenseEnforcerFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at ro.sync.servlet.config.OxygenContextFilter.doFilter(OxygenContextFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at ro.sync.servlet.config.UTF8CharsetEnforcer.doFilter(UTF8CharsetEnforcer.java:28)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at ro.sync.servlet.config.DynamicResourcesNoCacheFilter.doFilter(DynamicResourcesNoCacheFilter.java:39)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1452)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)


We are supplying the url to webauthor in the format: (the specifics are fictional here to avoid leaking information, but the intent is correct)

http://web-author.blah.com/app/oxygen.h ... user-yyyyy

The document content loads, but we see the above errors in the logs AND the content is not styled correctly.
Any attempt to edit/update the content results in a failure message.

Can someone explain please how we can resolve this issue -= or at the very least - what is causing it ?!?

For info: There is only one user, from one web browser, in one location attempting to access the document at a time.

Kind Regards
Gareth
mihai_coanda
Posts: 63
Joined: Wed Jul 20, 2016 8:22 am

Re: Error seen when using WebAuthor - ro.sync.servlet.ServletDocumentModelCache

Post by mihai_coanda »

Hello,

This error occurs when one user tries to invoke actions on behalf of another user

Code: Select all

User with id user2711956834878428666 is trying to access a document that belongs to the user user-1474907160811
This should never happen unless one tries to act on a document opened in another session. Somehow another user is requesting validation for another user's document.
For further support you can send us your connector plugin and other customization that you have on support@oxygenxml.com

Mihai.
Michael

https://www.oxygenxml.com
gfloodgate
Posts: 3
Joined: Thu May 02, 2013 6:22 pm

Re: Error seen when using WebAuthor - ro.sync.servlet.ServletDocumentModelCache

Post by gfloodgate »

Hello,

For the benefir of anyone else coming to this post - we found the cause of the issue - and the workaround.

Cause:
Fundamentally, Oxygen WebAuthor (at the time of writing 18.0.0.6) cannot be deployed in the root context /
If you deploy it under tomcat as ROOT.war - it will deploy, but fail, exhibiting the behaviour seen above.

Workaround:
To deploy an application that works, deploy as a non-root war, e.g. oxygen-webapp.war -- > context /oxygen-webapp/


The Oxygen webauthor team have an internal case to address/resolve this issue in a future release.


Regards
Gareth
manojdcoder
Posts: 66
Joined: Thu Oct 29, 2020 12:01 am

Re: Error seen when using WebAuthor - ro.sync.servlet.ServletDocumentModelCache

Post by manojdcoder »

Is this still a issue with Oxygen Web Author v24.0.0.3?

We are getting similar errors,

Code: Select all

ERROR ro.sync.servlet.ServletDocumentModelCache - User with id user-5941103954281694114 is trying to access a document that belongs to user email@domain.com
ERROR ro.sync.servlet.errors.DefaultExceptionHandler - java.lang.IllegalMonitorStateException
null
at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease
ERROR ro.sync.servlet.ServletDocumentModelCache - User with id user-3888116546948513792 to access a document that belongs to user email@domain.com
ERROR ro.sync.servlet.errors.DefaultExceptionHandler - javax.ws.rs.NotAllowedException: RESTEASY003650: No resource method  found for GET, return 405 with Allow header
mihai_coanda
Posts: 63
Joined: Wed Jul 20, 2016 8:22 am

Re: Error seen when using WebAuthor - ro.sync.servlet.ServletDocumentModelCache

Post by mihai_coanda »

Hello,
We fixed the issue generating the initial post's issue a while back.
Even though it is the same exception as you are experiencing I think that the causes are different.
Is the Web Author in your deployment deployed at ROOT context ('/')?
I see in your exception, that there is a username 'email@domain.com' that does not match the template the WA generates (random strings).
I suspect that you have multiple applications deployed on the same domain and one of the other applications uses the same cookie name _uid as the Web Author to store information, overriding the cookie the WA set.
If this is the case, the cookies are usually set to a path to prevent this from happening so you will have to investigate what other application sets the cookie by analyzing the Networks tab of the browser developer.

Best Regards,
Michael
Michael

https://www.oxygenxml.com
manojdcoder
Posts: 66
Joined: Thu Oct 29, 2020 12:01 am

Re: Error seen when using WebAuthor - ro.sync.servlet.ServletDocumentModelCache

Post by manojdcoder »

In our case Web Author is not deployed at ROOT context.
e.g https://oxygen.domain.com/web-author-co ... tegration/

The tomcat logs show both random user id (user-5941103954281694114) and the email (username).

Where / How do I override the cookie?
Which Network call I'm looking for, could you give me the value of the API path or something?
Last edited by manojdcoder on Fri Jul 01, 2022 5:32 am, edited 1 time in total.
manojdcoder
Posts: 66
Joined: Thu Oct 29, 2020 12:01 am

Re: Error seen when using WebAuthor - ro.sync.servlet.ServletDocumentModelCache

Post by manojdcoder »

We have multiple deployments but seeing the above issue with this one only. With all other deployments the Average usage time is a valid positive number, but with this particular deployment, the Average usage time is -41 seconds.

Also, all the license seats are consumed by single user when the user starts opening multiple Oxygen Editors in same browser. This is not the case with other deployments, only one seat is consumed per user.
Screen Shot 2022-07-01 at 7.54.45 AM.png
Screen Shot 2022-07-01 at 7.54.45 AM.png (53.82 KiB) Viewed 207 times
mihai_coanda
Posts: 63
Joined: Wed Jul 20, 2016 8:22 am

Re: Error seen when using WebAuthor - ro.sync.servlet.ServletDocumentModelCache

Post by mihai_coanda »

Is the Web Author deployed on the same URL as other applications?
An external entity is setting the cookie with the value email@domain.com, overriding the cookie value set by the Web Author and breaking part of its functionality.
To overcome these issues you will have to identify the request setting the cookie with that value.
The request is probably made to an endpoint outside the Web Author so it depends on your environment.
For easier analysis:
  • open an incognito tab
  • open the browse's developer tool and switch to its network tab
  • open the Web Author in that tab and reproduce the issue
  • right-click on the requests list and export the requests as HAR with content (Save all as HAR with content)
  • Open the saved HAR file with a text editor and see which of the requests set the _uid cookie with the wrong value ( 'email@domain.com')
    - you could search in the file for the value directly.
You can also analyze the current cookies in the developer tool's Application tab. You might have multiple _uid cookies set on different paths and it might be a cookie path generated issue.

The License Server issue is most likely generated by this cookie conflict so you can ignore it till you fix this issue.
Michael

https://www.oxygenxml.com
manojdcoder
Posts: 66
Joined: Thu Oct 29, 2020 12:01 am

Re: Error seen when using WebAuthor - ro.sync.servlet.ServletDocumentModelCache

Post by manojdcoder »

No, Web Author always runs on its own domain, an Apache Tomcat with only Web Author installation on an Azure VM.
When I said we have multiple Web Author applications, I meant having multiple Web Author installations each installed on their own domain / server running the same version, plugins, code.

We do have an external API call on WebappEditingSessionLifecycleListener.editingSessionAboutToBeStarted, based on the result we decide whether or not the current user can access web author, if the user doesn't have access we do throw new EditingSessionOpenVetoException(...);

As I mentioned already, all our Web Author installations are running the same code on similar server configurations. Yet, we have this issue with only one particular installation so far.

Let me debug the network calls. But please do let me know if you figured anything based on above information.
Post Reply