facebook

Tiles Definition Factory

  1. MyEclipse IDE
  2.  > 
  3. Comments
Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #215995 Reply

    alashoofi
    Member

    – System Setup ——————————-
    Operating System and version: XP
    Eclipse version: 3.0
    Eclipse build id: 200406251208
    Fresh Eclipse install (y/n): Y
    If not, was it upgraded to its current version using the update manager?
    Other installed external plugins:
    Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*: 8
    MyEclipse version: 3.8BETA
    Eclipse JDK version:
    Application Server JDK version: 1.4.2-05
    Are there any exceptions in the Eclipse log file?
    !SESSION Sep 25, 2004 14:08:10.421 ———————————————
    eclipse.buildId=I200406251208
    java.version=1.5.0-rc
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US

    !ENTRY org.eclipse.pde.core 1 1 Sep 25, 2004 14:08:10.421
    !MESSAGE Problems encountered while PDE was scanning the Target Platform
    !SUBENTRY 1 org.eclipse.debug.ui 1 1 Sep 25, 2004 14:08:10.421
    !MESSAGE This plug-in (located at “c:\Program Files\Eclipse3.0\eclipse\plugins\org.eclipse.debug.ui_3.0.0”) was ignored because another version of the same plug-in (located at “C:\Program Files\MyEclipse\eclipse\plugins\org.eclipse.debug.ui_3.7.200”) was picked
    !SUBENTRY 1 org.eclipse.jdt.debug 1 1 Sep 25, 2004 14:08:10.421
    !MESSAGE This plug-in (located at “c:\Program Files\Eclipse3.0\eclipse\plugins\org.eclipse.jdt.debug_3.0.0”) was ignored because another version of the same plug-in (located at “C:\Program Files\MyEclipse\eclipse\plugins\org.eclipse.jdt.debug_3.7.200″) was picked

    – Message Body ——————————-
    I use tile definitions in my projects and so far everything works well until I changed computers. I was using a lap top running XP, but now I have a work station also running XP.

    Lap top: Eclipse 3.0; MyEclipse 3.8 Beta; Tomcat 4.1.3; Jsdk 1.4.2_05

    New work station: Eclipse 3.0; MyEclipse 3.8 Beta; Tomcat 4.1.3; Jsdk 1.4.2_05.

    Now my problem is this: I imported my project from the lap top onto the work station, code for code. Projects without tile definitions work well but those with definition fail. All mu i are dotted and my t crossed. I just keep getting this error:

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: Can’t get definitions factory 😥 from context.
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
    at java.lang.Thread.run(Thread.java:534)

    root cause

    javax.servlet.ServletException: Can’t get definitions factory from context.
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
    at org.apache.jsp.tutorialIndex_jsp._jspService(tutorialIndex_jsp.java:60)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
    at java.lang.Thread.run(Thread.java:534)

    Apache Tomcat/4.1.29

    ******************************************
    My tiles.def is like so:
    <?xml version=”1.0″ encoding=”UTF-8″?>

    <!– Definitions for Tiles –>
    <!–
    This file contains definitions common to all struts module.
    In particular, it contains the main layout and the common menus.
    There is also the main page as a portal.
    –>

    <tiles-definitions>

    <!– ======================================================= –>
    <!– Definition For dispatch –>
    <!– ======================================================= –>

    <definition name=”siteLayoutDef3″ path=”/jsp/pages/siteLayout3.jsp”>
    <put name=”title” value=”Wrox Stock Quote System” />
    <put name=”header” value=”/jsp/pages/header.jsp” />
    <put name=”footer” value=”/jsp/pages/footer.jsp” />
    <put name=”content” type=”string”>
    Content goes here
    </put>
    </definition>

    <!– ======================================================= –>
    <!– Master definition –>
    <!– ======================================================= –>

    <!– Doc index page description –>
    <!– Main Layout Definition description –>
    <definition name=”mainLayout” path=”/jsp/tutorial/classicLayout.jsp”>
    <put name=”title” value=”Alashoofi Fine Clothing” />
    <put name=”header” value=”/jsp/tutorial/header.jsp” />
    <put name=”footer” value=”/jsp/tutorial/footer.jsp” />
    <put name=”menuLeft” value=”menuLeft.main” />
    <put name=”menuRight” value=”menuRight.main” />
    <put name=”login” value=”/jsp/tutorial/login.jsp” />
    <put name=”body” value=”main.portal.body” />
    </definition>

    <!– ======================================================= –>
    <!– Main page body definitions –>
    <!– ======================================================= –>

    <definition name=”main.portal.body” path=”/jsp/tutorial/columnsLayout.jsp”>
    <put name=”numCols” value=”2″ />
    <putList name=”list0″ >
    <add value=”/jsp/tutorial/messages.jsp” />
    <add value=”/jsp/tutorial/newsFeed.jsp” />
    <add value=”/jsp/tutorial/advert2.jsp” />
    </putList>
    <putList name=”list1″ >
    <add value=”/jsp/tutorial/advert3.jsp” />
    <add value=”/jsp/tutorial/stocks.jsp” />
    <add value=”/jsp/tutorial/whatsNew.jsp” />
    <add value=”/jsp/tutorial/personalLinks.jsp” />
    <add value=”/jsp/tutorial/search.jsp” />
    </putList>
    </definition>

    <!– ======================================================= –>
    <!– Menus definitions –>
    <!– ======================================================= –>

    <!– Menu bar definition –>
    <!– Main menu definition –>
    <definition name=”menuLeft.main” path=”/jsp/tutorial/vboxLayout.jsp” >
    <putList name=”componentsList” >
    <add value=”menu.logo” />
    <add value=”menu.links” />
    <add value=”menu.src” />
    <add value=”menu.dumbie” />
    </putList>
    </definition>

    <!– Main menu definition –>
    <definition name=”menuRight.main” path=”/jsp/tutorial/vboxLayout.jsp” >
    <putList name=”componentsList” >
    <add value=”menu.logo” />
    <add value=”menu.links_2″ />
    <add value=”menu.links_3″ />
    <add value=”menu.links_4″ />
    <!–add value=”menu.src” /–>
    </putList>
    </definition>

    <!– menu logo definition –>

    <definition name=”menu.logo” path=”/jsp/tutorial/menuLogo.jsp” />

    <!– menu logo definition –>

    <definition name=”menu.links” path=”/jsp/tutorial/submenu.jsp” >
    <put name=”title” value=”Main Menu” />
    <putList name=”items” >
    <add value=”Home” />
    <add value=”Basic Page” />
    <add value=”First Portal” />
    <add value=”First Definition” />
    <!–add value=”Overloaded Definition” />
    <add value=”Extended Definition” /–>
    </putList>
    <putList name=”links” >
    <add value=”/jsp/tutorial/tutorialIndex.jsp” />
    <add value=”/jsp/tutorial/moreFiles/basicPage.jsp” />
    <add value=”/jsp/tutorial/moreFiles/portalPage.jsp” />
    <add value=”/jsp/tutorial/moreFiles/firstDefinition.jsp” />
    <!–add value=”/jsp/tutorial/moreFiles/overloadedDefinitionParameters.jsp” />
    <add value=”/jsp/tutorial/moreFiles/extendedDefinition.jsp” /–>
    </putList>
    </definition>

    <definition name=”menu.links_2″ path=”/jsp/tutorial/submenu.jsp” >
    <put name=”title” value=”Styles” />
    <putList name=”items” >
    <add value=”Shirts” />
    <add value=”Pants” />
    <add value=”Gele” />
    <add value=”Iro” />
    </putList>
    <putList name=”links” >
    <add value=”/jsp/tutorial/moreFiles/shirts.jsp” />
    <add value=”/jsp/tutorial/moreFiles/pants.jsp” />
    <add value=”/jsp/tutorial/moreFiles/gele.jsp” />
    <add value=”/jsp/tutorial/moreFiles/iro.jsp” />
    </putList>
    </definition>

    <definition name=”menu.links_3″ path=”/jsp/tutorial/submenu.jsp” >
    <put name=”title” value=”Fabrics” />
    <putList name=”items” >
    <add value=”Tie/Dye” />
    <add value=”Asho Oke” />
    <add value=”Gele” />
    <add value=”Lace” />
    </putList>
    <putList name=”links” >
    <add value=”/jsp/tutorial/moreFiles/Tie_Dye.jsp” />
    <add value=”/jsp/tutorial/moreFiles/Asho_Oke.jsp” />
    <add value=”/jsp/tutorial/moreFiles/geleFabric.jsp” />
    <add value=”/jsp/tutorial/moreFiles/Lace.jsp” />
    </putList>
    </definition>

    <definition name=”menu.links_4″ path=”/jsp/tutorial/submenu.jsp” >
    <put name=”title” value=”Measurements” />
    <putList name=”items” >
    <add value=”Buba and Iro” />
    <add value=”Up and Down” />
    <add value=”Gele” />

    </putList>
    <putList name=”links” >
    <add value=”/jsp/tutorial/moreFiles/buba_iro_measure.jsp” />
    <add value=”/jsp/tutorial/moreFiles/up_down_measure.jsp” />
    <add value=”/jsp/tutorial/moreFiles/gele_measure.jsp” />

    </putList>
    </definition>

    <!– Menu sources definition –>
    <definition name=”menu.src” path=”/common/menuSrc.jsp” >
    <putList name=”list” >
    <add value=”/jsp/tutorial/moreFiles/index.jsp” />
    <add value=”/jsp/tutorial/moreFiles/basicPage.jsp” />
    <add value=”/jsp/tutorial/moreFiles/portalPage.jsp” />
    <add value=”/jsp/tutorial/moreFiles/firstDefinition.jsp” />
    <!–add value=”/jsp/tutorial/moreFiles/overloadedDefinitionParameters.jsp” />
    <add value=”/jsp/tutorial/moreFiles/extendedDefinition.jsp” />
    <add value=”/WEB-INF/tiles-def.xml” />
    <add value=”/jsp/tutorial/moreFiles/basic/myLayout.jsp” />
    <add value=”/jsp/tutorial/classicLayout.jsp” />
    <add value=”/jsp/tutorial/columnsLayout.jsp” />
    <add value=”/jsp/tutorial/vboxLayout.jsp” /–>
    </putList>

    </definition>

    <!– menu dumbie definition –>

    <definition name=”menu.dumbie” path=”/jsp/tutorial/menuDumbie.jsp” />

    </tiles-definitions>
    *********************************************

    My struts_config like so:
    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE struts-config PUBLIC “-//Apache Software Foundation//DTD Struts Configuration 1.1//EN” “http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd”&gt;
    <struts-config>
    <data-sources>
    <data-source
    type=”org.apache.commons.dbcp.BasicDataSource” >
    <set-property property=”driverClassName”
    value=”com.mysql.jdbc.Driver” />
    <set-property property=”url”
    value=”jdbc:mysql://localhost/stocks” />
    <set-property property=”username”
    value=””/>
    <set-property property=”password”
    value=””/>
    </data-source>
    </data-sources>

    <form-beans>
    <form-bean name=”ChoiceForm” type=”org.apache.struts.action.DynaActionForm” /></form-beans>

    <global-exceptions />
    <global-forwards />
    <action-mappings >
    <action
    attribute=”ChoiceForm”
    input=”/jsp/index.jsp”
    name=”ChoiceForm”
    parameter=”method”
    path=”/ChoiceAction”
    scope=”request”
    type=”com.alashoofi.strut.ChoiceAction”
    unknown=”false”
    validate=”true”>
    <forward
    name=”choice_one”
    path=”/jsp/pages/ChoiceOne.jsp”
    redirect=”false” />
    <forward
    name=”choice_three”
    path=”/jsp/pages/ChoiceThree.jsp”
    redirect=”false”
    contextRelative=”false” />
    <forward
    name=”choice_two”
    path=”/jsp/pages/ChoiceTwo.jsp”
    redirect=”false” />
    </action>
    <action
    forward=”/jsp/tutorial/login.jsp”
    path=”/LoginAction”
    unknown=”false”
    validate=”false” />

    </action-mappings>

    <controller
    bufferSize=”4096″
    debug=”0″
    locale=”false”
    nocache=”false”
    inputForward=”false” />
    <message-resources null=”true” parameter=”com.alashoofi.struts.ApplicationResources” />

    <plug-in className=”org.apache.struts.tiles.TilesPlugin”>
    <set-property property=”definitions-config”
    value=”/WEB-INF/tiles-def.xml” />
    <set-property property=”moduleAware” value=”true” />
    <set-property property=”definitions-parser-validate” value=”true” />

    </plug-in>
    </struts-config>

    *************************************

    The entry point into the application is:
    <%@ taglib uri=”/WEB-INF/struts-tiles.tld” prefix=”tiles” %>
    <html:base/>

    <tiles:insert definition=”mainLayout” flush=”true” />

    and I believe this is where it fails?
    Please help, I can’t seem to find the root of the problem.
    I also checked my environment variables to make sure I have things right:

    CATALINA_HOME: C:\PROGRAM FILES\APACHE GROUP\jakarta-tomcat-5.5.1

    classpath: C:\PROGRAM FILES\APACHE GROUP\JAKARTA-TOMCAT-5.5.1\COMMON\LIB\SERVLET-API.JAR;C:\PROGRAM FILES\APACHE GROUP\JAKARTA-TOMCAT-5.5.1\COMMON\LIB\JASPER-RUNTIME.JAR;.

    java_home: C:\PROGRAM FILES\JAVA\JDK1.5.0

    😥

    #216071 Reply

    Riyad Kalla
    Member

    Please upgrade to MyEclipse 3.8.2 and see if the problem clear sup. There have literally been 100s of bug fixes and enhancements between the 3.8 Beta and 3.8.2 release.

    #216127 Reply

    alashoofi
    Member

    Riyad,
    Thanks for noticing me. Actually, that was my starting point. I had every all upgraded. Used Tomcat 5.0, JRE 5.0, Eclipse 3.1 and Myeclipse 3.8.1(not 2 though) and I ended up with same error.
    I later downgraded these to match what I had on my old laptop(which incidentally works right) and that is still fails. I will upgrade to 3.8.2 and see what happens.
    I have been doing a file by file comparison with the laptop and something interesting come up:

    On the laptop under <workspace>/.metadata. the following files exist:
    .config (dir)
    .plugins (dir)
    .cache
    .keyring
    .lock
    .registry
    verion

    on the other computer, I only have:
    .plugins (dir)
    .keyring
    .lock
    vesion
    the others are missing! Most importantly, .config (dir) is missing.
    I don’t know if this has any significan’t impact but I will let you tell me.
    I check the directories after the application is deployed.

    I will appreciate your help in tracing this. I have lost many days of work because of this problem. My laptop is very slow, that is why I bought another computer and even now I am stuck.

    Thanks

    #216147 Reply

    Riyad Kalla
    Member

    alashoofi,
    I think you are comparing an Eclipse 2.x install and an Eclipse 3.x install. Eclipse 2.x used the .config directory while Eclipse 3.x uses the /configuration directory.

    Also note that using Eclipse 3.1 is not supported as its not slated for release until atleast May of next year. We would encourage you to use Eclipse 3.0.1 instead.

    #216173 Reply

    alashoofi
    Member

    Riyad,
    I uninstalled Myeclipse 3.8 beta and installed 3.8.2. No change reoprted. Still same error.

    I have no more ideas to try out. Everything has gone dry down here. The only thing left to consider is maybe the project I try to import onto the new computer is not coming through clean.
    This is how I do it:
    I copy the entire project folder from the old computer over into a directory in the new computer and then use File – Import – Existing Project into Workspace. (It tells me this does not copy the project to the workspace).
    I then deploy and run the project, then I get the Definition Factory not found error.

    What else can I do to make this project run other than start all over? Since I am going to use tile definition anyway, I am afraid I will get same error.

    #216174 Reply

    Riyad Kalla
    Member

    alashoofi,
    What is the Build ID of Eclipse that you are using? Its on the Help > About menu item.

    #216178 Reply

    alashoofi
    Member

    Version: 3.0.0
    Build id: 200406251208

    #216181 Reply

    Riyad Kalla
    Member

    Everything looks fine to me, can you create a small project with this troublesome file that exhibits this behavior, then zip it up and email it to support@genuitec.com and reference this thread so we can have a test case to work with?

    #216223 Reply

    Riyad Kalla
    Member

    Moving to support

    #216225 Reply

    Riyad Kalla
    Member

    alashoofi,
    I recieved your test project (thank you) and besides your JSP pages having some taglib errors in it, I noticed that you are completely lacking a tiles plugin entry in your struts-config file, something like this:

    
    <plug-in className="org.apache.struts.tiles.TilesPlugin">
        <set-property property="definitions-config" value="/WEB-INF/conf/tiles-def.xml" />
    </plug-in>
    

    Then I went back and re-read your except from your first message, and realized that this except was most likely from Tomcat, NOT from ME… this never dawned on me… I thought we were talking about ME the entire time.

    Can you please add a plugin for Tiles to your struts-config and see if your problem clears up? Also your JSP pages, should look like this:

    
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
    
    <html:base/>
    <tiles:insert definition="siteLayoutDef">
        <tiles:put name="title" type="string" value="Get Stock Quote " /> 
    </tiles:insert>
    

    I realize you were just using test code, but just in case, I wanted to show you the correct URIs for the taglibs.

    #216241 Reply

    alashoofi
    Member

    I will rush home and try what you suggeted in a couple of minutes. I guess I must have left the tiles plugin entry out in the little example I sent you. It is definitely there in the project I am working on. If you check my first message, the struts-config codes shows an entry for the tiles plugin.
    I will let you know what happens as soon as possible. I am working on XP Professional operationg system.

    Thanks

    #216287 Reply

    alashoofi
    Member

    1 I added a tiles plugin entry in struts-config for the sample app;
    2 Updated the jsp file to reflect uri for struts-html;
    redeployed and ran the app.
    Result:
    For the big project, it did not make any difference because it already has the tiles-plugin. Still gave error
    “Can’t get definition factory from context”
    The small sample app gave me a slightly different error message
    ”Can’t get definition ‘siteLayoutDef’, please check if it exist in defintion factory”
    I did not change the codes except for the 2 items mentioned above.

    Thanks

    #216289 Reply

    Riyad Kalla
    Member

    I am moving this to Random Thoughts as its a tiles configuration issue.

    Also I’ve looked back through your tiles file and don’t see a definition named “siteLayoutDef” anywhere… I do see a “mainLayout” though… I think you really need to sit down and so some sanity checks to make sure you aren’t doing something obvious, like trying to use a definition that doesn’t exist, or trying to load a tiles-defs file by using the wrong file name…

    #216298 Reply

    alashoofi
    Member

    Riyad,
    The definition named ‘siteLayoutDef’ is used only in the zip file I sent to you yesterday, the definitionSample project I made up as a sample for you. It is defined in the tiles-def.xml file.
    In the project I posted in the forum,(a totally different project) there is no siteLayoutDef, but there is a siteLayoutDef3 though.
    I think you are mixing up issues here. The ‘mainLayout’ definition that you see is in the tiles-def.xml file posted in the forum, not in the zip file I sent to you.
    The zip file, which I call the sample project, is the one giving the error message ”Can’t get definition ‘siteLayoutDef’, please check if it exist in defintion factory” . “mainLayout” definition is not defined in this file, it belongs to a different project, the first one. Please understand that there are now two applications (projects) in the picture.
    Here is copy of the tiles-def.xml, from the zip file I sent you yesterday:

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <xml-body>

    <tiles-definitions>

    <!– ======================================================= –>
    <!– Definition For dispatch –>
    <!– ======================================================= –>

    <definition name=”siteLayoutDef” path=”/jsp/pages/siteLayout.jsp”>
    <put name=”title” type=”string”>
    Wrox Stock Quote System”
    </put>
    <put name=”header” type=”string”>
    THIS IS THE HEADER”
    </put>
    <put name=”footer” type=”string”>
    THIS IS THE FOOTER”
    </put>
    <put name=”content” type=”string”>
    Content goes here
    </put>
    </definition>

    </tiles-definitions>

    </xml-body>

    #218094 Reply

    mercnboy3
    Member

    I hate when I read through a whole thread and the problem was never resolved. So to keep you from scratching your head. If you have a working implementation and cannot get it to work on a new machine do the following:

    Put these in the action-mappings tag in struts-config.xml

    <action path=”/admin/tiles/reload”
    type=”org.apache.struts.tiles.actions.ReloadDefinitionsAction”/>
    <action path=”/admin/tiles/view”
    type=”org.apache.struts.tiles.actions.ViewDefinitionsAction”/>

    and go to url http://host_name/context_path/admin/tiles/reload.do

    apparently it is not read on startup.

    Now, next time you cannot find an answer but find alot of old posts, please pay it forward and post your solution.

Viewing 15 posts - 1 through 15 (of 23 total)
Reply To: Tiles Definition Factory

You must be logged in to post in the forum log in