Absh Van

Greenhorn
+ Follow
since Dec 05, 2021
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Absh Van

I am downloading a large volume file and while downloading the spinner.show it just displayed for few seconds and then disappeared.

I want to show the spinner wheel till the file downloaded is complete.

I am using Angular 5, below is the code snippet.



Please help me whether I need to make any change in the code or any other options available.
2 months ago
Here are the details, I have commented the spring specific session in the web.xml file.

SpringMVC 5.0.4
Folder structure
+StanWeb
+Java Resources
+src/main/java
+src/main/resources
+config
+Libraries
+JavaScript Resources
+Referenced Libraries
+Deployed Resources
+src
 +main
  +java
  +resources
  +webapp
   +META-INF
   +views
   +resources
   +WEB-INF
    +lib
    -dispatcher-servlet.xml
    -spring-security.xml
    -web.xml
pom.xml  

-web.xml

-dispatcher-servlet.xml

Could you please confirm whether the response.sendredirect is not causing this error.
4 months ago
While trying to submit a page transaction, I am logged out from the application, added error details.
Application running on Tomcat 9, login based on CA SSO and SpringMVC 5 framework

Error Details
java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed
at org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:488)
at javax.servlet.http.HttpServletResponseWrapper.senditedirect(HttpServletResponseWrapper.java:138)
at org.springframework.security.web.firewall.FirewalledResponse.sendRedirect(FirewalledResponse.java:44)
at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponsewrapper.java:138)
at org.springframework.security.web.util.OnCommittedResponseWrapper.sendRedirect(OnCommittedResponseWrapper.java:129)
at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:138)
at org.springframework.security.web.util.OnCommittedResponseWrapper.sendRedirect(OnCommittedResponseWrapper.java:129)
at com.Stanweb.web.ApplicationFilter.httpErrorRedirectURL(ApplicationFilter.java:125)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptar.invoke(FilterSecurityInterceptor.java:127)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at org.springframework.security.web.FilterChainProxySVirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:121)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1723)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

Code


Springsecurity
5 months ago
While downloading the PDF file from my UI, I am getting below error message.
I am using SpringMVC 5.x, Tomcat 9.x and Java 8 for the development.

Dependencies
fr.opensagres.xdocreport version 2.0.2
org.apache.poi version 4.0.1

Error details
[Abstract TemplateEngine.java:Executor-1:128] End template engine id-Velocity for the entry-word/endnotes.xml done with 4(ms).
[AbstractXDocReport.java:Executor-1:725] End convert report with error done with 145(ms).
fr.opensagres.xdocreport.converter.XDocConverterException: java.lang.NoClassDefFoundError: Could not initialize class org.apache.poi.ooxml. POIXML TypeLoader
at fr.opensagres.xdocreport.document.AbstractXDocReport.convert(AbstractXDocReport.java:745)
at com.ltm.docs.execute(PdfDownload.java:128)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxySCglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecution Interceptor-java:115)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.poi.ooxml.POIXMLTypeLoader
at org.apache.pol.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:161)
at org.apache.poi.ooxml.POIXMLDocument.load(POIXML Document.java:169)
at org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:126)
at fr.opensagres.xdocreport.converter.docx.poi.itext.XWPF2PDFViaITextConverter.convert(XWPF2PDFViaITextConverter.java:66)
at fr.opensagres.xdocreport.document.AbstractXDocReport.convert(AbstractXDocReport.java:710)
... 14 more
[AbstractPlatformTransaction Manager.java:Executor-1:743] Initiating transaction commit



Code Snippet


getting error here - report.convert(context, options, fileOutput);  
5 months ago
Thank you Tim,
We have increased the RAM size, now the issue is solved.
6 months ago
We have removed log4j version 1.2.17 dependency from the pom.xml file while generating the war we still see the log4j dependency in the war file.

We are using slf4j-log4j12 version 1.2.37 for logger. We ran the maven dependency tree and found the transient dependency.

We have used the exclusion to remove the log4j dependency but still the log4j getting added in the war file.

Attached the dependency for your reference.



Maven dependency tree


Please help how to remove the log4j dependency.
6 months ago
We have deployed the java war file in server, the application is hosted in Tomcat webserver.

While loading the application we are getting java.lang.OutOfMemoryError issue which makes the application stop.

We  are using Java version 8 and Tomcat version 8.

Attached error details, please let me know if any configuration needs to be verified?


SEVERE [28] org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run Unexpected death of background thread [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
java.lang.OutOfMemoryError: GC overhead limit exceeded

SEVERE [76] org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun
java.lang.ArrayIndexOutofBoundaException: -20
at sun.security.provider.SecureRandom.engineNextBytes(SecureRandom.java:252)
at sun.security.provider.NativePRNG$RandomIO.implNextBytes(NativePRNG.java:535)
at sun.security.provider.NativePRNG$RandomIO.access$400(NativePRNG.java:331)
at sun.security.provider.NativePRNG.engineNextBytes(NativePRNG.java:220)
at java.security.SecureRandom.nextBytes(SecureRandom.java:468)
at sun.security.util.KeyUtil.checkTlsPreMasterSecretKey(KeyUtil.java:268)
at com.sun.crypto.provider.RSACipher.engineUnwrap(RSACipher.java:480)
at javax.crypto.Cipher.unwrap(Cipher.java:2553)
at sun.security.ssl.RSAKeyExchange$RSAPremasterSecret.decode(RSAKeyExchange.java:185)
at sun.security.ssl.RSAC1ientKeyExchange$RSAClientKeyExchangeConsumer.consume(RSAClientKeyExchange.java:285)
at sun.security.ssl.ClientKeyExchange$ClientKeyExchangeConsumer.consume(ClientKeyExchange.java:110)
at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:377)
at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:444)
at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:968)
at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:955)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:902)
at org.apache.tomcat.util.net.SecureNioChannel.tasks(SecureNioChannel.java:423)
at org.apache.tomcat.util.net.SecureNioChannel.handshakeUnwrap(SecureNioChannel.java:483)
at org.apache.tomcat.util.net.SecureNioChannel.handshake(SecureNioChannel.java:238)
at org.apache.tomcat.util.net.NioEndpointSocketProcessor.doRun(NioEndpoint.java:1475)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExcutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run (TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000642344808> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)


https-jsse-nio-8443-exec-71 #120 daemon prio=5 os_prio=0 tid=0x000071509c004000 nid=0x48b1 waiting on condition [0x00007150129f000]
java lang Thread State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
-parking to wait for <0x0000000642344808> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java.2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue java:442)
at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
at org apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
at java.util.concurrent.ThreadPoolExecutor.get.Task(ThreadPoolExecutor.java:1074)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
at java util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

6 months ago