ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: ClassNotFoundException when appropriate jat in classpath
Date Mon, 17 Jul 2006 12:47:53 GMT
If you are to omit $TOMCAT_HOME and basedir qualifiers
I believe the jar specification has to be Fully Qualified Path (instead of using the relative
path) e.g.

<property name="catalina.jar"             value="/usr/opt/TOMCAT/apache-tomcat-5.5.17/server/lib/catalina.jar"/>

Martin --
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: "Jeevan" <Jeevan.Ramakrishna@Sun.COM>
To: <anandsrider.d@polaris.co.in>
Cc: "Ant Users List" <user@ant.apache.org>
Sent: Monday, July 17, 2006 5:51 AM
Subject: Re: ClassNotFoundException when appropriate jat in classpath


> Hi Anand,
> 
> I had done that before. So, including more info for better clarity.
> Here is the Exception:
> 
> SEVERE: Error loading WebappClassLoader
>     [java]   delegate: false
>     [java]   repositories:
>     [java] ----------> Parent Classloader:
>     [java] sun.misc.Launcher$AppClassLoader@133056f
>     [java]  org.apache.jasper.servlet.JspServlet
>     [java] java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet
>     [java]     at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
>     [java]     at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
> 
> Here is the (part of the ) properties.
> ....
>    <property name="catalina.jar"             value="apache-tomcat-5.5.17/server/lib/catalina.jar"/>
>    <property name="tomcat-util.jar"          value="apache-tomcat-5.5.17/server/lib/tomcat-util.jar"/>
>    <property name="naming-factory.jar"       value="apache-tomcat-5.5.17/common/lib/naming-factory.jar"/>
>    <property name="commons-modeler.jar"      value="apache-tomcat-5.5.17/server/lib/commons-modeler.jar"/>
>    <property name="catalina-storeconfig.jar" value="apache-tomcat-5.5.17/server/lib/catalina-storeconfig.jar"/>
>    <property name="tomcat-coyote.jar"        value="apache-tomcat-5.5.17/server/lib/tomcat-coyote.jar"/>
> ....
> 
> 
> Here is the path element.
> 
> <path id="tomcat.libs">
> <pathelement location="${catalina.jar}"/>
>        <pathelement location="build"/>
>         ....
>        <pathelement location="${jasper-compiler.jar}"/>
>        <pathelement location="${servlets-default.jar}"/>
>        <pathelement location="${jasper-compiler-jdt.jar}"/>
>        <pathelement location="${jasper-runtime.jar}"/>
>        <pathelement location="${jsp-api.jar}"/>
>        <pathelement location="${catalina-ant-jmx.jar}"/>
>        <pathelement location="${catalina-ant.jar}"/>
>        <pathelement location="${catalina-optional.jar}"/>
>         ...
> 
>    </path>
> 
> 
> anandsrider.d@polaris.co.in wrote:
>> Jeevan...
>>
>> Think so in the classpath tag simple U have created a target. Point the
>> target to  path where dependency jar files exists in the environment by
>> using the below tag.
>>
>> <path id="tomcat.libs">
>>       <pathelement location="${<jar files path>}"/>
>> </path>
>>
>> Try after doing the same.
>>
>> rgds,
>> anand
>>
>>
>>
>>
>>                                                                                 
                                                       
>>                       Jeevan                                                    
                                                       
>>                       <Jeevan.Ramakrish         To:      user@ant.apache.org 
                                                          
>>                       na@Sun.COM>               cc:      (bcc: anandsrider.d/Polaris)
                                                  
>>                       Sent by:                  Subject: ClassNotFoundException when
appropriate jat in classpath                       
>>                       Jeevan.Ramakrishn                                         
                                                       
>>                       a@Sun.COM                                                 
                                                       
>>                                                                                 
                                                       
>>                                                                                 
                                                       
>>                       07/17/2006 12:01                                          
                                                       
>>                       PM                                                        
                                                       
>>                       Please respond to                                         
                                                       
>>                       "Ant Users List"                                          
                                                       
>>                                                                                 
                                                       
>>                                                                                 
                                                       
>>
>>
>>
>>
>> Hi All,
>> I have a weird problem. I am a beginner with ant, I am trying to run a
>> program which contains the following code sample.
>>
>> <Javacode>
>> System.setProperty("catalina.home", mTomcatHome);
>> System.setProperty("catalina.base", mTomcatHome);
>> String[] serverArgs = {"-config","conf" + File.separator + "server.xml"
>> ,"start"};
>> Catalina server = new Catalina();
>> server.setParentClassLoader(getClass().getClassLoader());
>> server.process(serverArgs);
>> </Javacode>
>>
>> using the following ant script
>>
>> <target name="tomcat" description="Deploy the application and run tomcat">
>>          <mkdir dir="${build.dir}"/>
>>          <javac srcdir="./util" destdir="." includeAntRuntime="no"
>> includeJavaRuntime="no"
>>                fork="yes" memoryMaximumSize="${jvm.maxmemory}"
>> debug="${debug.flag}"
>>                deprecation="${deprecation.flag}">
>>            <classpath>
>>                 <path refid="tomcat.libs"/>
>>             </classpath>
>>          </javac>
>>          <java classname="util.TomcatBooter" fork="yes">
>>               <arg value="${catalina.home}"/>
>>               <classpath>
>>                 <path refid="tomcat.libs"/>
>>               </classpath>
>>          </java>
>>      </target>
>>
>> Although on running this target the tomcat starts, tomcat is not
>> rendering the pages and puts out an Exception that says
>> java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet.
>> Although I have included all the jars available from tomcat including
>> jasper-compiler.jar (which contains JspServlet).
>> I have tried it out with a shell script and it works just fine.
>> Any help is appreciated.
>> Thanks and Regards,
>> Jeevan
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>>
>> This e-Mail may contain proprietary and confidential information and is sent for
the intended recipient(s) only.  If by an addressing or transmission error this mail has been
misdirected to you, you are requested to delete this mail immediately. You are also hereby
notified that any use, any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment other than
by its intended recipient/s is strictly prohibited.
>>
>> Visit us at http://www.polaris.co.in
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
>
Mime
View raw message