0
votes

I have a Spring application, which works fine locally, but when ran on an external server fails with the following error:

org.apache.jasper.JasperException: /WEB-INF/jsp/index.jsp(53,28) The function size must be used with a prefix when a default namespace is not specified org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148) org.apache.jasper.compiler.Validator$ValidateVisitor$1FVVisitor.visit(Validator.java:1506) org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:129) org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:200) org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:242) org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:56) org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:200) org.apache.jasper.compiler.Validator$ValidateVisitor.validateFunctions(Validator.java:1531) org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1176) org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:846) org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:865) org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417) org.apache.jasper.compiler.Node$Root.accept(Node.java:495) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1763) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198) org.apache.jasper.compiler.Compiler.compile(Compiler.java:354) org.apache.jasper.compiler.Compiler.compile(Compiler.java:334) org.apache.jasper.compiler.Compiler.compile(Compiler.java:321) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238) org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

This seems to be because I am calling this method to get the locations of CSS files etc:

<link rel="stylesheet" href="${brandBean.getHostedCSSLocation()}style.css" 

which is in the head of my JSP page. This method returns a String:

public String getHostedImageLocation(){
    return "http://test.name:9999/Resources/resources/css/";
}

The object is passed in, via the page controller.

Is there something I need to install on this server to get this to work? It seems the objects aren't being used as they are locally.

1
Looks like brandBean.getHostedCSSLocation() isn't set as attribute on any scope: page, request, session, application.Luiggi Mendoza
Do you know why it would work locally? I am not familiar with scopes, what scope would you recommend?Jon
Maybe there's a code or an external factor that injects this value in an attribute of any of these. Make sure the same WAR application is deployed on both your local development machine and test/production environment.Luiggi Mendoza
It just returns that string, the war files are the same. Maybe there's something I need to install on the server? Are there any xml files that wouldn't be included in the war that need to be the same, do you know?Jon
What server & version are you running locally and what is the server and version on the external system?clav

1 Answers

0
votes

It seems the server I was trying to run the app on was running Tomcat 6 and a simple update did the trick.