error on starting Tomcat

Discussion in 'Java' started by asd, Feb 24, 2005.

  1. asd

    asd Guest

    hi,

    I am trying to create a custom tag but get exception when tomcat is
    started.

    my tld file(dbdata.tld) file is as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <tlib-version>1.2</tlib-version>
    <jsp-version>1.3</jsp-version>
    <short-name>exp</short-name>
    <!--info>Simple db example</info-->

    <tag>
    <name>dbdata</name>
    <tag-class>tagext.DBData</tag-class>
    <body-content>JSP</body-content>
    <!--info>displays data</info-->
    </tag>
    </taglib>

    and web.xml is as below:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/dtd/web-app_2_2.dtd">
    <web-app>
    <servlet>
    <servlet-name>loginservlet</servlet-name>
    <servlet-class>ctrl.LoginController</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>hello</servlet-name>
    <servlet-class>Hello</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>loginservlet</servlet-name>
    <url-pattern>/login</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
    <servlet-name>hello</servlet-name>
    <url-pattern>/hell</url-pattern>
    </servlet-mapping>

    <resource-ref>
    <res-ref-name>jdbc/dbtest</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>

    <taglib>
    <taglib-uri>/dbdata</taglib-uri>
    <taglib-location>/WEB_INF/tlds/dbdata.tld</taglib-location>
    </taglib>

    This is the exception that is seen in the Tomcat logs for my
    application:

    2005-02-23 18:19:02 ContextConfig[/exp] Exception processing TLD at
    resource path /WEB_INF/tlds/dbdata.tld
    javax.servlet.ServletException: Exception processing TLD at resource
    path /WEB_INF/tlds/dbdata.tld
    at
    org.apache.catalina.startup.ContextConfig.tldScanTld(ContextConfig.java:963)
    at
    org.apache.catalina.startup.ContextConfig.tldScan(ContextConfig.java:811)
    at
    org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:587)
    at
    org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:181)
    at
    org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at
    org.apache.catalina.core.StandardContext.start(StandardContext.java:3523)
    at
    org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:707)
    at
    org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
    at
    org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316)
    at
    org.apache.catalina.core.StandardService.start(StandardService.java:450)
    at
    org.apache.catalina.core.StandardServer.start(StandardServer.java:2143)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:463)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:129)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156)
    ----- Root Cause -----
    java.lang.IllegalArgumentException: Invalid TLD resource path
    /WEB_INF/tlds/dbdata.tld
    at
    org.apache.catalina.startup.ContextConfig.tldScanTld(ContextConfig.java:955)
    at
    org.apache.catalina.startup.ContextConfig.tldScan(ContextConfig.java:811)
    at
    org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:587)
    at
    org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:181)
    at
    org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at
    org.apache.catalina.core.StandardContext.start(StandardContext.java:3523)
    at
    org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:707)
    at
    org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
    at
    org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316)
    at
    org.apache.catalina.core.StandardService.start(StandardService.java:450)
    at
    org.apache.catalina.core.StandardServer.start(StandardServer.java:2143)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:463)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:129)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156)

    Do I have to do any settings in server.xml for custom tags?
    Thanks in advance for any help....
    asd, Feb 24, 2005
    #1
    1. Advertising

  2. asd

    SMC Guest

    On Thu, 24 Feb 2005 16:40:04 +1100, asd wrote:

    > hi,
    >
    > I am trying to create a custom tag but get exception when tomcat is
    > started.

    <snip>
    > ----- Root Cause -----
    > java.lang.IllegalArgumentException: Invalid TLD resource path
    > /WEB_INF/tlds/dbdata.tld


    Probably WEB_INF should actually be WEB-INF (subtle error)

    <taglib>
    <taglib-uri>/dbdata</taglib-uri>
    <taglib-location>/WEB-INF/tlds/dbdata.tld</taglib-location>
    </taglib>

    That's unless your installation of tomcat is different and you actually
    do have a WEB_INF directory.

    > Do I have to do any settings in server.xml for custom tags? Thanks in
    > advance for any help....


    No :)

    --
    Sean

    The users that I support would double-click on a landmine to see what it
    did. --slashdot poster
    SMC, Feb 24, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hiranya Samarasekera

    starting tomcat

    Hiranya Samarasekera, Jul 29, 2003, in forum: Java
    Replies:
    0
    Views:
    500
    Hiranya Samarasekera
    Jul 29, 2003
  2. john bailo
    Replies:
    0
    Views:
    628
    john bailo
    Aug 13, 2003
  3. John Shepard

    problems starting up Jakarta-Tomcat

    John Shepard, Sep 29, 2003, in forum: Java
    Replies:
    3
    Views:
    10,323
    John Shepard
    Sep 29, 2003
  4. Prabh

    Trouble starting TOMCAT

    Prabh, Feb 11, 2004, in forum: Java
    Replies:
    2
    Views:
    493
    Shane Mingins
    Feb 11, 2004
  5. Prabh

    Trouble starting TOMCAT

    Prabh, Feb 11, 2004, in forum: Java
    Replies:
    0
    Views:
    323
    Prabh
    Feb 11, 2004
Loading...

Share This Page