Re: Maven 2.0.9 NullpointerException when running tests

2009-01-27 Thread aminm

Hi

Thanks again for your replies.  It seems as though the text mininng
dependency was the culprit.  I removed the dependency and it started
working.  This is still strange as I explicitly set an exclusion of poi in
text mining.

Anyway it's working correctly so thanks again!


Cheers

Amin

Brett Randall wrote:
 
 I Googled that stack trace for you and it pointed me straight to the POI
 FAQ
 here: http://poi.apache.org/faq.html#faq-N10006 .  Classpath debugging
 advice there - you might need to check if you have an overlapping
 dependency, so dependency:analyze and dependency:tree are probably good
 starts.
 
 Best
 Brett
 
 On Tue, Jan 27, 2009 at 6:24 AM, aminm ami...@gmail.com wrote:
 



 Dave Newton wrote:
 
  Geoffrey Wiseman wrote:
  On Sun, Jan 25, 2009 at 7:21 PM, Dave Newton newton.d...@yahoo.com
  wrote:
  Does 4.5 not work?
  I was just responding to Amin's comment about JUnit 4.4 [...]
 
  Ah, missed that--never mind :)
 
  Dave
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
  For additional commands, e-mail: users-h...@maven.apache.org
 
 
 

 Hi

 Thanks for the replies!  I managed to get the surefire plugin to use
 junit
 4.  However I am getting some strange behaviour, in that some of my tests
 fail, while they all run fine in eclipse.  I am using text mining as a
 dependency and exclude the version of poi that comes with it.   The
 exception that I get is


 testCanCreateLuceneDocumentForMSWordDocument(com.amin.app.lucene.index.handler.ms.MSWordHandlerTest)
 Time elapsed: 0.038 sec   ERROR!
 java.lang.NoSuchMethodError:

 org.apache.poi.poifs.filesystem.POIFSFileSystem.getRoot()Lorg/apache/poi/poifs/filesystem/DirectoryNode;
at org.apache.poi.hwpf.HWPFDocument.init(HWPFDocument.java:158)
at
 org.apache.poi.hwpf.extractor.WordExtractor.init(WordExtractor.java:59)
at

 com.amin.app.lucene.index.handler.ms.MSWordHandler.extractText(MSWordHandler.java:16)


 I know that this exception occurs if I am using an old version of poi
 (2.5),
 even though I have excluded the version that comes with text mining.  I
 have
 added

dependency
groupIdorg.apache.poi/groupId
artifactIdpoi/artifactId
version3.5-beta4/version
scopecompile/scope
/dependency

 This is very strange and I can't understand why the tests won't run.

 Any help again would be appreciated.



 --
 View this message in context:
 http://n2.nabble.com/Maven-2.0.9-NullpointerException-when-running-tests-tp2209372p2220012.html
 Sent from the maven users mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org


 
 

-- 
View this message in context: 
http://n2.nabble.com/Maven-2.0.9-NullpointerException-when-running-tests-tp2209372p945.html
Sent from the maven users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven 2.0.9 NullpointerException when running tests

2009-01-26 Thread aminm



Dave Newton wrote:
 
 Geoffrey Wiseman wrote:
 On Sun, Jan 25, 2009 at 7:21 PM, Dave Newton newton.d...@yahoo.com
 wrote:
 Does 4.5 not work?
 I was just responding to Amin's comment about JUnit 4.4 [...]
 
 Ah, missed that--never mind :)
 
 Dave
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org
 
 
 

Hi

Thanks for the replies!  I managed to get the surefire plugin to use junit
4.  However I am getting some strange behaviour, in that some of my tests
fail, while they all run fine in eclipse.  I am using text mining as a
dependency and exclude the version of poi that comes with it.   The
exception that I get is

testCanCreateLuceneDocumentForMSWordDocument(com.amin.app.lucene.index.handler.ms.MSWordHandlerTest)
 
Time elapsed: 0.038 sec   ERROR!
java.lang.NoSuchMethodError:
org.apache.poi.poifs.filesystem.POIFSFileSystem.getRoot()Lorg/apache/poi/poifs/filesystem/DirectoryNode;
at org.apache.poi.hwpf.HWPFDocument.init(HWPFDocument.java:158)
at
org.apache.poi.hwpf.extractor.WordExtractor.init(WordExtractor.java:59)
at
com.amin.app.lucene.index.handler.ms.MSWordHandler.extractText(MSWordHandler.java:16)


I know that this exception occurs if I am using an old version of poi (2.5),
even though I have excluded the version that comes with text mining.  I have
added 

dependency
groupIdorg.apache.poi/groupId
artifactIdpoi/artifactId
version3.5-beta4/version
scopecompile/scope
/dependency

This is very strange and I can't understand why the tests won't run.

Any help again would be appreciated. 



-- 
View this message in context: 
http://n2.nabble.com/Maven-2.0.9-NullpointerException-when-running-tests-tp2209372p2220012.html
Sent from the maven users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven 2.0.9 NullpointerException when running tests

2009-01-26 Thread Geoffrey Wiseman
On Mon, Jan 26, 2009 at 2:24 PM, aminm ami...@gmail.com wrote:

 I know that this exception occurs if I am using an old version of poi
 (2.5),
 even though I have excluded the version that comes with text mining.  I
 have
 added

dependency
groupIdorg.apache.poi/groupId
artifactIdpoi/artifactId
version3.5-beta4/version
scopecompile/scope
/dependency

 This is very strange and I can't understand why the tests won't run.

 Any help again would be appreciated.


Nothing leaps to mind right away -- try mvn dependency:tree and mvn
help:effective-pom to see if you're getting the dependencies that you
expect to get, and no additional dependencies?

  - Geoffrey
-- 
Geoffrey Wiseman
http://www.geoffreywiseman.ca/


Re: Maven 2.0.9 NullpointerException when running tests

2009-01-26 Thread Brett Randall
I Googled that stack trace for you and it pointed me straight to the POI FAQ
here: http://poi.apache.org/faq.html#faq-N10006 .  Classpath debugging
advice there - you might need to check if you have an overlapping
dependency, so dependency:analyze and dependency:tree are probably good
starts.

Best
Brett

On Tue, Jan 27, 2009 at 6:24 AM, aminm ami...@gmail.com wrote:




 Dave Newton wrote:
 
  Geoffrey Wiseman wrote:
  On Sun, Jan 25, 2009 at 7:21 PM, Dave Newton newton.d...@yahoo.com
  wrote:
  Does 4.5 not work?
  I was just responding to Amin's comment about JUnit 4.4 [...]
 
  Ah, missed that--never mind :)
 
  Dave
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
  For additional commands, e-mail: users-h...@maven.apache.org
 
 
 

 Hi

 Thanks for the replies!  I managed to get the surefire plugin to use junit
 4.  However I am getting some strange behaviour, in that some of my tests
 fail, while they all run fine in eclipse.  I am using text mining as a
 dependency and exclude the version of poi that comes with it.   The
 exception that I get is


 testCanCreateLuceneDocumentForMSWordDocument(com.amin.app.lucene.index.handler.ms.MSWordHandlerTest)
 Time elapsed: 0.038 sec   ERROR!
 java.lang.NoSuchMethodError:

 org.apache.poi.poifs.filesystem.POIFSFileSystem.getRoot()Lorg/apache/poi/poifs/filesystem/DirectoryNode;
at org.apache.poi.hwpf.HWPFDocument.init(HWPFDocument.java:158)
at
 org.apache.poi.hwpf.extractor.WordExtractor.init(WordExtractor.java:59)
at

 com.amin.app.lucene.index.handler.ms.MSWordHandler.extractText(MSWordHandler.java:16)


 I know that this exception occurs if I am using an old version of poi
 (2.5),
 even though I have excluded the version that comes with text mining.  I
 have
 added

dependency
groupIdorg.apache.poi/groupId
artifactIdpoi/artifactId
version3.5-beta4/version
scopecompile/scope
/dependency

 This is very strange and I can't understand why the tests won't run.

 Any help again would be appreciated.



 --
 View this message in context:
 http://n2.nabble.com/Maven-2.0.9-NullpointerException-when-running-tests-tp2209372p2220012.html
 Sent from the maven users mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org




Re: Maven 2.0.9 NullpointerException when running tests

2009-01-25 Thread Amin Mohammed-Coleman

Hi (To Geoffrey Wiseman)

You are correct it is using junit 3.8.1 jar, I'm not sure how to  
change this to 4.4. Would it be possible to get some advice on how to  
do this?



Cheers
Amin


On 24 Jan 2009, at 15:51, Amin Mohammed-Coleman wrote:


Hi

I have the following pom.xm file:

project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance 

	xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd 


developers
developer
emailami...@gmail.com/email
nameAmin Mohammed-Coleman/name
roles
roleSoftware Engineer /role
/roles
/developer
/developers
modelVersion4.0.0/modelVersion
groupIdcom.amin/groupId
artifactIdapp.lucene/artifactId
packagingjar/packaging
version1.0-SNAPSHOT/version
nameapp.lucene/name
urlhttp://maven.apache.org/url
dependencies


/dependencies
build
finalNameapp.lucene/finalName
plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-compiler-plugin/artifactId
configuration
source1.6/source
target1.6/target
/configuration
/plugin 
/plugins
/build
/project


I have junit 4 tests which all run correctly in eclipse.  However  
when I try to run the tests in maven (mvn test) I get  
nullpointerexceptions (due to classes not being instantiated properly.


Any help would be appreciated.


Cheers
Amin




Re: Maven 2.0.9 NullpointerException when running tests

2009-01-25 Thread Hubert Iwaniuk
Try:
dependency
  groupIdjunit/groupId
  artifactIdjunit/artifactId
  version4.1/version
  scopetest/scope
/dependency

HTH.

On Sat, Jan 24, 2009 at 8:54 PM, Amin Mohammed-Coleman ami...@gmail.comwrote:

 Hi (To Geoffrey Wiseman)

 You are correct it is using junit 3.8.1 jar, I'm not sure how to change
 this to 4.4. Would it be possible to get some advice on how to do this?


 Cheers
 Amin



 On 24 Jan 2009, at 15:51, Amin Mohammed-Coleman wrote:

  Hi

 I have the following pom.xm file:

 project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://maven.apache.org/POM/4.0.0
 http://maven.apache.org/maven-v4_0_0.xsd;
developers
developer
emailami...@gmail.com/email
nameAmin Mohammed-Coleman/name
roles
roleSoftware Engineer /role
/roles
/developer
/developers
modelVersion4.0.0/modelVersion
groupIdcom.amin/groupId
artifactIdapp.lucene/artifactId
packagingjar/packaging
version1.0-SNAPSHOT/version
nameapp.lucene/name
urlhttp://maven.apache.org/url
dependencies


/dependencies
build
finalNameapp.lucene/finalName
plugins
plugin
groupIdorg.apache.maven.plugins/groupId

  artifactIdmaven-compiler-plugin/artifactId
configuration
source1.6/source
target1.6/target
/configuration
/plugin
/plugins
/build
 /project


 I have junit 4 tests which all run correctly in eclipse.  However when I
 try to run the tests in maven (mvn test) I get nullpointerexceptions (due to
 classes not being instantiated properly.

 Any help would be appreciated.


 Cheers
 Amin





-- 
Hubert Iwaniuk


Re: Maven 2.0.9 NullpointerException when running tests

2009-01-25 Thread Geoffrey Wiseman
On Sun, Jan 25, 2009 at 8:13 AM, Hubert Iwaniuk neo...@kungfoo.pl wrote:

 Try:
 dependency
  groupIdjunit/groupId
  artifactIdjunit/artifactId
  version4.1/version
  scopetest/scope
 /dependency


Or version4.4/version.

  - Geoffrey

-- 
Geoffrey Wiseman
http://www.geoffreywiseman.ca/


Re: Maven 2.0.9 NullpointerException when running tests

2009-01-25 Thread Dave Newton

Geoffrey Wiseman wrote:

Or version4.4/version.


Does 4.5 not work?

Dave


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven 2.0.9 NullpointerException when running tests

2009-01-25 Thread Wayne Fay
 Does 4.5 not work?

It looks like JUnit 4.5 *is* deployed to Central, so it *should* work:
http://www.mvnrepository.com/artifact/junit/junit

Wayne

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven 2.0.9 NullpointerException when running tests

2009-01-25 Thread Geoffrey Wiseman
On Sun, Jan 25, 2009 at 7:21 PM, Dave Newton newton.d...@yahoo.com wrote:

 Geoffrey Wiseman wrote:

 Or version4.4/version.


 Does 4.5 not work?


I was just responding to Amin's comment about JUnit 4.4, more than anything
else.

  - Geoffrey
-- 
Geoffrey Wiseman
http://www.geoffreywiseman.ca/


Re: Maven 2.0.9 NullpointerException when running tests

2009-01-25 Thread Dave Newton

Geoffrey Wiseman wrote:

On Sun, Jan 25, 2009 at 7:21 PM, Dave Newton newton.d...@yahoo.com wrote:

Does 4.5 not work?

I was just responding to Amin's comment about JUnit 4.4 [...]


Ah, missed that--never mind :)

Dave


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Maven 2.0.9 NullpointerException when running tests

2009-01-24 Thread Amin Mohammed-Coleman

Hi

I have the following pom.xm file:

project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance 

	xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd 


developers
developer
emailami...@gmail.com/email
nameAmin Mohammed-Coleman/name
roles
roleSoftware Engineer /role
/roles
/developer
/developers
modelVersion4.0.0/modelVersion
groupIdcom.amin/groupId
artifactIdapp.lucene/artifactId
packagingjar/packaging
version1.0-SNAPSHOT/version
nameapp.lucene/name
urlhttp://maven.apache.org/url
dependencies


/dependencies
build
finalNameapp.lucene/finalName
plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-compiler-plugin/artifactId
configuration
source1.6/source
target1.6/target
/configuration
/plugin 
/plugins
/build
/project


I have junit 4 tests which all run correctly in eclipse.  However when  
I try to run the tests in maven (mvn test) I get nullpointerexceptions  
(due to classes not being instantiated properly.


Any help would be appreciated.


Cheers
Amin

Re: Maven 2.0.9 NullpointerException when running tests

2009-01-24 Thread Geoffrey Wiseman
On Sat, Jan 24, 2009 at 10:51 AM, Amin Mohammed-Coleman ami...@gmail.comwrote:

 I have junit 4 tests which all run correctly in eclipse.  However when I
 try to run the tests in maven (mvn test) I get nullpointerexceptions (due to
 classes not being instantiated properly.

 Any help would be appreciated.


Probably means Maven is running them as JUnit 3.X and ignoring the @Before
annotations.  mvn -X test, pipe the output, and check which version of
Junit.jar is being used.

  - Geoffrey
-- 
Geoffrey Wiseman
http://www.geoffreywiseman.ca/