Failed to create task cobertura-instrument

View: New views
9 Messages — Rating Filter:   Alert me  

Failed to create task cobertura-instrument

by Lionelv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've search this forum but have had no luck with this error.

On my first attempt I tried:

<taskdef classpath="${libcommon.dir}/cobertura.jar" resource="tasks.properties"/>

and

<target name="instrument" depends="compile">
    <cobertura-instrument todir="${instrumented-classes.dir}">
      <fileset dir="${classes.dir}">
        <include name="**/*.class"/>
      </fileset>
    </cobertura-instrument>
  </target>

But got error "java.lang.NoClassDefFoundError: org/apache/log4j/Logger".

I tried various solutions to tell it about Log4j but the solution I see on this forum to this is:

<path id="cobertura.classpath">
    <pathelement location="${libcommon.dir}/cobertura.jar"/>
    <pathelement location="${libcommon.dir}/lib/log4j-1.2.9.jar" />
</path>

<taskdef classpath="cobertura.classpath" resource="tasks.properties"/>

I also tried:

<path id="cobertura.classpath">
    <fileset dir="${libcommon.dir}">
        <include name="cobertura.jar" />
        <include name="lib/**/*.jar" />
    </fileset>
</path>

But these yield the error:

C:\MDATool\Subsystems\QRRegional\Utilities\build.xml:149: Problem: failed to create task or type cobertura-instrument
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

where line 149 is second line of:

<target name="instrument" depends="compile">
    <cobertura-instrument todir="${instrumented-classes.dir}">
      <fileset dir="${classes.dir}">
        <include name="**/*.class"/>
      </fileset>
    </cobertura-instrument>
</target>

When I use the example that I download with Cobertura, it works fine.

Does anyone know why it stops picking up the task?

Thanks

Lionel.

Re: Failed to create task cobertura-instrument

by Lionelv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lionelv wrote:
I tried various solutions to tell it about Log4j but the solution I see on this forum to this is:

<path id="cobertura.classpath">
    <pathelement location="${libcommon.dir}/cobertura.jar"/>
    <pathelement location="${libcommon.dir}/lib/log4j-1.2.9.jar" />
</path>

<taskdef classpath="cobertura.classpath" resource="tasks.properties"/>

I also tried:

<path id="cobertura.classpath">
    <fileset dir="${libcommon.dir}">
        <include name="cobertura.jar" />
        <include name="lib/**/*.jar" />
    </fileset>
</path>
Sorry, this error occurs when running the ant target from within Netbeans. If I run it from the command line I get:

BUILD FAILED
c:\MDATool\Subsystems\QRRegional\Utilities\build.xml:156: java.lang.NoClassDefFoundError: org/apache/log4j/Category

I'm at a complete loss!

Re: Failed to create task cobertura-instrument

by Lionelv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lionelv wrote:
Lionelv wrote:
I tried various solutions to tell it about Log4j but the solution I see on this forum to this is:

<path id="cobertura.classpath">
    <pathelement location="${libcommon.dir}/cobertura.jar"/>
    <pathelement location="${libcommon.dir}/lib/log4j-1.2.9.jar" />
</path>

<taskdef classpath="cobertura.classpath" resource="tasks.properties"/>

I also tried:

<path id="cobertura.classpath">
    <fileset dir="${libcommon.dir}">
        <include name="cobertura.jar" />
        <include name="lib/**/*.jar" />
    </fileset>
</path>
Sorry, this error occurs when running the ant target from within Netbeans. If I run it from the command line I get:

BUILD FAILED
c:\MDATool\Subsystems\QRRegional\Utilities\build.xml:156: java.lang.NoClassDefFoundError: org/apache/log4j/Category

I'm at a complete loss!
Nope, sorry. Wrong again. The above message happens if I put the jar files in ANT_HOME/lib, but if I remove them again I get the "failed to create task or type cobertura-instrument" message again.

Re: Failed to create task cobertura-instrument

by Uldis Karlovs-Karlovskis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I use this:

<path id="cobertura.classpath">
                <fileset dir="${ext.lib.dir}">
                        <include name="cobertura-1.9.jar" />
                        <include name="asm-2.2.1.jar" />
                        <include name="asm-tree-2.2.1.jar" />
                        <include name="log4j-1.2.9.jar" />
                </fileset>
                <fileset file="${scm.ANT_HOME}/lib/jakarta-oro-2.0.8.jar" />
        </path>
        <taskdef classpathref="cobertura.classpath"
resource="tasks.properties" />

Didn`t understand what do You want to accomplish.

Regards,
Uldis, C. T. Co
uldis.karlovs-karlovskis@...
 
-----Original Message-----
From: cobertura-devel-bounces@...
[mailto:cobertura-devel-bounces@...] On Behalf Of Lionelv
Sent: otrdiena, 2008. gada 10. jūnijā 10:44
To: cobertura-devel@...
Subject: [Cobertura-devel] Failed to create task cobertura-instrument


I've search this forum but have had no luck with this error.

On my first attempt I tried:

<taskdef classpath="${libcommon.dir}/cobertura.jar"
resource="tasks.properties"/>

and

<target name="instrument" depends="compile">
    <cobertura-instrument todir="${instrumented-classes.dir}">
      <fileset dir="${classes.dir}">
        <include name="**/*.class"/>
      </fileset>
    </cobertura-instrument>
  </target>

But got error "java.lang.NoClassDefFoundError: org/apache/log4j/Logger".

I tried various solutions to tell it about Log4j but the solution I see on
this forum to this is:

<path id="cobertura.classpath">
    <pathelement location="${libcommon.dir}/cobertura.jar"/>
    <pathelement location="${libcommon.dir}/lib/log4j-1.2.9.jar" />
</path>

<taskdef classpath="cobertura.classpath" resource="tasks.properties"/>

I also tried:

<path id="cobertura.classpath">
    <fileset dir="${libcommon.dir}">
        <include name="cobertura.jar" />
        <include name="lib/**/*.jar" />
    </fileset>
</path>

But these yield the error:

C:\MDATool\Subsystems\QRRegional\Utilities\build.xml:149: Problem: failed to
create task or type cobertura-instrument
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

where line 149 is second line of:

<target name="instrument" depends="compile">
    <cobertura-instrument todir="${instrumented-classes.dir}">
      <fileset dir="${classes.dir}">
        <include name="**/*.class"/>
      </fileset>
    </cobertura-instrument>
</target>

When I use the example that I download with Cobertura, it works fine.

Does anyone know why it stops picking up the task?

Thanks

Lionel.
--
View this message in context:
http://www.nabble.com/Failed-to-create-task-cobertura-instrument-tp17749578p
17749578.html
Sent from the cobertura-devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Cobertura-devel mailing list
Cobertura-devel@...
https://lists.sourceforge.net/lists/listinfo/cobertura-devel



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Cobertura-devel mailing list
Cobertura-devel@...
https://lists.sourceforge.net/lists/listinfo/cobertura-devel

Re: Failed to create task cobertura-instrument

by John W. Lewis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


You need to use classpathref - not classpath:

<taskdef classpathref="cobertura.classpath" ...

-----Original Message-----
From: cobertura-devel-bounces@... [mailto:cobertura-devel-bounces@...] On Behalf Of Lionelv
Sent: Tuesday, June 10, 2008 3:44 AM
To: cobertura-devel@...
Subject: [Cobertura-devel] Failed to create task cobertura-instrument


I've search this forum but have had no luck with this error.

On my first attempt I tried:

<taskdef classpath="${libcommon.dir}/cobertura.jar"
resource="tasks.properties"/>

and

<target name="instrument" depends="compile">
    <cobertura-instrument todir="${instrumented-classes.dir}">
      <fileset dir="${classes.dir}">
        <include name="**/*.class"/>
      </fileset>
    </cobertura-instrument>
  </target>

But got error "java.lang.NoClassDefFoundError: org/apache/log4j/Logger".

I tried various solutions to tell it about Log4j but the solution I see on
this forum to this is:

<path id="cobertura.classpath">
    <pathelement location="${libcommon.dir}/cobertura.jar"/>
    <pathelement location="${libcommon.dir}/lib/log4j-1.2.9.jar" />
</path>

<taskdef classpath="cobertura.classpath" resource="tasks.properties"/>

I also tried:

<path id="cobertura.classpath">
    <fileset dir="${libcommon.dir}">
        <include name="cobertura.jar" />
        <include name="lib/**/*.jar" />
    </fileset>
</path>

But these yield the error:

C:\MDATool\Subsystems\QRRegional\Utilities\build.xml:149: Problem: failed to
create task or type cobertura-instrument
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

where line 149 is second line of:

<target name="instrument" depends="compile">
    <cobertura-instrument todir="${instrumented-classes.dir}">
      <fileset dir="${classes.dir}">
        <include name="**/*.class"/>
      </fileset>
    </cobertura-instrument>
</target>

When I use the example that I download with Cobertura, it works fine.

Does anyone know why it stops picking up the task?

Thanks

Lionel.
--
View this message in context: http://www.nabble.com/Failed-to-create-task-cobertura-instrument-tp17749578p17749578.html
Sent from the cobertura-devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Cobertura-devel mailing list
Cobertura-devel@...
https://lists.sourceforge.net/lists/listinfo/cobertura-devel


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Cobertura-devel mailing list
Cobertura-devel@...
https://lists.sourceforge.net/lists/listinfo/cobertura-devel

Re: Failed to create task cobertura-instrument

by Lionelv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


John W. Lewis wrote:
You need to use classpathref - not classpath:
Thanks, that did the trick. I thought I had tried this!

I have another problem now, the instrument task doesn't seem to be copying all my files to the output directory, but if I can't figure that out I will start a new thread or search this forum first.

Re: Failed to create task cobertura-instrument

by John W. Lewis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


That is normal.   It only copies over classes that it instruments.  So, you either have to instrument the classes in place by removing the todir attribute, or you make sure the non-instrumented directory is also on the classpath - after the instrumented classes.

-----Original Message-----
From: cobertura-devel-bounces@... [mailto:cobertura-devel-bounces@...] On Behalf Of Lionelv
Sent: Tuesday, June 10, 2008 6:46 PM
To: cobertura-devel@...
Subject: Re: [Cobertura-devel] Failed to create task cobertura-instrument




John W. Lewis wrote:
>
>
> You need to use classpathref - not classpath:
>
>

Thanks, that did the trick. I thought I had tried this!

I have another problem now, the instrument task doesn't seem to be copying
all my files to the output directory, but if I can't figure that out I will
start a new thread or search this forum first.
--
View this message in context: http://www.nabble.com/Failed-to-create-task-cobertura-instrument-tp17749578p17766445.html
Sent from the cobertura-devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Cobertura-devel mailing list
Cobertura-devel@...
https://lists.sourceforge.net/lists/listinfo/cobertura-devel


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Cobertura-devel mailing list
Cobertura-devel@...
https://lists.sourceforge.net/lists/listinfo/cobertura-devel

Re: Failed to create task cobertura-instrument

by Lionelv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

OK, thanks. I had managed to fix this. Why does it not instrument all classes?



On 11/06/2008, John W. Lewis <JohnW.Lewis@...> wrote:

That is normal.   It only copies over classes that it instruments.  So, you either have to instrument the classes in place by removing the todir attribute, or you make sure the non-instrumented directory is also on the classpath - after the instrumented classes.


-----Original Message-----
From: cobertura-devel-bounces@... [mailto:cobertura-devel-bounces@...] On Behalf Of Lionelv

Sent: Tuesday, June 10, 2008 6:46 PM
To: cobertura-devel@...

Subject: Re: [Cobertura-devel] Failed to create task cobertura-instrument




John W. Lewis wrote:
>
>
> You need to use classpathref - not classpath:
>
>

Thanks, that did the trick. I thought I had tried this!

I have another problem now, the instrument task doesn't seem to be copying
all my files to the output directory, but if I can't figure that out I will
start a new thread or search this forum first.
--
View this message in context: http://www.nabble.com/Failed-to-create-task-cobertura-instrument-tp17749578p17766445.html
Sent from the cobertura-devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Cobertura-devel mailing list
Cobertura-devel@...
https://lists.sourceforge.net/lists/listinfo/cobertura-devel



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Cobertura-devel mailing list
Cobertura-devel@...
https://lists.sourceforge.net/lists/listinfo/cobertura-devel

Re: Failed to create task cobertura-instrument

by John W. Lewis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

 

Interfaces are not instrumented.   You can also exclude classes from instrumentation.

 

From: Lionel van den Berg [mailto:lionelv@...]
Sent: Tuesday, June 10, 2008 7:50 PM
To: John W. Lewis
Cc: cobertura-devel@...
Subject: Re: [Cobertura-devel] Failed to create task cobertura-instrument

 

OK, thanks. I had managed to fix this. Why does it not instrument all classes?


On 11/06/2008, John W. Lewis <JohnW.Lewis@...> wrote:


That is normal.   It only copies over classes that it instruments.  So, you either have to instrument the classes in place by removing the todir attribute, or you make sure the non-instrumented directory is also on the classpath - after the instrumented classes.


-----Original Message-----
From: cobertura-devel-bounces@... [mailto:cobertura-devel-bounces@...] On Behalf Of Lionelv

Sent: Tuesday, June 10, 2008 6:46 PM
To: cobertura-devel@...

Subject: Re: [Cobertura-devel] Failed to create task cobertura-instrument




John W. Lewis wrote:
>
>
> You need to use classpathref - not classpath:
>
>

Thanks, that did the trick. I thought I had tried this!

I have another problem now, the instrument task doesn't seem to be copying
all my files to the output directory, but if I can't figure that out I will
start a new thread or search this forum first.
--
View this message in context: http://www.nabble.com/Failed-to-create-task-cobertura-instrument-tp17749578p17766445.html
Sent from the cobertura-devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Cobertura-devel mailing list
Cobertura-devel@...
https://lists.sourceforge.net/lists/listinfo/cobertura-devel

 


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Cobertura-devel mailing list
Cobertura-devel@...
https://lists.sourceforge.net/lists/listinfo/cobertura-devel