MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
pinesystems
Post subject: build error using build.xml  PostPosted: Jan 11, 2009 - 07:46 PM
Registered Member
Registered Member


Joined: May 21, 2006
Posts: 13

Hi,
I am using MyEclipse 6.0.1 and and tomcat 6.
when I ran build.xml (see content below), I got the following error message.
Please advise,
Jimmy

C:\workspace\simplepro1\build.xml:83:
taskdef class org.apache.catalina.ant.InstallTask cannot be found

build.xml content:
Code:

<?xml version="1.0"?>
<project name="simplepro" basedir="." default="usage">
   <property file="build.properties" />
   <property name="src.dir" value="src" />
   <property name="web.dir" value="war" />
   <property name="build.dir" value="${web.dir}/WEB-INF/classes" />
   <property name="name" value="simplepro" />
   <path id="master-classpath">
      <fileset dir="${web.dir}/WEB-INF/lib">
         <include name="*.jar" />
      </fileset>
      <!-- We need the servlet API classes:        -->
      <!--   for Tomcat 4.1 use servlet.jar        -->
      <!--   for Tomcat 5.0 use servlet-api.jar    -->
      <!--   for Other app server - check the docs -->
      <fileset dir="${appserver.home}/lib">
         <include name="servlet*.jar" />
      </fileset>
      <pathelement path="${build.dir}" />
   </path>
   <target name="usage">
      <echo message="" />
      <echo message="${name} build file" />
      <echo message="-----------------------------------" />
      <echo message="" />
      <echo message="Available targets are:" />
      <echo message="" />
      <echo message="build     --> Build the application" />
      <echo message="deploy    --> Deploy application as directory" />
      <echo message="deploywar --> Deploy application as a WAR file" />
      <echo message="clean     --> Clean output directories" />
      <echo message="undeploy  --> Un-Deploy application" />
      <echo message="install   --> Install application in Tomcat" />
      <echo message="reload    --> Reload application in Tomcat" />
      <echo message="start     --> Start Tomcat application" />
      <echo message="stop      --> Stop Tomcat application" />
      <echo message="list      --> List Tomcat applications" />
      <echo message="" />
   </target>
   <target name="build" description="Compile main source tree java files">
      <mkdir dir="${build.dir}" />
      <javac destdir="${build.dir}" debug="true" deprecation="false" optimize="false" failonerror="true">
         <src path="${src.dir}" />
         <classpath refid="master-classpath" />
      </javac>
   </target>
   <target name="deploy" depends="build" description="Deploy application">
      <copy todir="${deploy.path}/${name}" preservelastmodified="true">
         <fileset dir="${web.dir}">
            <include name="**/*.*" />
         </fileset>
      </copy>
   </target>
   <target name="deploywar" depends="build" description="Deploy application as a WAR file">
      <war destfile="${name}.war" webxml="${web.dir}/WEB-INF/web.xml">
         <fileset dir="${web.dir}">
            <include name="**/*.*" />
         </fileset>
      </war>
      <copy todir="${deploy.path}" preservelastmodified="true">
         <fileset dir=".">
            <include name="*.war" />
         </fileset>
      </copy>
   </target>
   <target name="clean" description="Clean output directories">
      <delete>
         <fileset dir="${build.dir}">
            <include name="**/*.class" />
         </fileset>
      </delete>
   </target>
   <target name="undeploy" description="Un-Deploy application">
      <delete>
         <fileset dir="${deploy.path}/${name}">
            <include name="**/*.*" />
         </fileset>
      </delete>
   </target>
   <!-- ============================================================== -->
   <!-- Tomcat tasks - remove these if you don't have Tomcat installed -->
   <!-- ============================================================== -->
   <taskdef name="install" classname="org.apache.catalina.ant.InstallTask">
      <classpath>
         <path location="${appserver.home}/lib/catalina-ant.jar" />
      </classpath>
   </taskdef>
   <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask">
      <classpath>
         <path location="${appserver.home}/lib/catalina-ant.jar" />
      </classpath>
   </taskdef>
   <taskdef name="list" classname="org.apache.catalina.ant.ListTask">
      <classpath>
         <path location="${appserver.home}/lib/catalina-ant.jar" />
      </classpath>
   </taskdef>
   <taskdef name="start" classname="org.apache.catalina.ant.StartTask">
      <classpath>
         <path location="${appserver.home}/lib/catalina-ant.jar" />
      </classpath>
   </taskdef>
   <taskdef name="stop" classname="org.apache.catalina.ant.StopTask">
      <classpath>
         <path location="${appserver.home}/lib/catalina-ant.jar" />
      </classpath>
   </taskdef>
   <target name="install" description="Install application in Tomcat">
      <install url="${tomcat.manager.url}"
                   username="${tomcat.manager.username}"
                   password="${tomcat.manager.password}"
                   path="/${name}"
                   war="${name}" />
   </target>
   <target name="reload" description="Reload application in Tomcat">
      <reload url="${tomcat.manager.url}"
               username="${tomcat.manager.username}"
               password="${tomcat.manager.password}"
               path="/${name}" />
   </target>
   <target name="start" description="Start Tomcat application">
      <start url="${tomcat.manager.url}"
                username="${tomcat.manager.username}"
                password="${tomcat.manager.password}"
                path="/${name}" />
   </target>
   <target name="stop" description="Stop Tomcat application">
      <stop url="${tomcat.manager.url}"
               username="${tomcat.manager.username}"
               password="${tomcat.manager.password}"
               path="/${name}" />
   </target>
   <target name="list" description="List Tomcat applications">
      <list url="${tomcat.manager.url}"
               username="${tomcat.manager.username}"
               password="${tomcat.manager.password}" />
   </target>
   <!-- End Tomcat tasks -->
</project>
 
 View user's profile Send private message  
Reply with quote Back to top
support-nipun
Post subject: RE: build error using build.xml  PostPosted: Jan 12, 2009 - 04:38 PM
Registered Member
Registered Member


Joined: Apr 18, 2007
Posts: 8012

Looks like you build file cannot find the task class. You should check to make sure the jar the build file is looking for is present in the directory specified in the build file.

_________________
Nipun
MyEclipse Support
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
pinesystems
Post subject:   PostPosted: Jan 12, 2009 - 09:04 PM
Registered Member
Registered Member


Joined: May 21, 2006
Posts: 13

my tomcat base folder is located at c:\tomcat6

There are 17 jar files in the c:\tomcat6\lib folder:
annotations-api.jar, catalina-ant.jar, ...., etc.

I suspect I did NOT set up the tomcat server within the MyEclipse environment correctly.

Could you provide me with a detailed procedure how to set up the tomcat6 folder in the MyEclipse environment?

Thanks,
Jimmy
 
 View user's profile Send private message  
Reply with quote Back to top
pinesystems
Post subject:   PostPosted: Jan 13, 2009 - 07:58 AM
Registered Member
Registered Member


Joined: May 21, 2006
Posts: 13

I copied the catalina-ant.jar file from the tomcat6 lib folder to the ant lib folder.
It is working now.


New Question:

How do I set the tomcat manager username and password in MyEclipse?

I've already set the manager role correctly in the tomcat-users.xml file.

Thanks,
Jimmy


<target name="install" description="Install application in Tomcat">
<install url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"
path="/${name}"
war="${name}" />
</target>
 
 View user's profile Send private message  
Reply with quote Back to top
support-nipun
Post subject:   PostPosted: Jan 13, 2009 - 08:47 PM
Registered Member
Registered Member


Joined: Apr 18, 2007
Posts: 8012

The tomcat administrator has been discussed in this post. Hope that helps:-
http://www.myeclipseide.com/PNphpBB2-printview-t-4849-start-15.html

_________________
Nipun
MyEclipse Support
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
pinesystems
Post subject: build.xml:113: java.net.MalformedURLException: no protocol:  PostPosted: Jan 14, 2009 - 06:47 AM
Registered Member
Registered Member


Joined: May 21, 2006
Posts: 13

Perhaps I did NOT explain my problem clearly.

The tomcat manager is set up CORRECTLY, I can access it from
http://localhost:8080 with NO problem.

The PROBLEM that I HAVE is listed below

Buildfile: C:\workspace\simplepro1\build.xml
install:

BUILD FAILED
C:\workspace\simplepro1\build.xml:113: java.net.MalformedURLException: no protocol: ${tomcat.manager.url}/install?path=%2Fsimplepro&war=simplepro


CONTENT of build.xml is listed below:

Code:
<?xml version="1.0"?>
<project name="simplepro" basedir="." default="usage">
   <property file="build.properties" />
   <property name="src.dir" value="src" />
   <property name="web.dir" value="war" />
   <property name="build.dir" value="${web.dir}/WEB-INF/classes" />
   <property name="name" value="simplepro" />
   <path id="master-classpath">
      <fileset dir="${web.dir}/WEB-INF/lib">
         <include name="*.jar" />
      </fileset>
      <!-- We need the servlet API classes:        -->
      <!--   for Tomcat 4.1 use servlet.jar        -->
      <!--   for Tomcat 5.0 use servlet-api.jar    -->
      <!--   for Other app server - check the docs -->
      <fileset dir="${appserver.home}/lib">
         <include name="servlet*.jar" />
      </fileset>
      <pathelement path="${build.dir}" />
   </path>
   <target name="usage">
      <echo message="" />
      <echo message="${name} build file" />
      <echo message="-----------------------------------" />
      <echo message="" />
      <echo message="Available targets are:" />
      <echo message="" />
      <echo message="build     --> Build the application" />
      <echo message="deploy    --> Deploy application as directory" />
      <echo message="deploywar --> Deploy application as a WAR file" />
      <echo message="clean     --> Clean output directories" />
      <echo message="undeploy  --> Un-Deploy application" />
      <echo message="install   --> Install application in Tomcat" />
      <echo message="reload    --> Reload application in Tomcat" />
      <echo message="start     --> Start Tomcat application" />
      <echo message="stop      --> Stop Tomcat application" />
      <echo message="list      --> List Tomcat applications" />
      <echo message="" />
   </target>
   <target name="build" description="Compile main source tree java files">
      <mkdir dir="${build.dir}" />
      <javac destdir="${build.dir}" debug="true" deprecation="false" optimize="false" failonerror="true">
         <src path="${src.dir}" />
         <classpath refid="master-classpath" />
      </javac>
   </target>
   <target name="deploy" depends="build" description="Deploy application">
      <copy todir="${deploy.path}/${name}" preservelastmodified="true">
         <fileset dir="${web.dir}">
            <include name="**/*.*" />
         </fileset>
      </copy>
   </target>
   <target name="deploywar" depends="build" description="Deploy application as a WAR file">
      <war destfile="${name}.war" webxml="${web.dir}/WEB-INF/web.xml">
         <fileset dir="${web.dir}">
            <include name="**/*.*" />
         </fileset>
      </war>
      <copy todir="${deploy.path}" preservelastmodified="true">
         <fileset dir=".">
            <include name="*.war" />
         </fileset>
      </copy>
   </target>
   <target name="clean" description="Clean output directories">
      <delete>
         <fileset dir="${build.dir}">
            <include name="**/*.class" />
         </fileset>
      </delete>
   </target>
   <target name="undeploy" description="Un-Deploy application">
      <delete>
         <fileset dir="${deploy.path}/${name}">
            <include name="**/*.*" />
         </fileset>
      </delete>
   </target>
   <!-- ============================================================== -->
   <!-- Tomcat tasks - remove these if you don't have Tomcat installed -->
   <!-- ============================================================== -->
   <taskdef name="install" classname="org.apache.catalina.ant.InstallTask">
      <classpath>
         <path location="${appserver.home}/lib/catalina-ant.jar" />
      </classpath>
   </taskdef>
   <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask">
      <classpath>
         <path location="${appserver.home}/lib/catalina-ant.jar" />
      </classpath>
   </taskdef>
   <taskdef name="list" classname="org.apache.catalina.ant.ListTask">
      <classpath>
         <path location="${appserver.home}/lib/catalina-ant.jar" />
      </classpath>
   </taskdef>
   <taskdef name="start" classname="org.apache.catalina.ant.StartTask">
      <classpath>
         <path location="${appserver.home}/lib/catalina-ant.jar" />
      </classpath>
   </taskdef>
   <taskdef name="stop" classname="org.apache.catalina.ant.StopTask">
      <classpath>
         <path location="${appserver.home}/lib/catalina-ant.jar" />
      </classpath>
   </taskdef>
   <target name="install" description="Install application in Tomcat">
      <install url="${tomcat.manager.url}"
                   username="${tomcat.manager.username}"
                   password="${tomcat.manager.password}"
                   path="/${name}"
                   war="${name}" />
   </target>
   <target name="reload" description="Reload application in Tomcat">
      <reload url="${tomcat.manager.url}"
               username="${tomcat.manager.username}"
               password="${tomcat.manager.password}"
               path="/${name}" />
   </target>
   <target name="start" description="Start Tomcat application">
      <start url="${tomcat.manager.url}"
                username="${tomcat.manager.username}"
                password="${tomcat.manager.password}"
                path="/${name}" />
   </target>
   <target name="stop" description="Stop Tomcat application">
      <stop url="${tomcat.manager.url}"
               username="${tomcat.manager.username}"
               password="${tomcat.manager.password}"
               path="/${name}" />
   </target>
   <target name="list" description="List Tomcat applications">
      <list url="${tomcat.manager.url}"
               username="${tomcat.manager.username}"
               password="${tomcat.manager.password}" />
   </target>
   <!-- End Tomcat tasks -->
</project>
 
 View user's profile Send private message  
Reply with quote Back to top
jhm
Post subject: RE: build.xml:113: java.net.MalformedURLException: no protoc  PostPosted: Jan 15, 2009 - 09:12 AM



Joined: Apr 07, 2006
Posts: 61

1. For all the taskdefs it would be easier to set an "id" attribute on the first <taskdef><classpath> and use <taskdef><classpath refid> for following taskdefs.
2. When you add JARs to ANT_HOME/lib you change the Ant classpath for other projects too. So be careful with that.
3. Is you property appserver.home set correctly? Ensure that ${appserver.home}/lib/catalina-ant.jar is found.
4. Your last problem seems to be that the property tomcat.manager.url is not set. Otherwise the error message would print the calculated value.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits