Hi,
I am trying to using tiles with struts 1.0 And I am facing following claspath probelsm
when using it with Tomcat 4.1.12.
I have extended the TilesComponentServlet (Earlise i was extending ActionServlet..But
I want to use TilesDefinations now..).
But when the servlet is loaded at server startup,I get the following exception.
2003-04-04 16:08:29 StandardContext[/EquatePlus]: Servlet /ApplicationServlet threw
load() exception
javax.servlet.ServletException: Servlet.init() for servlet action threw exception
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:952)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3341)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3534)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at org.apache.catalina.core.StandardService.start(StandardService.java:497)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
at org.apache.catalina.startup.Catalina.start(Catalina.java:510)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
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:203)
----- Root Cause -----
java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester
at org.apache.struts.tiles.xmlDefinition.XmlParser.<init>(XmlParser.java:130)
at
org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFile(I18nFactorySet.java:515)
So to solve this problem I added commons-digester.jar from tiles-blank-struts1-0 to
the web-inf directory of my application.
Now when I try to start Tomcat,I get the following exception.
Catalina.start: java.lang.ClassNotFoundException:
org.apache.catalina.core.StandardServer
java.lang.ClassNotFoundException: org.apache.catalina.core.StandardServer
at org.apache.commons.digester.Digester.createSAXException(Digester.java:2375)
at org.apache.commons.digester.Digester.createSAXException(Digester.java:2395)
at org.apache.commons.digester.Digester.startElement(Digester.java:1270)
at
org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:454)
at
org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.java:571)
at
org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:756)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:752)
at
org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(XMLDocumentScannerImpl.java:942)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1520)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:524)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:580)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1169)
at org.apache.commons.digester.Digester.parse(Digester.java:1542)
at org.apache.catalina.startup.Catalina.start(Catalina.java:449)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
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:203)
I am using eclipse with tomcat and And this is I have selected the option Add Project
to tomcat classpath.So somehow the digester.jar stops Tomcat from starting...
Now when I remove the project from tomcat classpath,I get following exception.
xception during startup processing
java.lang.reflect.InvocationTargetException
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:203)
Caused by: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1274)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1664)
at
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:953)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1394)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1274)
As I understand it, it means that the httpServlet class with which the
ComponentServlet from tiles was compiled is different than the servlet version I am
using(I am using servlet.jar from tomcat_home/commmon/lib).
So what is the solution to this problem?
Regards,
Shirish
-----Original Message-----
From: Cedric Dumoulin [mailto:[EMAIL PROTECTED]
Sent: Friday, April 04, 2003 2:55 PM
To: Struts Users Mailing List
Subject: Re: Tiles Question:Diff between jsp and XML tiles
definations...
[EMAIL PROTECTED] wrote:
>Hi Cedric,
>Thanks for the reply once again..:-))
>
>But I still have one question.
>So does it mean that using the jsp approach is a bit inefficient?
>
Yes, unless you provide a mechanism to avoid the reload of definition
>But is the the only disadvantage?
>
No, Definition are located in jsp pages instead of a central file, and
you can't easily use inheritance.
>
>My main concern is can I use all the features of tiles (Mainly defination Inheritance
>etc.)with the jsp approach?
>
Inheritance is not fully implemented whith def in jsp.
>
>I am trying to avoid the use of action component servlet as We already have extended
>ActionServlet in our project.And I am not sure if we Instead inherit
>ActionComponentServlet will it affect any thing else..
>
Try to inherit from the TilesActionComponentServlet. It overload few
methods, so it should not interfere with your class.
Cedric
>
>regards,
>Shirish
>
>-----Original Message-----
>From: Cedric Dumoulin [mailto:[EMAIL PROTECTED]
>Sent: Friday, April 04, 2003 2:19 PM
>To: Struts Users Mailing List
>Subject: Re: Tiles Question:Diff between jsp and XML tiles
>definations...
>
>
>
> There is some differences:
>
> * Xml definitions are store in a factory; they can be inserted with
> <insert name="aDefinition"; they are declared in a centralized
> file, they can be declared using inheritance; they can be used in
> a struts <forward ...> tag; they need the initialization of the
> factory (done by the plugin)
> * jsp definition are stored in one of the jsp context. They are
> inserted with <insert beanName="aBeanId">; they don't need the
> factory; they can't be used as struts <forward ...>; they are
> created each time the <tiles:definition ..> tag is encountered.
>
> Hope this help,
>
> Cedric
>
>[EMAIL PROTECTED] wrote:
>
>
>
>>Hi All,
>>I am new to tiles and experimenting with it a bit to see if our struts 1.0 template
>>based application can be ported to Tiles easily...
>>
>>I have got some sample pages from our application working using tiles definations
>>But the definations are defined in a jsp file.
>>
>>So my question is whats the difference between Using an xml file for defination and
>>using a jsp file?If I am using jsp definations, Do i stil need to initialise the
>>Defination factory?
>>
>>If I go the jsp way, Will I be still able to use all features of tiles ?because I
>>think to use tiles I need to use ActionComponentServlet(Struts 1.0) instead of
>>ActionServlet...And the ActionComponentServlet modifies the forward behaviour for
>>use with tiles...So does it mean that whether I use xml definations or not,I need to
>>use ActionCOmponentServlet...Is it true?
>>
>>Any help is appreciated...
>>
>>regards,
>>Shirish
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]