Announcement Announcement Module
Collapse
No announcement yet.
Problem running PetClinic in JRun4 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem running PetClinic in JRun4

    hi all,
    i'm a newbie to Spring. I downloaded Spring 1.1.1. I'm currently trying to install the PetClinic demo but i'm getting a pageContext error. I'm not sure how to fix this, please help! Thank you.


    Internal error
    ** Root cause is: Compiler errors: Found 1 semantic error compiling "C:/JRun4/servers/SpringSamples/default-ear/petclinic-war/WEB-INF/jsp/jrun__WEB2dINF__jsp__findOwners2ejsp1b.java": 61. status = (org.springframework.web.servlet.support.BindStatu s) pageContext.findAttribute("status"); <----> *** Error: No entity named "status" was found in this environment. jrunx.compiler.DefaultCFE: Compiler errors: Found 1 semantic error compiling "C:/JRun4/servers/SpringSamples/default-ear/petclinic-war/WEB-INF/jsp/jrun__WEB2dINF__jsp__findOwners2ejsp1b.java": 61. status = (org.springframework.web.servlet.support.BindStatu s) pageContext.findAttribute("status"); <----> *** Error: No entity named "status" was found in this environment. at jrunx.compiler.JavaCompiler.compile(JavaCompiler.j ava:135) at jrunx.compiler.JavaCompiler.compile(JavaCompiler.j ava:94) at jrun.jsp.Translator.compilePage(Translator.java:17 6) at jrun.jsp.Translator.translate(Translator.java:254) at jrun.jsp.Translator.translate(Translator.java:101) at jrun.jsp.JSPEngine.translateJSP(JSPEngine.java:693 ) at jrun.jsp.JSPServlet.translate(JSPServlet.java:125) at jrun.jsp.JSPServlet.service(JSPServlet.java:113) at jrun.servlet.ServletInvoker.invoke(ServletInvoker. java:91) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvok erChain.java:42) at jrun.servlet.JRunRequestDispatcher.invokeNext(JRun RequestDispatcher.java:449) at jrun.servlet.JRunRequestDispatcher.forwardInvoke(J RunRequestDispatcher.java:418) at jrun.servlet.JRunRequestDispatcher.forward(JRunReq uestDispatcher.java:175) at org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel(InternalResourceVi ew.java:91) at org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:241) at org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:678) at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:562) at org.springframework.web.servlet.FrameworkServlet.s ervice(FrameworkServlet.java:321) at javax.servlet.http.HttpServlet.service(HttpServlet .java:853) at jrun.servlet.ServletInvoker.invoke(ServletInvoker. java:91) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvok erChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequ estDispatcher.java:249) at jrun.servlet.ServletEngineService.dispatch(Servlet EngineService.java:527) at jrun.servlet.http.WebService.invokeRunnable(WebSer vice.java:168) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRu nnable(ThreadPool.java:457) at jrunx.scheduler.WorkerThread.run(WorkerThread.java :66) Cookies:

  • #2
    The Tracev1.1.1)

    <H2>Internal error</H2>
    <P>
    Code:
    ** Root cause is&#58; Compiler errors&#58;
    Found 1 semantic error compiling "E&#58;/JRun/servers/default/SERVER-INF/temp/petclinic.war-1661684858/WEB-INF/jsp/jrun__WEB2dINF__jsp__findOwners2ejsp1b.java"&#58;
    
        61.  status = &#40;org.springframework.web.servlet.support.BindStatus&#41; pageContext.findAttribute&#40;"status"&#41;;
             <---->
    *** Error&#58; No entity named "status" was found in this environment.
    
    jrunx.compiler.DefaultCFE&#58; Compiler errors&#58;
    Found 1 semantic error compiling "E&#58;/JRun/servers/default/SERVER-INF/temp/petclinic.war-1661684858/WEB-INF/jsp/jrun__WEB2dINF__jsp__findOwners2ejsp1b.java"&#58;
    
        61.  status = &#40;org.springframework.web.servlet.support.BindStatus&#41; pageContext.findAttribute&#40;"status"&#41;;
             <---->
    *** Error&#58; No entity named "status" was found in this environment.
    
    	at jrunx.compiler.JavaCompiler.compile&#40;JavaCompiler.java&#58;138&#41;
    	at jrunx.compiler.JavaCompiler.compile&#40;JavaCompiler.java&#58;97&#41;
    	at jrun.jsp.Translator.compilePage&#40;Translator.java&#58;176&#41;
    	at jrun.jsp.Translator.translate&#40;Translator.java&#58;254&#41;
    	at jrun.jsp.Translator.translate&#40;Translator.java&#58;101&#41;
    	at jrun.jsp.JSPEngine.translateJSP&#40;JSPEngine.java&#58;693&#41;
    	at jrun.jsp.JSPServlet.translate&#40;JSPServlet.java&#58;125&#41;
    	at jrun.jsp.JSPServlet.service&#40;JSPServlet.java&#58;113&#41;
    	at jrun.servlet.ServletInvoker.invoke&#40;ServletInvoker.java&#58;91&#41;
    	at jrun.servlet.JRunInvokerChain.invokeNext&#40;JRunInvokerChain.java&#58;42&#41;
    	at jrun.servlet.JRunRequestDispatcher.invokeNext&#40;JRunRequestDispatcher.java&#58;439&#41;
    	at jrun.servlet.JRunRequestDispatcher.forwardInvoke&#40;JRunRequestDispatcher.java&#58;409&#41;
    	at jrun.servlet.JRunRequestDispatcher.forward&#40;JRunRequestDispatcher.java&#58;178&#41;
    	at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel&#40;InternalResourceView.java&#58;91&#41;
    	at org.springframework.web.servlet.view.AbstractView.render&#40;AbstractView.java&#58;241&#41;
    	at org.springframework.web.servlet.DispatcherServlet.render&#40;DispatcherServlet.java&#58;678&#41;
    	at org.springframework.web.servlet.DispatcherServlet.doService&#40;DispatcherServlet.java&#58;562&#41;
    	at org.springframework.web.servlet.FrameworkServlet.service&#40;FrameworkServlet.java&#58;321&#41;
    	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;853&#41;
    	at jrun.servlet.ServletInvoker.invoke&#40;ServletInvoker.java&#58;91&#41;
    	at jrun.servlet.JRunInvokerChain.invokeNext&#40;JRunInvokerChain.java&#58;42&#41;
    	at jrun.servlet.JRunRequestDispatcher.invoke&#40;JRunRequestDispatcher.java&#58;252&#41;
    	at jrun.servlet.ServletEngineService.dispatch&#40;ServletEngineService.java&#58;527&#41;
    	at jrun.servlet.http.WebService.invokeRunnable&#40;WebService.java&#58;168&#41;
    	at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable&#40;ThreadPool.java&#58;348&#41;
    	at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable&#40;ThreadPool.java&#58;451&#41;
    	at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable&#40;ThreadPool.java&#58;294&#41;
    	at jrunx.scheduler.WorkerThread.run&#40;WorkerThread.java&#58;66&#41;
    
    Cookies&#58;
    
    org.springframework.web.servlet.theme.CookieThemeResolver.THEME=&#91;theme&#93;
    DEFAULTFORMAT=&#91;specific&#93;
    BUGLIST=&#91;&#93;
    VERSION-TestProduct=&#91;other&#93;
    LASTORDER=&#91;bugs.bug_id&#93;
    JSESSIONID=&#91;5e301746491097807250640&#93;

    Comment


    • #3
      me too! (I hate these types of posts)

      I really hate seeing 'me, too!' posts, when they don't add any new information to the problem discussion...

      HOWEVER, I do feel that I need to register my vote for a resolution of this issue, since it's holding up a very aggressive deadline I have at work. I haven't dug into the taglib sources yet to take a stab at fixing it - that's my next move, but I will contribute this information for starters:

      I'm having this problem (the 'status' pagecontext attribute not being bound) from within MY OWN webapp, wherein I'm using the spring:bind tag. So, it's not specific to the jPetclinic. Also, I'm using spring-1.0.2 rather than spring-1.1.x so it's pervasive throughout the versions apparently.

      Anyway, there's my 2-cents, and now I'm off to dig into the sources.

      Thanks for any help you can offer.

      -john

      Comment


      • #4
        Eureka! Found the problem, and I have a workaround.

        The problem is that JRun 4 mishandles the <variable> element in the spring TLD.

        Here is the relevant bug information on the Macromedia site:

        http://tinyurl.com/6axfb

        As you can see, this thread took place in 2001...apparently either the bug didn't actually get filed, or it hasn't been resolved. I have confirmed that this bug still exists in JRun 4 Update 4, and that the workaround given in the support thread works.

        Here is the workaround:

        Modify the spring.tld file (embedded in the spring.jar archive) to have a <declare>true</declare> sub-element within each <variable/> element...it will look similar to this:

        Code:
        	<tag>
        
        		<name>hasBindErrors</name>
        		<tag-class>org.springframework.web.servlet.tags.BindErrorsTag</tag-class>
        		<body-content>JSP</body-content>
        
        		<description>
        			Provides Errors instance in case of bind errors.
        		</description>
        
        		<!-- Note&#58; Was "Integer count" in earlier version -->
        		<variable>
        			<name-given>errors</name-given>
        			<variable-class>org.springframework.validation.Errors</variable-class>
                    <declare>true</declare>
        		</variable>
        
        		<!-- Note&#58; Now one Errors instance per bind object -> name of object needed -->
        		<attribute>
        			<name>name</name>
        			<required>true</required>
        			<rtexprvalue>true</rtexprvalue>
        		</attribute>
        
        		<attribute>
        			<name>htmlEscape</name>
        			<required>false</required>
        			<rtexprvalue>true</rtexprvalue>
        		</attribute>
        
        	</tag>
        
        
        	<tag>
        
        		<name>bind</name>
        		<tag-class>org.springframework.web.servlet.tags.BindTag</tag-class>
        		<body-content>JSP</body-content>
        
        		<description>
        			Provides BindStatus object for the given bind path.
        		</description>
        
        		<!-- Note&#58; Was "bind" in earlier version -->
        		<variable>
        			<name-given>status</name-given>
        			<variable-class>org.springframework.web.servlet.support.BindStatus</variable-class>
                    <declare>true</declare>
        		</variable>
        
        		<!-- Note&#58; Was "value" in earlier version -->
        		<attribute>
        			<name>path</name>
        			<required>true</required>
        			<rtexprvalue>true</rtexprvalue>
        		</attribute>
        
        		<attribute>
        			<name>htmlEscape</name>
        			<required>false</required>
        			<rtexprvalue>true</rtexprvalue>
        		</attribute>
        
        	</tag>
        Note the <variable> elements in this snippet. Once I modified the TLD to include <declare>true</declare>, everything magically worked.

        I'll be filing a support request in Spring to add this element, since it will make the library more compatible without compromising correctness.

        Enjoy!

        -john[/url]

        Comment

        Working...
        X