Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > error on starting Tomcat

Reply
Thread Tools

error on starting Tomcat

 
 
asd
Guest
Posts: n/a
 
      02-24-2005
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.tldScanT ld(ContextConfig.java:963)
at
org.apache.catalina.startup.ContextConfig.tldScan( ContextConfig.java:811)
at
org.apache.catalina.startup.ContextConfig.start(Co ntextConfig.java:587)
at
org.apache.catalina.startup.ContextConfig.lifecycl eEvent(ContextConfig.java:181)
at
org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:3523)
at
org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1141)
at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:707)
at
org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1141)
at
org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:316)
at
org.apache.catalina.core.StandardService.start(Sta ndardService.java:450)
at
org.apache.catalina.core.StandardServer.start(Stan dardServer.java:2143)
at org.apache.catalina.startup.Catalina.start(Catalin a.java:463)
at org.apache.catalina.startup.Catalina.execute(Catal ina.java:350)
at org.apache.catalina.startup.Catalina.process(Catal ina.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:156)
----- Root Cause -----
java.lang.IllegalArgumentException: Invalid TLD resource path
/WEB_INF/tlds/dbdata.tld
at
org.apache.catalina.startup.ContextConfig.tldScanT ld(ContextConfig.java:955)
at
org.apache.catalina.startup.ContextConfig.tldScan( ContextConfig.java:811)
at
org.apache.catalina.startup.ContextConfig.start(Co ntextConfig.java:587)
at
org.apache.catalina.startup.ContextConfig.lifecycl eEvent(ContextConfig.java:181)
at
org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:3523)
at
org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1141)
at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:707)
at
org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1141)
at
org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:316)
at
org.apache.catalina.core.StandardService.start(Sta ndardService.java:450)
at
org.apache.catalina.core.StandardServer.start(Stan dardServer.java:2143)
at org.apache.catalina.startup.Catalina.start(Catalin a.java:463)
at org.apache.catalina.startup.Catalina.execute(Catal ina.java:350)
at org.apache.catalina.startup.Catalina.process(Catal ina.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:156)

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

 
Reply With Quote
 
 
 
 
SMC
Guest
Posts: n/a
 
      02-24-2005
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C++ 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C Programming 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui Python 0 04-27-2009 12:46 PM
Tomcat error-Could not load Tomcat server configuration sjoshi Java 0 09-27-2005 06:47 PM
Starting Tomcat ( from Netbeans Install) from line command produces error john bailo Java 0 08-13-2003 09:18 PM



Advertisments