Quantcast

NullPointerException insertDefinition.startTag

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

NullPointerException insertDefinition.startTag

Aditya Saraf
Hi,

I am currently deploying Tiles and I am using the simple
SimpleTilesInitializerServlet
to publish my tiles configuration. After deployment all my tiles definitions
that are at the root level work. That is, any file that at the / level that
has a <tiles:insertDefintion> tag works fine. But any file that is inside a
folder (/folder) with the <tiles:insertDefintion> tag doesn't work and
throws the following exception.

java.lang.NullPointerException
 org.apache.tiles.template.InsertDefinitionModel.start(InsertDefinitionModel.java:74)
 org.apache.tiles.jsp.taglib.InsertDefinitionTag.doTag(InsertDefinitionTag.java:276)
 org.apache.jsp.index_jsp._jspx_meth_tiles_005finsertDefinition_005f0(index_jsp.java:64)
 org.apache.jsp.index_jsp._jspService(index_jsp.java:42)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98

Here is my setup.

File: /WEB-INF/tiles.xml
 <definition name="fa.homepage" template="/layout.jsp">
  <put-attribute name="title" value="Title" />
  <put-attribute name="header" value="/header.jsp" />
  <put-attribute name="menu" value="/common_menu.jsp" />
  <put-attribute name="body" value="/fa/body.jsp" />
  <put-attribute name="footer" value="/footer.jsp" />
 </definition>

File: /WEB-INF/web.xml
<servlet>
   <servlet-name>tiles</servlet-name>
   <servlet-class>org.apache.tiles.web.startup.simple.SimpleTilesInitializerServlet</servlet-class>
   <load-on-startup>1</load-on-startup>
 </servlet>

File: /fa/index.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%>
 <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<tiles:insertDefinition name="fa.homepage" />

Can someone help me understand why all definitions declared at the context
path (/) level would work and not work inside folders (/fa)?

Thanks,
Adi Saraf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NullPointerException insertDefinition.startTag

Antonio Petrelli-3
2011/8/11 Aditya Saraf <[hidden email]>

> java.lang.NullPointerException
>
>  org.apache.tiles.template.InsertDefinitionModel.start(InsertDefinitionModel.java:74)
>

At that line, the container reference is the only thing that can cause an
NPE. Did you check your application startup log?

Antonio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NullPointerException insertDefinition.startTag

Aditya Saraf
Antonio,

Thanks for your prompt response. There are no indications in my Tomcat
statup log. My logging properties are set to show only INFO, WARN and,
SEVERE. What should the container reference point to? maybe my file
structure is incorrect? Please let me know.

Thanks,
Adi Saraf


On Thu, Aug 11, 2011 at 10:00 AM, Antonio Petrelli <
[hidden email]> wrote:

> 2011/8/11 Aditya Saraf <[hidden email]>
>
> > java.lang.NullPointerException
> >
> >
>  org.apache.tiles.template.InsertDefinitionModel.start(InsertDefinitionModel.java:74)
> >
>
> At that line, the container reference is the only thing that can cause an
> NPE. Did you check your application startup log?
>
> Antonio
>



--
Adi Saraf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NullPointerException insertDefinition.startTag

Antonio Petrelli-3
2011/8/11 Aditya Saraf <[hidden email]>

> Thanks for your prompt response. There are no indications in my Tomcat
> statup log. My logging properties are set to show only INFO, WARN and,
> SEVERE. What should the container reference point to? maybe my file
> structure is incorrect? Please let me know.
>

There's a thing that I did not understand. Are the calls to definitions (the
working one and the problematic one) in the same application, or different
applications?
I try to explain.
If they are in the same one, then the reason why the container is null is
because it is done explicitly by using <tiles:setCurrentContainer> tag in
JSP.
If they are in different ones, then probably it is a startup problem.

Antonio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NullPointerException insertDefinition.startTag

Aditya Saraf
Antonio,

I was not using the <tiles:setCurrentContainer> tag, because all calls to
the definitions are within the same application context. However, I did put
the <tiles:setCurrentContainer> tag in the problematic file above the
<tiles:insertDefinition> tag and I got a different error.

org.apache.tiles.impl.NoSuchContainerException: The container with the key
'null' cannot be found
org.apache.tiles.jsp.context.JspUtil.setCurrentContainer(JspUtil.java:183)
org.apache.tiles.jsp.taglib.definition.SetCurrentContainerTag.doTag(SetCurrentContainerTag.java:65)
org.apache.jsp.index_jsp._jspx_meth_tiles_005fsetCurrentContainer_005f0(index_jsp.java:65)
Why is the container key defaulting to be null? From documentation it says
that if the containerKey attribute is not specified then the default
containerKey is assumed.

Thanks,
Adi Saraf


On Thu, Aug 11, 2011 at 10:20 AM, Antonio Petrelli <
[hidden email]> wrote:

> 2011/8/11 Aditya Saraf <[hidden email]>
>
> > Thanks for your prompt response. There are no indications in my Tomcat
> > statup log. My logging properties are set to show only INFO, WARN and,
> > SEVERE. What should the container reference point to? maybe my file
> > structure is incorrect? Please let me know.
> >
>
> There's a thing that I did not understand. Are the calls to definitions
> (the
> working one and the problematic one) in the same application, or different
> applications?
> I try to explain.
> If they are in the same one, then the reason why the container is null is
> because it is done explicitly by using <tiles:setCurrentContainer> tag in
> JSP.
> If they are in different ones, then probably it is a startup problem.
>
> Antonio
>



--
Adi Saraf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NullPointerException insertDefinition.startTag

Aditya Saraf
Hi,

I noticed that in my startup log I dont see the following line.

INFO: Publishing TilesContext for context:
org.apache.tiles.servlet.context.ServletTilesApplicationContext
Does this mean, that Tiles Container doesnt know which context to look at?
Please let me know.

Thanks,
Adi Saraf



On Thu, Aug 11, 2011 at 10:33 AM, Aditya Saraf <[hidden email]> wrote:

> Antonio,
>
> I was not using the <tiles:setCurrentContainer> tag, because all calls to
> the definitions are within the same application context. However, I did put
> the <tiles:setCurrentContainer> tag in the problematic file above the
> <tiles:insertDefinition> tag and I got a different error.
>
> org.apache.tiles.impl.NoSuchContainerException: The container with the key
> 'null' cannot be found
> org.apache.tiles.jsp.context.JspUtil.setCurrentContainer(JspUtil.java:183)
>
> org.apache.tiles.jsp.taglib.definition.SetCurrentContainerTag.doTag(SetCurrentContainerTag.java:65)
>
> org.apache.jsp.index_jsp._jspx_meth_tiles_005fsetCurrentContainer_005f0(index_jsp.java:65)
> Why is the container key defaulting to be null? From documentation it says
> that if the containerKey attribute is not specified then the default
> containerKey is assumed.
>
> Thanks,
> Adi Saraf
>
>
> On Thu, Aug 11, 2011 at 10:20 AM, Antonio Petrelli <
> [hidden email]> wrote:
>
>> 2011/8/11 Aditya Saraf <[hidden email]>
>>
>> > Thanks for your prompt response. There are no indications in my Tomcat
>> > statup log. My logging properties are set to show only INFO, WARN and,
>> > SEVERE. What should the container reference point to? maybe my file
>> > structure is incorrect? Please let me know.
>> >
>>
>> There's a thing that I did not understand. Are the calls to definitions
>> (the
>> working one and the problematic one) in the same application, or different
>> applications?
>> I try to explain.
>> If they are in the same one, then the reason why the container is null is
>> because it is done explicitly by using <tiles:setCurrentContainer> tag in
>> JSP.
>> If they are in different ones, then probably it is a startup problem.
>>
>> Antonio
>>
>
>
>
> --
> Adi Saraf
>



--
Adi Saraf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NullPointerException insertDefinition.startTag

Antonio Petrelli-3
In reply to this post by Aditya Saraf
2011/8/11 Aditya Saraf <[hidden email]>

> Why is the container key defaulting to be null? From documentation it says
> that if the containerKey attribute is not specified then the default
> containerKey is assumed.
>

I verified, this is a bug, please open a JIRA issue.
I will try to help with your original question replying to the mail you sent
after this.

Antonio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NullPointerException insertDefinition.startTag

Antonio Petrelli-3
In reply to this post by Aditya Saraf
2011/8/11 Aditya Saraf <[hidden email]>

> I noticed that in my startup log I dont see the following line.
>
> INFO: Publishing TilesContext for context:
> org.apache.tiles.servlet.context.ServletTilesApplicationContext
> Does this mean, that Tiles Container doesnt know which context to look at?
> Please let me know.
>

As long as you are able to insert a definition in other places, no, I don't
this is the case.
BTW, when did you see such a log message?

Antonio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NullPointerException insertDefinition.startTag

Aditya Saraf
Hi Antonio,

I have an environment in which all the tiles definitions work perfectly. I
am trying to migrate everything to another environment. In my first
environment I see the log message, but in the second I don't see this
message. I guess my next question is, what should the container default to
and is this some how related to the context that the application is being
run in?

My only other option is to migrate all definitions to the root folder :(.

Thanks,
Adi Saraf

On Thu, Aug 11, 2011 at 1:12 PM, Antonio Petrelli <
[hidden email]> wrote:

> 2011/8/11 Aditya Saraf <[hidden email]>
>
> > I noticed that in my startup log I dont see the following line.
> >
> > INFO: Publishing TilesContext for context:
> > org.apache.tiles.servlet.context.ServletTilesApplicationContext
> > Does this mean, that Tiles Container doesnt know which context to look
> at?
> > Please let me know.
> >
>
> As long as you are able to insert a definition in other places, no, I don't
> this is the case.
> BTW, when did you see such a log message?
>
> Antonio
>



--
Adi Saraf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NullPointerException insertDefinition.startTag

Antonio Petrelli-3
2011/8/11 Aditya Saraf <[hidden email]>

> I have an environment in which all the tiles definitions work perfectly. I
> am trying to migrate everything to another environment. In my first
> environment I see the log message, but in the second I don't see this
> message. I guess my next question is, what should the container default to
> and is this some how related to the context that the application is being
> run in?
>

So in fact you oave two different applications then.
Can you post the web.xml files of both applications?

My only other option is to migrate all definitions to the root folder :(.
>

No, the last option is to debug. Use the source Luke :-D

Antonio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NullPointerException insertDefinition.startTag

Aditya Saraf
 Hi,

This is web.xml from the first environment that works perfectly for every
defintion.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 id="WebApp_ID" version="2.5">
 <display-name>IRMS_WEB</display-name>
 <welcome-file-list>
  <welcome-file>index.jsp</welcome-file>
 </welcome-file-list>
 <session-config>
  <session-timeout>300</session-timeout>
 </session-config>
 <filter> <filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>

  </filter> <filter-mapping> <filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
  </filter-mapping>
 <servlet>
  <description>Display chart on the end users machine.</description>
  <servlet-name>DisplayChart</servlet-name>
  <servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class>
 </servlet>
 <servlet-mapping>
  <servlet-name>DisplayChart</servlet-name>
  <url-pattern>/servlet/DisplayChart</url-pattern>
 </servlet-mapping>
 <servlet>
  <description>Get symbol information.</description>
  <display-name>Symbol</display-name>
  <servlet-name>Symbol</servlet-name>
  <servlet-class>com.irms.symbols.Symbol</servlet-class>
 </servlet>
 <servlet-mapping>
  <servlet-name>Symbol</servlet-name>
  <url-pattern>/Symbol</url-pattern>
 </servlet-mapping>
 <servlet>
  <description></description>
  <display-name>Output</display-name>
  <servlet-name>Output</servlet-name>
  <servlet-class>com.irms.output.Output</servlet-class>
 </servlet>
 <servlet-mapping>
  <servlet-name>Output</servlet-name>
  <url-pattern>/Output</url-pattern>
 </servlet-mapping>
 <servlet>
  <servlet-name>IRMS Startup</servlet-name>
  <servlet-class>com.irms.startup.Startup</servlet-class>
  <load-on-startup>2</load-on-startup>
 </servlet>
 <servlet>
  <servlet-name>tiles</servlet-name>
  <servlet-class>org.apache.tiles.web.startup.simple.SimpleTilesInitializerServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
 </servlet>
 <error-page>
  <error-code>404</error-code>
  <location>/404.html</location>
 </error-page>
 <error-page>
  <error-code>500</error-code>
  <location>/500.html</location>
 </error-page>
 <resource-ref>
  <description>DB Connection</description>
  <res-ref-name>jdbc/accounts</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
 </resource-ref>
 <resource-ref>
  <description>DB Connection</description>
  <res-ref-name>jdbc/funds</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
 </resource-ref>
 <security-constraint>
  <web-resource-collection>
   <web-resource-name>Tool</web-resource-name>
   <description>Protected resources.</description>
   <url-pattern>/*</url-pattern>
   <http-method>GET</http-method>
   <http-method>POST</http-method>
  </web-resource-collection>
  <auth-constraint>
   <description>These are the roles who have access</description>
   <role-name>user</role-name>
  </auth-constraint>
 </security-constraint>
 <login-config>
  <auth-method>FORM</auth-method>
  <form-login-config>
   <form-login-page>/signin.jsp</form-login-page>
   <form-error-page>/signin.jsp?error=1</form-error-page>
  </form-login-config>
 </login-config>
 <servlet>
  <description></description>
  <display-name>ZoomUniverse</display-name>
  <servlet-name>ZoomUniverse</servlet-name>
  <servlet-class>com.irms.output.ZoomUniverse</servlet-class>
 </servlet>
 <servlet-mapping>
  <servlet-name>ZoomUniverse</servlet-name>
  <url-pattern>/ZoomUniverse</url-pattern>
 </servlet-mapping>
</web-app>

This is the web.xml from the second environment.
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="
http://java.sun.com/xml/ns/javaee" xmlns:web="
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"
version="2.5">
  <display-name>IRMS_WEB</display-name>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <session-config>
    <session-timeout>300</session-timeout>
  </session-config>
   <filter>
   <filter-name>UrlRewriteFilter</filter-name>

<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
   </filter>
   <filter-mapping>
    <filter-name>UrlRewriteFilter</filter-name>
      <url-pattern>/*</url-pattern>
  </filter-mapping>

  <servlet>
    <description>Display chart on the end users machine.</description>
    <servlet-name>DisplayChart</servlet-name>
    <servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>DisplayChart</servlet-name>
    <url-pattern>/servlet/DisplayChart</url-pattern>
  </servlet-mapping>
  <servlet>
    <description>Get symbol information.</description>
    <display-name>Symbol</display-name>
    <servlet-name>Symbol</servlet-name>
    <servlet-class>com.irms.symbols.Symbol</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>Symbol</servlet-name>
    <url-pattern>/Symbol</url-pattern>
  </servlet-mapping>
  <servlet>
    <description></description>
    <display-name>Output</display-name>
    <servlet-name>Output</servlet-name>
    <servlet-class>com.irms.output.Output</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>Output</servlet-name>
    <url-pattern>/Output</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>IRMS Startup</servlet-name>
    <servlet-class>com.irms.startup.Startup</servlet-class>
    <load-on-startup>2</load-on-startup>
  </servlet>
  <servlet>
 <servlet-name>tiles</servlet-name>
 <servlet-class>org.apache.tiles.web.startup.simple.SimpleTilesInitializerServlet</servlet-class>
 <load-on-startup>1</load-on-startup>
 </servlet>
  <error-page>
    <error-code>404</error-code>
    <location>/404.html</location>
  </error-page>
  <error-page>
    <error-code>500</error-code>
    <location>/500.html</location>
  </error-page>
  <error-page>
    <error-code>401</error-code>
    <location>/401.html</location>
  </error-page>
  <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/accounts</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>
  <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/funds</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Tool</web-resource-name>
      <description>Protected Resources.</description>
      <url-pattern>/*</url-pattern>
      <http-method>GET</http-method>
      <http-method>POST</http-method>
    </web-resource-collection>
    <auth-constraint>
      <description>These are the roles who have access</description>
      <role-name>user</role-name>
    </auth-constraint>
  </security-constraint>
  <login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
      <form-login-page>/signin.jsp</form-login-page>
      <form-error-page>/signin.jsp?error=1</form-error-page>
    </form-login-config>
  </login-config>
  <servlet>
    <description></description>
    <display-name>ZoomUniverse</display-name>
    <servlet-name>ZoomUniverse</servlet-name>
    <servlet-class>com.irms.output.ZoomUniverse</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>ZoomUniverse</servlet-name>
    <url-pattern>/ZoomUniverse</url-pattern>
  </servlet-mapping>
</web-app>

I dont think there is anything wrong with my web.xml files. Do you think I
need to change ~/webapps/conf/web.xml and add the TilesServlet there?

Thanks,
Adi Saraf

On Thu, Aug 11, 2011 at 1:50 PM, Antonio Petrelli <
[hidden email]> wrote:

> 2011/8/11 Aditya Saraf <[hidden email]>
>
> > I have an environment in which all the tiles definitions work perfectly.
> I
> > am trying to migrate everything to another environment. In my first
> > environment I see the log message, but in the second I don't see this
> > message. I guess my next question is, what should the container default
> to
> > and is this some how related to the context that the application is being
> > run in?
> >
>
> So in fact you oave two different applications then.
> Can you post the web.xml files of both applications?
>
> My only other option is to migrate all definitions to the root folder :(.
> >
>
> No, the last option is to debug. Use the source Luke :-D
>
> Antonio
>



--
Adi Saraf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NullPointerException insertDefinition.startTag

Aditya Saraf
Hi,

I got the issue resolved. It seems like the my root web.xml needed the
TilesServlet declaration. It looks like the context of the web app really
matters when getting the Container object.

Thank you very much for your help.

Thanks,
Adi Saraf

On Thu, Aug 11, 2011 at 2:20 PM, Aditya Saraf <[hidden email]> wrote:

> Hi,
>
> This is web.xml from the first environment that works perfectly for every
> defintion.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>  id="WebApp_ID" version="2.5">
>  <display-name>IRMS_WEB</display-name>
>  <welcome-file-list>
>   <welcome-file>index.jsp</welcome-file>
>  </welcome-file-list>
>  <session-config>
>   <session-timeout>300</session-timeout>
>  </session-config>
>  <filter> <filter-name>UrlRewriteFilter</filter-name>
> <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
>
>   </filter> <filter-mapping> <filter-name>UrlRewriteFilter</filter-name>
> <url-pattern>/*</url-pattern>
>   </filter-mapping>
>  <servlet>
>   <description>Display chart on the end users machine.</description>
>   <servlet-name>DisplayChart</servlet-name>
>   <servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class>
>  </servlet>
>  <servlet-mapping>
>   <servlet-name>DisplayChart</servlet-name>
>   <url-pattern>/servlet/DisplayChart</url-pattern>
>  </servlet-mapping>
>  <servlet>
>   <description>Get symbol information.</description>
>   <display-name>Symbol</display-name>
>   <servlet-name>Symbol</servlet-name>
>   <servlet-class>com.irms.symbols.Symbol</servlet-class>
>  </servlet>
>  <servlet-mapping>
>   <servlet-name>Symbol</servlet-name>
>   <url-pattern>/Symbol</url-pattern>
>  </servlet-mapping>
>  <servlet>
>   <description></description>
>   <display-name>Output</display-name>
>   <servlet-name>Output</servlet-name>
>   <servlet-class>com.irms.output.Output</servlet-class>
>  </servlet>
>  <servlet-mapping>
>   <servlet-name>Output</servlet-name>
>   <url-pattern>/Output</url-pattern>
>  </servlet-mapping>
>  <servlet>
>   <servlet-name>IRMS Startup</servlet-name>
>   <servlet-class>com.irms.startup.Startup</servlet-class>
>   <load-on-startup>2</load-on-startup>
>  </servlet>
>
>  <servlet>
>   <servlet-name>tiles</servlet-name>
>
>   <servlet-class>org.apache.tiles.web.startup.simple.SimpleTilesInitializerServlet</servlet-class>
>   <load-on-startup>1</load-on-startup>
>  </servlet>
>  <error-page>
>   <error-code>404</error-code>
>   <location>/404.html</location>
>  </error-page>
>  <error-page>
>   <error-code>500</error-code>
>   <location>/500.html</location>
>  </error-page>
>  <resource-ref>
>   <description>DB Connection</description>
>   <res-ref-name>jdbc/accounts</res-ref-name>
>   <res-type>javax.sql.DataSource</res-type>
>   <res-auth>Container</res-auth>
>  </resource-ref>
>  <resource-ref>
>   <description>DB Connection</description>
>   <res-ref-name>jdbc/funds</res-ref-name>
>   <res-type>javax.sql.DataSource</res-type>
>   <res-auth>Container</res-auth>
>  </resource-ref>
>  <security-constraint>
>   <web-resource-collection>
>    <web-resource-name>Tool</web-resource-name>
>    <description>Protected resources.</description>
>    <url-pattern>/*</url-pattern>
>    <http-method>GET</http-method>
>    <http-method>POST</http-method>
>   </web-resource-collection>
>   <auth-constraint>
>    <description>These are the roles who have access</description>
>    <role-name>user</role-name>
>   </auth-constraint>
>  </security-constraint>
>  <login-config>
>   <auth-method>FORM</auth-method>
>   <form-login-config>
>    <form-login-page>/signin.jsp</form-login-page>
>    <form-error-page>/signin.jsp?error=1</form-error-page>
>   </form-login-config>
>  </login-config>
>  <servlet>
>   <description></description>
>   <display-name>ZoomUniverse</display-name>
>   <servlet-name>ZoomUniverse</servlet-name>
>   <servlet-class>com.irms.output.ZoomUniverse</servlet-class>
>  </servlet>
>  <servlet-mapping>
>   <servlet-name>ZoomUniverse</servlet-name>
>   <url-pattern>/ZoomUniverse</url-pattern>
>  </servlet-mapping>
> </web-app>
>
> This is the web.xml from the second environment.
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="
> http://java.sun.com/xml/ns/javaee" xmlns:web="
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="
> http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"
> version="2.5">
>   <display-name>IRMS_WEB</display-name>
>   <welcome-file-list>
>     <welcome-file>index.jsp</welcome-file>
>   </welcome-file-list>
>   <session-config>
>     <session-timeout>300</session-timeout>
>   </session-config>
>    <filter>
>    <filter-name>UrlRewriteFilter</filter-name>
>
> <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
>    </filter>
>    <filter-mapping>
>     <filter-name>UrlRewriteFilter</filter-name>
>       <url-pattern>/*</url-pattern>
>   </filter-mapping>
>
>   <servlet>
>     <description>Display chart on the end users machine.</description>
>     <servlet-name>DisplayChart</servlet-name>
>     <servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>DisplayChart</servlet-name>
>     <url-pattern>/servlet/DisplayChart</url-pattern>
>   </servlet-mapping>
>   <servlet>
>     <description>Get symbol information.</description>
>     <display-name>Symbol</display-name>
>     <servlet-name>Symbol</servlet-name>
>     <servlet-class>com.irms.symbols.Symbol</servlet-class>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>Symbol</servlet-name>
>     <url-pattern>/Symbol</url-pattern>
>   </servlet-mapping>
>   <servlet>
>     <description></description>
>     <display-name>Output</display-name>
>     <servlet-name>Output</servlet-name>
>     <servlet-class>com.irms.output.Output</servlet-class>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>Output</servlet-name>
>     <url-pattern>/Output</url-pattern>
>   </servlet-mapping>
>   <servlet>
>     <servlet-name>IRMS Startup</servlet-name>
>     <servlet-class>com.irms.startup.Startup</servlet-class>
>     <load-on-startup>2</load-on-startup>
>   </servlet>
>
>   <servlet>
>  <servlet-name>tiles</servlet-name>
>
>  <servlet-class>org.apache.tiles.web.startup.simple.SimpleTilesInitializerServlet</servlet-class>
>  <load-on-startup>1</load-on-startup>
>  </servlet>
>   <error-page>
>     <error-code>404</error-code>
>     <location>/404.html</location>
>   </error-page>
>   <error-page>
>     <error-code>500</error-code>
>     <location>/500.html</location>
>   </error-page>
>   <error-page>
>     <error-code>401</error-code>
>     <location>/401.html</location>
>   </error-page>
>   <resource-ref>
>     <description>DB Connection</description>
>     <res-ref-name>jdbc/accounts</res-ref-name>
>     <res-type>javax.sql.DataSource</res-type>
>     <res-auth>Container</res-auth>
>   </resource-ref>
>   <resource-ref>
>     <description>DB Connection</description>
>     <res-ref-name>jdbc/funds</res-ref-name>
>     <res-type>javax.sql.DataSource</res-type>
>     <res-auth>Container</res-auth>
>   </resource-ref>
>   <security-constraint>
>     <web-resource-collection>
>       <web-resource-name>Tool</web-resource-name>
>       <description>Protected Resources.</description>
>       <url-pattern>/*</url-pattern>
>       <http-method>GET</http-method>
>       <http-method>POST</http-method>
>     </web-resource-collection>
>     <auth-constraint>
>       <description>These are the roles who have access</description>
>       <role-name>user</role-name>
>     </auth-constraint>
>   </security-constraint>
>   <login-config>
>     <auth-method>FORM</auth-method>
>     <form-login-config>
>       <form-login-page>/signin.jsp</form-login-page>
>       <form-error-page>/signin.jsp?error=1</form-error-page>
>     </form-login-config>
>   </login-config>
>   <servlet>
>     <description></description>
>     <display-name>ZoomUniverse</display-name>
>     <servlet-name>ZoomUniverse</servlet-name>
>     <servlet-class>com.irms.output.ZoomUniverse</servlet-class>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>ZoomUniverse</servlet-name>
>     <url-pattern>/ZoomUniverse</url-pattern>
>   </servlet-mapping>
> </web-app>
>
> I dont think there is anything wrong with my web.xml files. Do you think I
> need to change ~/webapps/conf/web.xml and add the TilesServlet there?
>
> Thanks,
> Adi Saraf
>
> On Thu, Aug 11, 2011 at 1:50 PM, Antonio Petrelli <
> [hidden email]> wrote:
>
>> 2011/8/11 Aditya Saraf <[hidden email]>
>>
>> > I have an environment in which all the tiles definitions work perfectly.
>> I
>> > am trying to migrate everything to another environment. In my first
>> > environment I see the log message, but in the second I don't see this
>> > message. I guess my next question is, what should the container default
>> to
>> > and is this some how related to the context that the application is
>> being
>> > run in?
>> >
>>
>> So in fact you oave two different applications then.
>> Can you post the web.xml files of both applications?
>>
>> My only other option is to migrate all definitions to the root folder :(.
>> >
>>
>> No, the last option is to debug. Use the source Luke :-D
>>
>> Antonio
>>
>
>
>
> --
> Adi Saraf
>



--
Adi Saraf
Loading...