Play Framework Date Parse Error - session

So i am having this issue with the play framework session dropping Play Session Dropping during payment tracking
I recently checked my logs and notices this stack trace coming up frequently
[debug] application - An invalidate date was received: Sat, 03 Oct 2015 23:08:37 UTC
java.lang.IllegalArgumentException: Invalid format: "Sat, 03 Oct 2015 23:08:37 UTC" is malformed at " UTC"
at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:873) ~[joda-time.joda-time-2.3.jar:2.3]
at controllers.AssetInfo$.parseDate(Assets.scala:106) ~[com.typesafe.play.play_2.11-2.3.8.jar:1.0-SNAPSHOT]
at controllers.AssetsBuilder$$anonfun$controllers$AssetsBuilder$$maybeNotModified$3.apply(Assets.scala:326) [com.typesafe.play.play_2.11-2.3.8.jar:1.0-SNAPSHOT]
at controllers.AssetsBuilder$$anonfun$controllers$AssetsBuilder$$maybeNotModified$3.apply(Assets.scala:325) [com.typesafe.play.play_2.11-2.3.8.jar:1.0-SNAPSHOT]
at scala.Option.flatMap(Option.scala:170) [org.scala-lang.scala-library-2.11.1.jar:na]
I looked at this post on github (https://github.com/playframework/playframework/issues/3569) which is similar and says fixed but not sure if my version has the fix. I am using version 2.3.8.
Could this be causing my request to not have my session since it can not even parse the request?
Also do I need to update my version to fix this issue ?

Related

How to find which method is called when going to route?

I am getting too many redirects error I and want to find in which method this happens. The url I am going is
https://localhost:8443/OpenELIS-Global/
I tried searching codebase for OpenELIS-Global but I could not find something related with routes.
Also searched for #GetMapping - also nothing with OpenELIS-Global.
How do I find which method is called when going to that route?
In symfony can simply use
php bin/console debug:router
It is unbelievable if there is no similar command for spring.
Update
Base on the answer: spring version 5, as I understand MVC because there are controller files, log framework - I see there is log4j-1.2.8.jar
Update
The application I am working on looks like is forked from https://github.com/I-TECH-UW/OpenELIS-Global-2 . Just last commit being used is from 2021 if I remember well.
Update
Based on Jordi answer I added logging configs. It shows for most routes but for one route - https://localhost:8443/OpenELIS-Global/ which was giving problems (ketp redirecting to itself) and I did not know where to debug it - it still does not show:
When going to https://localhost:8443/OpenELIS-Global url, there are redirects
as you can see there were 3 requess but only login and home routes shown in log:
openelisglobal-webapp | 26 Apr 2022 17:31:55 -- TRACE -- Mapped to org.openelisglobal.login.controller.LoginPageController#showLoginPage(HttpServletRequest, Principal)
openelisglobal-webapp | 26 Apr 2022 17:31:55 -- TRACE -- Mapped to org.openelisglobal.login.controller.LoginPageController#showLoginPage(HttpServletRequest, Principal)
openelisglobal-webapp | 26 Apr 2022 17:31:55 -- TRACE -- Mapped to org.openelisglobal.home.controller.HomeController#showPanelManagement(HttpServletRequest)
openelisglobal-webapp | 26 Apr 2022 17:31:55 -- TRACE -- Mapped to org.openelisglobal.home.controller.HomeController#showPanelManagement(HttpServletRequest)
With another guy I discussed - it was somehow complicated done - the root route compressed in .war file.
src/main/resources/log4j2.properties:
loggers=rolling,routes
logger.routes.name=org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
logger.routes.level = trace
logger.routes.appenderRefs = file, console
logger.routes.appenderRef.file.ref = RollingFile
logger.routes.appenderRef.console.ref = STDOUT
Update
Added
logging.level.org.springframework.web=debug
to src/main/resources/application.properties
from Antoniossss answer.
Intellij shows that it is unused property.
And it shows logs from Jordi config as I understand
openelisglobal-webapp | 26 Apr 2022 21:56:15 -- TRACE -- Mapped to org.openelisglobal.login.controller.LoginPageController#showLoginPage(HttpServletRequest, Principal)
openelisglobal-webapp | 26 Apr 2022 21:56:15 -- TRACE -- Mapped to org.openelisglobal.login.controller.LoginPageController#showLoginPage(HttpServletRequest, Principal)
openelisglobal-webapp | 26 Apr 2022 21:56:15 -- TRACE -- Mapped to org.openelisglobal.login.controller.LoginPageController#showLoginPage(HttpServletRequest, Principal)
openelisglobal-webapp | 26 Apr 2022 21:56:15 -- TRACE -- Mapped to org.openelisglobal.login.controller.LoginPageController#showLoginPage(HttpServletRequest, Principal)
openelisglobal-webapp | 26 Apr 2022 21:56:15 -- TRACE -- Mapped to org.openelisglobal.login.controller.LoginPageController#showLoginPage(HttpServletRequest, Principal)
openelisglobal-webapp | 26 Apr 2022 21:56:15 -- TRACE -- Mapped to org.openelisglobal.login.controller.LoginPageController#showLoginPage(HttpServletRequest, Principal)
By one hand, there is some additional information that could be useful in order to provide a more concrete answer: Spring Version (5 ?), assuming Spring MVC, and also the log framework that you are using.
By other hand, there are mainly two approaches to analyse routes further than what you can deduce directly looking into your code:
Activate a log level detailed enough that shows information on the URL mappings.
Debug the application in your IDE with the help of Spring source code; going to some specific Spring MVC classes and methods. As your url refers to localhost, I assume you will be able to do that.
Both approaches are detailed here: How to debug Spring MVC url mapping?
It is an old post with some recent updates in which two most voted answers provide details on the commented approaches.
Added info
According to the additional info provided, it seems clear you are using log4j2. It is a mavenized project, the maven pom.xml config file contains a log4j2 specific version config (2.17.1). Also, in src/main/resources you can find a log4j2.properties config file.
You can configure there a specific logger, similar to the following config (it has not been tested):
loggers=rolling,routes
logger.routes.name=org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
logger.routes.level = trace
logger.routes.appenderRefs = file, console
logger.routes.appenderRef.file.ref = RollingFile
logger.routes.appenderRef.console.ref = STDOUT
You can add also a more generic one for org.springframework.web to debug level.
This will probably help, as stated in the referenced post.
I would simply turn on loggin with (application.properties)
logging.level.org.springframework.web=debug
this will disclose some information about existing mappiongs and which handler methods are picked upt to serve incoming requests as well as used response handlers.

Any query returns TypeError: Failed to fetch in launchpad.graphql.com

If i create a new pad, the example Hello world from the repository will also give an error " TypeError: Failed to fetch". Also with other queries
As mentioned here:
We will be sunsetting Launchpad on December 15, 2018 now that our hosting platform, Auth0 Extend, is discontinuing their service. We decided to not invest time into moving to another service because more full-featured Apollo Server playgrounds currently exist. Please migrate all examples to either CodeSandbox or Glitch before December 15, 2018 so you don’t lose your work.

Datetime is saving -5:30 in database

I'm passing datetime to api from my application, but is is saving 5:30 less in database. I'm using laravel for api & react in frontend application.
My date format is, Thu Oct 12 2017 11:00:00 GMT+0530 (IST).
When I checked in database, it saved as 2017-10-12 05:30:00.
How can I save exact datetime ?
Thank You
By default laravel set your application timezone to UTC, you have to configure the timezone in config/app.php as 'timezone' => 'Asia/Kolkata'
you can refer different timezones here

Magento on my MAMP server will sometimes not load anything

I installed Magento a 4 days ago on my MacBook. Everything that day worked with no problems.
But today when I refresh a page sometimes not all the time the page returns blank.
It gets even weirder when I check the headers return by the server I get a Status Code 200.
Here are some screenshot of Google Chrome developer bar:
I feel that this problem is related to this one: It seems that not all of my HTML page loads in some browsers
I haven't found any solutions to that one either.
Also I am unable to access the admin section of the website (//127.0.0.1:8888/Editions_Panda/magento/admin). I just get this error:
Unable to load the webpage because the server sent no data.
Error code: ERR_EMPTY_RESPONSE
I am using Magento 1.7.0.2.
Allot of my server informations are found in the second image. If you need more information please do ask.
UPDATE
I found this in my Apache error logs, after I refresh one of the pages that did not want to load:
[Thu Jul 25 04:18:04 2013] [notice] child pid 46575 exit signal Segmentation fault (11)
[Thu Jul 25 04:18:08 2013] [notice] child pid 46576 exit signal Segmentation fault (11)
I just needed to change the caching in MAMP from XCache to APC or something else.

twitter4j api to post image to twitter,

I use twitter4j api to post image to twitter, initially my project worked without any exception but after further development it became unresponsive. Below is the error log form eclipse logcat.
com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate:
current time: Fri May 10 12:37:38 IST 2013, expiration time: Fri May 10 05:29:59 IST 2013
TwitterException{exceptionCode=[f69e96cd-138ff489 f69e96cd-138ff438 f69e96cd-138ff438 f69e96cd-138ff438 f69e96cd-138ff438], statusCode=-1, retryAfter=0, rateLimitStatus=null, version=2.1.6}
This happened since last night and I cant figure out whether this is due to twitter server error or not.
Somehow it seems the Certs are linked to your current date/time and any modification made there will cause this exception. Even I'm hunting for a perfect answer/resolution to this issue.

Resources