Tomcat error when referencing component link: attribute pageURI is mandatory - tridion

Currently my pages are returning errors since I've begun implementing XPM into are JSP environment. The component links seems to be the problem here. It was working fine several days ago, now we continiously get these Tomcat errors:
SEVERE: Servlet.service() for servlet [jsp] in context with path [/JSPStaging] threw exception [/en_nl/system/footer.jsp (line: 10, column: 8) According to the TLD or the tag file, attribute pageURI is mandatory for tag ComponentLink] with root cause org.apache.jasper.JasperException: /en_nl/system/footer.jsp (line: 10, column: 8) According to the TLD or the tag file, attribute pageURI is mandatory for tag ComponentLink
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:408)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:237)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:858)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1539)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:475)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1795)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
at org.apache.jsp.en_005fnl.index2_jsp._jspService(index2_jsp.java:137)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.tridion.preview.web.BinaryContentFilter.doFilter(BinaryContentFilter.java:55)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.tridion.preview.web.PageContentFilter.doFilter(PageContentFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.tridion.ambientdata.web.AmbientDataServletFilter.doFilter(AmbientDataServletFilter.java:255)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Weirdly enough, the componentlinks on the plain JSP file are there, including the PageURI.:
<tridion:ComponentLink runat="server" PageURI="tcm:17-480-64" ComponentURI="tcm:17-795" TemplateURI="tcm:0-0-0" AddAnchor="false" LinkText="<img src="/Images/women_edfd8f3453414ade82b7becaa0790386.jpg" alt="Woman #1">" LinkAttributes="" TextOnFail="true"/>
as well as properly including the cd_tags lib into every seperate page template, along with the proper core references:
<%# page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%# taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%# taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%# taglib uri="cd_tags" prefix="tridion" %>
I've tried searching for the error, but there's no Tridion context-specific solution. I'm currently looking into resetting/reconfiguring component linking, but I'm not entirely sure if there's anything wrong in the configs in the first place. Any ideas would be fantastic.

That link is for the .NET control -- not the JSP tag library.
Maybe someone changed the Target Language on the Publication Target you are using (or it's published to the wrong target)? Another possibility is that it is hard-coded in the template instead of using TCDL.

Thanks to Peter Kjaer pointing me in the direction, this issue is now solved. It is not, however, due to publication targets and language (since they were set correctly - but I wouldn't completely rule out the possibilty of pubtargets conflicting).
The issue turned out to be the deployer_conf xml file on the HTTP upload server role, with its (default) lines within the TCDLEngine node - Properties.
<!--<Property Name="tcdl.dotnet.style" Value="controls"/>-->
<Property Name="tcdl.jsp.style" Value="tags"/>
As you can see, I commented the dotnet line. It will now properly resolve links, as well as componentlinks not including 'runat's anymore.

Related

Compiled Jar keeps throwing: Uncaught exception in the SynchronizationContext

I have been trying to make a small application which first scans a HTML for data and then uploads it to my Firestore. I'm now essentially done with it and when starting it from within IntelliJ IDEA it works just fine. However as soon as I export it in to an artifact it starts throwing the following exception when trying to download/upload from/to Firestore!
I should mention that I'm coding in Koltin/JVM as it is way easier. Since there is no Kotlin Firebase-Admin version I'm just using the Java one which shouldn't be a problem since Kotlin compiles down to Java. If I'm wrong about that please correct me!
Nov 27, 2019 6:59:17 PM io.grpc.internal.ManagedChannelImpl$1 uncaughtException
SEVERE: [Channel<1>: (firestore.googleapis.com:443)] Uncaught exception in the SynchronizationContext. Panic!
java.lang.IllegalStateException: Could not find policy 'pick_first'. Make sure its implementation is either registered to LoadBalancerRegistry or included in META-INF/services/io.grpc.LoadBalancerProvider from your jar files.
at io.grpc.internal.AutoConfiguredLoadBalancerFactory$AutoConfiguredLoadBalancer.<init>(AutoConfiguredLoadBalancerFactory.java:97)
at io.grpc.internal.AutoConfiguredLoadBalancerFactory.newLoadBalancer(AutoConfiguredLoadBalancerFactory.java:67)
at io.grpc.internal.ManagedChannelImpl.exitIdleMode(ManagedChannelImpl.java:379)
at io.grpc.internal.ManagedChannelImpl$ChannelTransportProvider$1ExitIdleModeForTransport.run(ManagedChannelImpl.java:473)
at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:95)
at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:127)
at io.grpc.internal.ManagedChannelImpl$ChannelTransportProvider.get(ManagedChannelImpl.java:477)
at io.grpc.internal.ClientCallImpl.startInternal(ClientCallImpl.java:257)
at io.grpc.internal.ClientCallImpl.start(ClientCallImpl.java:190)
at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1.start(CensusTracingModule.java:394)
at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1.start(CensusStatsModule.java:695)
at io.grpc.ForwardingClientCall.start(ForwardingClientCall.java:32)
at com.google.api.gax.grpc.GrpcHeaderInterceptor$1.start(GrpcHeaderInterceptor.java:94)
at com.google.api.gax.grpc.GrpcDirectStreamController.startCommon(GrpcDirectStreamController.java:115)
at com.google.api.gax.grpc.GrpcDirectStreamController.start(GrpcDirectStreamController.java:101)
at com.google.api.gax.grpc.GrpcDirectServerStreamingCallable.call(GrpcDirectServerStreamingCallable.java:68)
at com.google.api.gax.grpc.GrpcServerStreamingRequestParamCallable.call(GrpcServerStreamingRequestParamCallable.java:61)
at com.google.api.gax.grpc.GrpcExceptionServerStreamingCallable.call(GrpcExceptionServerStreamingCallable.java:59)
at com.google.api.gax.rpc.WatchdogServerStreamingCallable.call(WatchdogServerStreamingCallable.java:69)
at com.google.api.gax.rpc.ServerStreamingCallable$1.call(ServerStreamingCallable.java:237)
at com.google.api.gax.rpc.ServerStreamingAttemptCallable.call(ServerStreamingAttemptCallable.java:230)
at com.google.api.gax.rpc.ServerStreamingAttemptCallable.start(ServerStreamingAttemptCallable.java:193)
at com.google.api.gax.rpc.RetryingServerStreamingCallable.call(RetryingServerStreamingCallable.java:87)
at com.google.api.gax.tracing.TracedServerStreamingCallable.call(TracedServerStreamingCallable.java:76)
at com.google.api.gax.rpc.ServerStreamingCallable$1.call(ServerStreamingCallable.java:237)
at com.google.api.gax.rpc.ServerStreamingCallable.serverStreamingCall(ServerStreamingCallable.java:166)
at com.google.api.gax.rpc.ServerStreamingCallable.serverStreamingCall(ServerStreamingCallable.java:178)
at com.google.cloud.firestore.FirestoreImpl.streamRequest(FirestoreImpl.java:474)
at com.google.cloud.firestore.FirestoreImpl.getAll(FirestoreImpl.java:243)
at com.google.cloud.firestore.FirestoreImpl.getAll(FirestoreImpl.java:253)
at com.google.cloud.firestore.FirestoreImpl.getAll(FirestoreImpl.java:143)
at com.google.cloud.firestore.DocumentReference.get(DocumentReference.java:354)
at FirebaseHandler.getLehrer(FirebaseHandler.kt:95)
at HtmReader.readFile(HtmReader.kt:12)
at MainView.theStuff(MainView.kt:61)
at MainView.onDock(MainView.kt:44)
at tornadofx.UIComponent.callOnDock$tornadofx(Component.kt:700)
at tornadofx.UIComponent$rootSceneWindowShowingPropertyChangeListener$1.changed(Component.kt:556)
at tornadofx.UIComponent$rootSceneWindowShowingPropertyChangeListener$1.changed(Component.kt:327)
at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:182)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
at javafx.beans.property.ReadOnlyBooleanPropertyBase.fireValueChangedEvent(ReadOnlyBooleanPropertyBase.java:72)
at javafx.beans.property.ReadOnlyBooleanWrapper.fireValueChangedEvent(ReadOnlyBooleanWrapper.java:103)
at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:144)
at javafx.stage.Window.setShowing(Window.java:922)
at javafx.stage.Window.show(Window.java:937)
at javafx.stage.Stage.show(Stage.java:259)
at tornadofx.App.start(App.kt:101)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)
My code which (in this case) downloads stuff is as following:
fun getLehrer(): HashMap<String, Any> {
[...]
val out = HashMap<String, Any>()
try {
val future = firestore.collection("stuff").document("lehrer").get()
future.await()
if (future.isDone) {
[...]
}
} catch (ex: Exception) {
println(" ++ cant get lehrer liste")
}
[...]
}
The error occurs at this line:
val future = firestore.collection("stuff").document("lehrer").get()
I have been trying to fix this for days now and literally spend hours googeling and trying different things but nothing has worked for me so far!
I tried:
randomly adding a LoadBalancer since I wasn't able to find any viable docs
adding the loadbalancer to my META-INF/services
I also found something that seemed similar here (https://github.com/grpc/grpc-java/issues/5493) but it talks about a load of stuff I don't use and frankly don't understand
FYI: Weirdly my icon from my resource folder turns into a completely different one in the Jar. Don't ask me why. I couldn't find an answer to that as well, but it isn't such a big issue since I can just replace that in the jar.
Oh and also this is my first question so if I made any mistakes I'm sorry! I probably made some spelling errors as well which I apologize for.
Any help would be greatly appreciated!
Hey so after googling some more I found some an article listing code snipets from LoadBalancerRegistry (https://www.codota.com/code/java/classes/io.grpc.LoadBalancerRegistry) and I scrolled around in it and found this: PickFirstBalancerFactory.init()
So i decided to look for this Factory but couldn't find it, instead I found PickFirstLoadBalancerProvider(). Remembering from randomly going through the autocomplete that in order to register something to LoadBalancerRegistry one would need a Provider.
Long story short I set them both together and added the following to the init section of my class and it works fine now!
LoadBalancerRegistry.getDefaultRegistry().register(PickFirstLoadBalancerProvider())
Thought I should answer if anyone has the same issue!
FYI: The icon still changes to that weird one. I don't know why or how thats even possible but it works if I replace it in the .jar so I don't really care xD

Stack overflow error when loading web app from Spring property resolver

It looks like there is a recursive loop in my spring set up.
I've looked in the applicationContext.xml and springapp-servlet.xml files and don't see any repeats or circular dependencies. I'm not all that familiar with spring and don't really know where to start to debug this.
Is there a way I can find out what property is being resolved?
Here's my stack dump
2014-10-04 00:39:45,872 [localhost-startStop-1] ERROR ContextLoader : Context initialization failed
java.lang.StackOverflowError
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.naming.internal.VersionHelper12.getJndiProperties(VersionHelper12.java:89)
at com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:138)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at org.springframework.jndi.JndiTemplate.createInitialContext(JndiTemplate.java:136)
at org.springframework.jndi.JndiTemplate.getContext(JndiTemplate.java:103)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
at org.springframework.jndi.JndiLocatorDelegate.lookup(JndiLocatorDelegate.java:38)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:77)
at org.springframework.jndi.JndiLocatorDelegate.lookup(JndiLocatorDelegate.java:33)
at org.springframework.jndi.JndiPropertySource.getProperty(JndiPropertySource.java:82)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:73)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:59)
at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:427)
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$1.getProperty(PropertySourcesPlaceholderConfigurer.java:131)
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$1.getProperty(PropertySourcesPlaceholderConfigurer.java:128)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:73)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:59)
at org.springframework.core.env.AbstractPropertyResolver$1.resolvePlaceholder(AbstractPropertyResolver.java:176)
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:146)
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:125)
at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:174)
at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:143)
at org.springframework.core.env.AbstractPropertyResolver.resolveNestedPlaceholders(AbstractPropertyResolver.java:163)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:76)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:59)
at org.springframework.core.env.AbstractPropertyResolver$1.resolvePlaceholder(AbstractPropertyResolver.java:176)
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:146)
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:125)
at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:174)
at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:143)
at org.springframework.core.env.AbstractPropertyResolver.resolveNestedPlaceholders(AbstractPropertyResolver.java:163)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:76)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:59)
at org.springframework.core.env.AbstractPropertyResolver$1.resolvePlaceholder(AbstractPropertyResolver.java:176)
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:146)
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:125)
at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:174)
at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:143)
at org.springframework.core.env.AbstractPropertyResolver.resolveNestedPlaceholders(AbstractPropertyResolver.java:163)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:76)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:59)
at org.springframework.core.env.AbstractPropertyResolver$1.resolvePlaceholder(AbstractPropertyResolver.java:176)
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:146)
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:125)
at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:174)
at org.springfra
that happens since you dont have the datasource property file in your classpath or the direct values in your xml definitions where you have defined datasource or session factory

Jetty ConcatServlet to handle filter generated content

I try to use jetty's ConcatServlet to concatenate javascript generated from my own servlet and javascript generated by wro4j WroFilter. It seems concatenation doesn't work, regardless the javadoc of ConcatServlet that states that it can be used to concat generated content.
I think the issue is that the wro4j content is generated by a filter an not a servlet as 'concatenating' a single source generated by my servlet works fine, while 'concatenating' the single wro4j generated resource doesn't work but I get the exception below. It complaints about a missing file, although the request /wro/script.js is served fine if requested normally. Any suggestions?
java.io.FileNotFoundException: !/wro/script.js
at org.eclipse.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:465)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:526)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:586)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1105)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:453)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1039)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
at org.eclipse.jetty.server.Dispatcher.include(Dispatcher.java:169)
at org.eclipse.jetty.servlets.ConcatServlet.doGet(ConcatServlet.java:122)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:695)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1564)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:164)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1535)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:524)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1105)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:453)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1039)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:201)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:445)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:277)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:216)
at org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532)
at java.lang.Thread.run(Thread.java:724)

Spring MVC Checkboxes Path

I have the following on the JSP
<form:form method="post" action="${submit}" id="id" commandName="object">
<form:checkboxes path="ratings" items="${ratingsList}">
Here, the ratingsList is set in the Controller.
model.put("object",object);
model.put("ratingsList",ratingsList);
I see all the checkboxes on the page when it is loaded. I am able to save it too in the ratings which is a list. But, when I come back to this page, I want that the ratings that are saved in the "ratings" - list are selected on the page.
I am getting the below error.
Caused by: org.springframework.core.convert.ConversionFailedException: Unable to convert value "[0]" from type 'java.util.List' to type 'java.lang.String'; nested exception is java.lang.IllegalArgumentException:

Want to display file list last modified in JSP

I am using spring mvc 3 and my controller is passing a List from the controller to the JSP:
List suitableMatches = new ArrayList();
...//Some code that adds Files to this list
model.addAttribute("lists", suitableMatches);
and in my jsp :
<tr>
<td class="readOnly">${list.name}</td>
<td class="readOnly">${idiomSearch.testCaseID}</td>
<td class="readOnly">${list.lastModified}</td>
<td class="readOnly">Download</td>
</tr>
But I am getting the error :
Error 500: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is javax.el.PropertyNotFoundException: Property 'lastModified' not found on type java.io.File
Can anyone tell me please ,how is it that list.lastModified is not working?
Depending on the version of the JSP Expression Language that your web server is using you might not be able to access non-getter methods with this syntax.
${list.name} works as File has a method called getName(). However, File does not have a method called getLastModified(), the method is just called lastModified() so you have to add brackets when calling a method that is not a getter.
So the code should read ${list.lastModified()} and you will need to use at least v2.2 of the EL jar so this will need to either be included explicitly in the web application or use a servlet container that already includes this library.
A good source for the el syntax can be found in stackoverflow's el tag description
you can use a combination of JSTL and expression language for this like
<jsp:useBean id="dateValue" class="java.util.Date"/>
<jsp:setProperty name="dateValue" property="time" value="${file.lastModified()}"/>
<fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss z" value="${dateValue}" />

Resources