Re: Dependencies

2007-05-16 Thread Daniel del Castillo

Thanks Jordan, I fix it adding all dependencies to my pom

Regards,
Daniel del Castillo
--
-DdC

On 5/16/07, Jordan Howarth <[EMAIL PROTECTED]> wrote:

Hi Daniel

After recently going through dependency resolution hell (due to
ignorance on my part) I found mvn -X to be extremely useful to view
exactly how Maven is resolving dependency conflicts.

I cannot speak for Apache JCS specifically but if my own experience is a
guide, you may find that a plugin further up the dependency graph is
causing M to select a dependency at runttime scope that does not support
the class you need. If that is the case you should consider extending
the offending plugin with the version of the dependency you need.

Good luck

Jordan Howarth


Daniel del Castillo wrote:
> Sorry for all this noob question, but I'm new to Maven. I'm using
> Apache JCS in a project and I'm still having exceptions during the
> test phase. The problem is that JCS cannot be initialized and is
> throwing an exception. Is there a way to show the expecific error and
> no the NoClassFoundError?
>
> How can I be sure that all neded dependencies are beign downloaded?
> The Maven docs says that dependencies of project dependencies are
> automatically downloaded, but I'm not sure whether this is happening
> for JCS.
>
> Cheers,
> Daniel del Castillo

-
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]



Dependencies

2007-05-15 Thread Daniel del Castillo

Sorry for all this noob question, but I'm new to Maven. I'm using
Apache JCS in a project and I'm still having exceptions during the
test phase. The problem is that JCS cannot be initialized and is
throwing an exception. Is there a way to show the expecific error and
no the NoClassFoundError?

How can I be sure that all neded dependencies are beign downloaded?
The Maven docs says that dependencies of project dependencies are
automatically downloaded, but I'm not sure whether this is happening
for JCS.

Cheers,
Daniel del Castillo
--
-DdC

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Resources are not filtered

2007-05-15 Thread Daniel del Castillo

Yeap, thank you

--
-DdC


On 5/14/07, Wendy Smoak <[EMAIL PROTECTED]> wrote:

On 5/14/07, Daniel del Castillo <[EMAIL PROTECTED]> wrote:
> Hello again,
>
> When I build my project the resources files stay the same, no
> filtering is performed. My pom file is as follow:
...
> 
>   
> src/test/resources
> true
>   
> 

Based on the directory path, should this be 
 instead?

--
Wendy

-
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]



Resources are not filtered

2007-05-14 Thread Daniel del Castillo

Hello again,

When I build my project the resources files stay the same, no
filtering is performed. My pom file is as follow:


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";>
 
   aliasfox
   com.sinergiainc.aliasfox
   1.0-SNAPSHOT
 
 4.0.0
 com.sinergiainc.aliasfox.commons
 commons
 commons
 1.0-SNAPSHOT
 http://maven.apache.org
 
   
 src/test/filters/cache.properties
   
   
 
   src/test/resources
   true
 
   
 
 
   
 junit
 junit
 3.8.2
 test
   
   
 jcs
 jcs
 20030822.182132
   
   
 org.slf4j
 slf4j-log4j13
 1.0.1
   
   
 commons-lang
 commons-lang
 2.2
   
 


My cache.properties file has the following:

# Cache configuration for testing
cache.maxobjects=1000
cache.shrinker.active = true
cache.shrinker.interval = 15
cache.shrinker.idletime = 30
cache.iseternal = false
cache.disk.path = c:/some/path
cache.disk.keysize = 10

My cache.cff file has the following:

# DEFAULT CACHE REGION
jcs.default = DC
jcs.default.cacheattributes = org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects = 1000
jcs.default.cacheattributes.MemoryCacheName =
org.apache.jcs.engine.memory.lru.LRUMemoryCache

# PRE-DEFINED CACHE REGIONS
jcs.region.plainResources = DC
jcs.region.plainResources.cacheattributes =
org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.plainResources.cacheattributes.MaxObjects = ${cache.maxobjects}
jcs.region.plainResources.cacheattributes.MemoryCacheName =
org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.plainResources.cacheattributes.UseMemoryShrinker =
${cache.shrinker.active}
jcs.region.plainResources.cacheattributes.ShrinkerIntervalSeconds =
${cache.shrinker.interval}
jcs.region.plainResources.cacheattributes.MaxMemoryIdleTimeSeconds =
${cache.shrinker.idletime}
jcs.region.plainResources.cacheattributes.MaxSpoolPerRun = 500
jcs.region.plainResources.elementattributes =
org.apache.jcs.engine.ElementAttributes
jcs.region.plainResources.elementattributes.IsEternal = ${cache.iseternal}


# AVAILABLE AUXILIARY CACHES
jcs.auxiliary.DC = org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
jcs.auxiliary.DC.attributes =
org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
jcs.auxiliary.DC.attributes.DiskPath = ${cache.disk.path}
jcs.auxiliary.DC.attributes.maxKeySize = ${cache.disk.keysize}

And running the test goal (I tried runing resources:resources as
well). No matter how I run maven, i.e.:


mvn process-test-resources -Dcache.maxobjects="1000"


or changing the pom to define parameters using , they are
ignored. What can be happening?

Cheers,
Daniel del Castillo
--
-DdC

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NoClassDefFoundError when running test

2007-05-14 Thread Daniel del Castillo

James,

Thanks for the hint. The problem was a misspelt class name in a
resource file that was causing an exception in the initializer of the
CacheFactory.

Regards,
Daniel del Castillo
--
-DdC

On 5/14/07, James Abley <[EMAIL PROTECTED]> wrote:

Does that class or something it depends on have the possibility of
failing in a static initializer?

A NoClassDefFoundError frequently masks the underlying cause, due to
the way the JVM loads classes. Something might be throwing a
NullPointerException with a more obvious error message, but the JVM
marks that class as not being loadable, gives the not-as-immediately
helpful NoClassDefFoundError instead.

Cheers,

James

On 13/05/07, Daniel del Castillo <[EMAIL PROTECTED]> wrote:
> Hi Jo,
>
> Thanks for support. The artifact is the project itself. If I add it to
> the dependencies I get an error of cyclic redundancy:
>
> [INFO] Scanning for projects...
> [INFO] 

> [ERROR] BUILD FAILURE
> [INFO] 

> [INFO] The projects in the reactor contain a cyclic reference: Edge
> between 'Vertex{label='com.sinergiainc.aliasfox.commons:commons'}' and
> 'Vertex{label='com.sinergiainc.aliasfox.commons:commons'}' introduces
> to cycle in the graph com.sinergiainc.aliasfox.commons:commons -->
> com.sinergiainc.aliasfox.commons:commons
> [INFO] 

> [INFO] For more information, run Maven with the -e switch
> [INFO] 

> [INFO] Total time: < 1 second
> [INFO] Finished at: Sun May 13 14:58:25 VET 2007
> [INFO] Final Memory: 1M/4M
> [INFO] 

>
> Regards,
> Daniel del Castillo
> --
> -DdC
>
>
> On 5/13/07, Jo Vandermeeren <[EMAIL PROTECTED]> wrote:
> > Hi Daniel,
> >
> > Add the artifact that contains the respective class to your project with the
> > correct scope, i.c. "test".
> >
> > Good luck
> > Jo
> >
> > On 5/13/07, Daniel del Castillo <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi,
> > >
> > > I'm using Maven 2.0.4 and I'm having a problem when running the test
> > > goal. The surefire reports say that a class
> > > (com.sinergiainc.aliasfox.commons.cache.CacheFactory) of the component
> > > I'm testing is missing. The exact report is:
> > >
> > > Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.062
> > > sec <<< FAILURE!
> > > warning(junit.framework.TestSuite$1)  Time elapsed: 0.016 sec  <<<
> > > FAILURE!
> > > junit.framework.AssertionFailedError: Exception in constructor:
> > > testPut (java.lang.NoClassDefFoundError: Could not initialize class
> > > com.sinergiainc.aliasfox.commons.cache.CacheFactory
> > > at com.sinergiainc.aliasfox.commons.JcsCacheTest.(
> > > JcsCacheTest.java:65)
> > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > > Method)
> > > at sun.reflect.NativeConstructorAccessorImpl.newInstance(
> > > NativeConstructorAccessorImpl.java:39)
> > > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> > > DelegatingConstructorAccessorImpl.java:27)
> > > at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> > > at junit.framework.TestSuite.createTest(TestSuite.java:58)
> > > at junit.framework.TestSuite.addTestMethod(TestSuite.java:280)
> > > at junit.framework.TestSuite.(TestSuite.java:140)
> > > at com.sinergiainc.aliasfox.commons.JcsCacheTest.suite(
> > > JcsCacheTest.java:82)
> > > 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:597)
> > > at
> > > org.apache.maven.surefire.junit.JUnitTestSet.createInstanceFromSuiteMethod
> > > (JUnitTestSet.java:180)
> > > at
> > > org.apache.maven.surefire.junit.JUnitTestSet.constructTestObject(
> > > JUnitTestSet.java:140)
> > > at org.apache.maven.surefire.junit.JUnitTestSet

Re: NoClassDefFoundError when running test

2007-05-13 Thread Daniel del Castillo

Hi Jo,

Thanks for support. The artifact is the project itself. If I add it to
the dependencies I get an error of cyclic redundancy:

[INFO] Scanning for projects...
[INFO] 
[ERROR] BUILD FAILURE
[INFO] 
[INFO] The projects in the reactor contain a cyclic reference: Edge
between 'Vertex{label='com.sinergiainc.aliasfox.commons:commons'}' and
'Vertex{label='com.sinergiainc.aliasfox.commons:commons'}' introduces
to cycle in the graph com.sinergiainc.aliasfox.commons:commons -->
com.sinergiainc.aliasfox.commons:commons
[INFO] 
[INFO] For more information, run Maven with the -e switch
[INFO] 
[INFO] Total time: < 1 second
[INFO] Finished at: Sun May 13 14:58:25 VET 2007
[INFO] Final Memory: 1M/4M
[INFO] --------

Regards,
Daniel del Castillo
--
-DdC


On 5/13/07, Jo Vandermeeren <[EMAIL PROTECTED]> wrote:

Hi Daniel,

Add the artifact that contains the respective class to your project with the
correct scope, i.c. "test".

Good luck
Jo

On 5/13/07, Daniel del Castillo <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm using Maven 2.0.4 and I'm having a problem when running the test
> goal. The surefire reports say that a class
> (com.sinergiainc.aliasfox.commons.cache.CacheFactory) of the component
> I'm testing is missing. The exact report is:
>
> Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.062
> sec <<< FAILURE!
> warning(junit.framework.TestSuite$1)  Time elapsed: 0.016 sec  <<<
> FAILURE!
> junit.framework.AssertionFailedError: Exception in constructor:
> testPut (java.lang.NoClassDefFoundError: Could not initialize class
> com.sinergiainc.aliasfox.commons.cache.CacheFactory
> at com.sinergiainc.aliasfox.commons.JcsCacheTest.(
> JcsCacheTest.java:65)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(
> NativeConstructorAccessorImpl.java:39)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> at junit.framework.TestSuite.createTest(TestSuite.java:58)
> at junit.framework.TestSuite.addTestMethod(TestSuite.java:280)
> at junit.framework.TestSuite.(TestSuite.java:140)
> at com.sinergiainc.aliasfox.commons.JcsCacheTest.suite(
> JcsCacheTest.java:82)
> 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:597)
> at
> org.apache.maven.surefire.junit.JUnitTestSet.createInstanceFromSuiteMethod
> (JUnitTestSet.java:180)
> at
> org.apache.maven.surefire.junit.JUnitTestSet.constructTestObject(
> JUnitTestSet.java:140)
> at org.apache.maven.surefire.junit.JUnitTestSet.execute(
> JUnitTestSet.java:197)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(
> AbstractDirectoryTestSuite.java:138)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(
> AbstractDirectoryTestSuite.java:125)
> at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
> 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:597)
> at
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(
> SurefireBooter.java:290)
> at org.apache.maven.surefire.booter.SurefireBooter.main(
> SurefireBooter.java:818)
> )
> at junit.framework.Assert.fail(Assert.java:47)
> at junit.framework.TestSuite$1.runTest(TestSuite.java:90)
> at junit.framework.TestCase.runBare(TestCase.java:130)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCa

NoClassDefFoundError when running test

2007-05-13 Thread Daniel del Castillo
30822.182132.jar
[DEBUG]   C:\Documents and
Settings\Daniel\.m2\repository\commons-lang\commons-lang\2.2\commons-lang-2.2.jar
[DEBUG] Setting system property [localRepository]=[C:\Documents and
Settings\Daniel\.m2\repository]
[DEBUG] Setting system property [basedir]=[C:\Projects\eclipse\aliasfox\commons]
[DEBUG] Using JVM: C:\Java\jdk1.6.0_01\jre\bin\java
[INFO] Surefire report directory:
C:\Projects\eclipse\aliasfox\commons\target\surefire-reports
Forking command line: C:\Java\jdk1.6.0_01\jre\bin\java -classpath
"C:\Documents and
Settings\Daniel\.m2\repository\org\codehaus\plexus\plexus-archiver\1.0-alpha-7\plexus-archiver-1.0-alpha-7.jar;C:\Documents
and 
Settings\Daniel\.m2\repository\org\apache\maven\surefire\surefire-api\2.3\surefire-api-2.3.jar;C:\Documents
and 
Settings\Daniel\.m2\repository\org\codehaus\plexus\plexus-container-default\1.0-alpha-8\plexus-container-default-1.0-alpha-8.jar;C:\Documents
and Settings\Daniel\.m2\repository
\org\codehaus\plexus\plexus-utils\1.1\plexus-utils-1.1.jar;C:\Documents
and 
Settings\Daniel\.m2\repository\org\apache\maven\surefire\surefire-booter\2.3\surefire-booter-2.3.jar;C:\Documents
and 
Settings\Daniel\.m2\repository\classworlds\classworlds\1.1-alpha-2\classworlds-1.1-alpha-2.jar;C:\Documents
and 
Settings\Daniel\.m2\repository\commons-lang\commons-lang\2.1\commons-lang-2.1.jar;C:\Documents
and Settings\Daniel\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar"
org.apache.maven.surefire.boo
ter.SurefireBooter C:\DOCUME~1\Daniel\LOCALS~1\Temp\surefire36850tmp
C:\DOCUME~1\Daniel\LOCALS~1\Temp\surefire36851tmp

---
T E S T S
---
Running com.sinergiainc.aliasfox.commons.JcsCacheTest
Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.078
sec <<< FAILURE!

Results :

Failed tests:
 warning(junit.framework.TestSuite$1)
 warning(junit.framework.TestSuite$1)

Tests run: 2, Failures: 2, Errors: 0, Skipped: 0

[INFO] 
[ERROR] BUILD FAILURE
[INFO] 
[INFO] There are test failures.
[INFO] 
[DEBUG] Trace
org.apache.maven.BuildFailureException: There are test failures.
   at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:555)
   at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
   at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
   at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
   at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
   at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
   at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
   at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
   at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
   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:597)
   at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
   at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
   at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
   at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoFailureException: There are
test failures.
   at 
org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:425)
   at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
   at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
   ... 16 more
[INFO] 
[INFO] Total time: 3 seconds
[INFO] Finished at: Sun May 13 11:11:58 VET 2007
[INFO] Final Memory: 4M/8M
[INFO] 


As you can see, the classes directory is included in classpathElements.

How can I fix this error?

Regards,
Daniel del Castillo
--
-DdC

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]