You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ji...@apache.org on 2004/05/01 01:34:01 UTC

[jira] Assigned: (JS2-19) TestFileCache always failing if it failed before

Message:

   The following issue has been re-assigned.

   Assignee: David Sean Taylor (mailto:taylor@apache.org)
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JS2-19

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JS2-19
    Summary: TestFileCache always failing if it failed before
       Type: Test

     Status: Open
   Priority: Minor

    Project: Jetspeed 2
 Components: 
             Other
   Versions:
             2.0-dev/cvs

   Assignee: David Sean Taylor
   Reporter: Ate Douma

    Created: Thu, 22 Apr 2004 9:33 AM
    Updated: Fri, 30 Apr 2004 4:33 PM
Environment: Windows XP, J2SE1.4.2_03, Tomcat 4.1.29

Description:
If for some reason the TestFileCache fails once the test files it creates are not removed (missing tearDown implementation).

Then, on a subsequent test run it will almost always fail again (at least under WindowsXP).

The reason:
The FileCache sorts its entries when it starts to evict. This is done on with a custom Comparator (the FileCache itself) using the file.getLastAccessed() attribute.
After the eviction the test case tries to get the document back from the cache using the 18th file originally loaded. But, if there were left over test files from a previous test run that one file may just have been evicted leading to a assertNotNull failure and the test fails.

So, I've done three things to prevent this wrong failing:
1) add a tearDown implementation removing the test files.
2) added a check in removeTestFiles so only still existing files will be removed
3) reloaded the files[] array based on the contents of the cache before trying to access file[18] so a reordering in the files won't break it anymore.

I've tested my changes multiple times by interrupting the test run in the middle resulting in left over test files. Running the test again now won't break it anymore.

Regards,

Ate


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Re: Problem building from CVS

Posted by Jean-François Ménard <me...@logyka.com>.
Ok, now... :-/

The build went fine, but when I tried to access jetspeed, I got:

org.apache.jetspeed.exception.JetspeedException: Unable to create Engine
	at org.apache.jetspeed.Jetspeed.createEngine(Jetspeed.java:70)
	at
org.apache.jetspeed.engine.JetspeedServlet.init(JetspeedServlet.java:130)
	at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1019)
	at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
	at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3991)
	at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4335)
	at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
	at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
	at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
	at
org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903)
	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:324)
	at
org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252)
	at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
	at org.apache.commons.digester.Rule.end(Rule.java:276)
	at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
	at
org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.commons.digester.Digester.parse(Digester.java:1567)
	at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488)
	at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
	at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:482)
	at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:964)
	at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
	at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
	at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
	at
org.apache.catalina.core.StandardService.start(StandardService.java:476)
	at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2298)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
	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:324)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:284)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:422)
Caused by: org.apache.jetspeed.exception.JetspeedException: Jetspeed
Initialization exception!
	at
org.apache.jetspeed.engine.JetspeedEngine.init(JetspeedEngine.java:138)
	at org.apache.jetspeed.Jetspeed.createEngine(Jetspeed.java:60)
	... 47 more
Caused by: groovy.lang.GroovyRuntimeException: Could not find which
method to invoke from this list: [public
org.picocontainer.defaults.ComponentParameter(java.lang.Object), public
org.picocontainer.defaults.ComponentParameter(java.lang.Class)] for
arguments: []
	at groovy.lang.MetaClass.chooseMethod(MetaClass.java:1104)
	at groovy.lang.MetaClass.invokeConstructor(MetaClass.java:323)
	at
org.codehaus.groovy.runtime.Invoker.invokeConstructorOf(Invoker.java:148)
	at
org.codehaus.groovy.runtime.InvokerHelper.invokeConstructorOf(InvokerHelper.java:120)
	at nanocontainer.run(nanocontainer.groovy:202)
	at
org.nanocontainer.script.groovy.GroovyContainerBuilder.createContainer(GroovyContainerBuilder.java:57)
	at
org.nanocontainer.integrationkit.LifecycleContainerBuilder.buildContainer(LifecycleContainerBuilder.java:25)
	at org.nanocontainer.NanoContainer.<init>(NanoContainer.java:88)
	at org.nanocontainer.NanoContainer.<init>(NanoContainer.java:59)
	at
org.apache.jetspeed.components.ComponentManager.<init>(ComponentManager.java:77)
	at
org.apache.jetspeed.engine.JetspeedEngine.initComponents(JetspeedEngine.java:288)
	at
org.apache.jetspeed.engine.JetspeedEngine.init(JetspeedEngine.java:116)
	... 48 more

----------------

I use tomcat 5.0.24.

And yes, I started the Production database... ;-)

Any ideas?
Thanks for your patience!


Le dim 23/05/2004 à 08:25, Jean-François Ménard a écrit :
> Thank Paul!
> 
> I deleted all database files, and it did the trick!
> 
> Le dim 23/05/2004 à 08:03, Paul Spencer a écrit :
> > 1) Did you stop the test database, if it was running, and start the 
> > production database before quickStart?
> > 
> > 2) If the production database does not start correctly, i.e. you see 
> > errors when starting, delete the database files that are in 
> > ${jetspeed-2-home}/src/sql/database/hsql.  The files Production.* will 
> > be recreated by maven.  The production database must be stopped when 
> > deleting the files.
> > 
> > Paul Spencer
> > 
> > 
> > Jean-François Ménard wrote:
> > > When I try to build from a fresh checkout, following the "Getting
> > > started" instructions:
> > > 
> > > 	- allClean allBuild go fine
> > > 	- quickStart give me, after a while:
> > > 
> > > db.execute:
> > >     [sql] Executing file:
> > > /home/jeff/cvs_downloads/apache/jakarta-jetspeed-2/src/sql/populate-entities-for-default-psml.sql
> > >     [sql] [ERROR] Failed to execute: INSERT INTO PORTLET_ENTITY (OID,
> > > PORTLET_DEFINITION_ID, ID) VALUES (1, (SELECT ID FROM PORTLET_DEFINITION
> > > WHERE NAME = 'TwoColumns'), '1')
> > >  
> > > BUILD FAILED
> > > File......
> > > file:/home/jeff/cvs_downloads/apache/jakarta-jetspeed-2/maven.xml
> > > Element... maven:reactor
> > > Line...... 431
> > > Column.... 40
> > > Unable to obtain goal [fullDeploy] --
> > > file:/home/jeff/cvs_downloads/apache/jakarta-jetspeed-2/portal/maven.xml:493:39: <sql> java.sql.SQLException: Single value expected in statement [INSERT INTO PORTLET_ENTITY (OID, PORTLET_DEFINITION_ID, ID) VALUES (1, (SELECT ID FROM PORTLET_DEFINITION WHERE NAME = 'TwoColumns'), '1')]
> > > 
> > > 
> > > Any idea?
> > > 
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
> > > 
> > > 
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
-- 
Jean-François Ménard
Logyka technologies inc.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Re: Problem building from CVS

Posted by Jean-François Ménard <me...@logyka.com>.
Thank Paul!

I deleted all database files, and it did the trick!

Le dim 23/05/2004 à 08:03, Paul Spencer a écrit :
> 1) Did you stop the test database, if it was running, and start the 
> production database before quickStart?
> 
> 2) If the production database does not start correctly, i.e. you see 
> errors when starting, delete the database files that are in 
> ${jetspeed-2-home}/src/sql/database/hsql.  The files Production.* will 
> be recreated by maven.  The production database must be stopped when 
> deleting the files.
> 
> Paul Spencer
> 
> 
> Jean-François Ménard wrote:
> > When I try to build from a fresh checkout, following the "Getting
> > started" instructions:
> > 
> > 	- allClean allBuild go fine
> > 	- quickStart give me, after a while:
> > 
> > db.execute:
> >     [sql] Executing file:
> > /home/jeff/cvs_downloads/apache/jakarta-jetspeed-2/src/sql/populate-entities-for-default-psml.sql
> >     [sql] [ERROR] Failed to execute: INSERT INTO PORTLET_ENTITY (OID,
> > PORTLET_DEFINITION_ID, ID) VALUES (1, (SELECT ID FROM PORTLET_DEFINITION
> > WHERE NAME = 'TwoColumns'), '1')
> >  
> > BUILD FAILED
> > File......
> > file:/home/jeff/cvs_downloads/apache/jakarta-jetspeed-2/maven.xml
> > Element... maven:reactor
> > Line...... 431
> > Column.... 40
> > Unable to obtain goal [fullDeploy] --
> > file:/home/jeff/cvs_downloads/apache/jakarta-jetspeed-2/portal/maven.xml:493:39: <sql> java.sql.SQLException: Single value expected in statement [INSERT INTO PORTLET_ENTITY (OID, PORTLET_DEFINITION_ID, ID) VALUES (1, (SELECT ID FROM PORTLET_DEFINITION WHERE NAME = 'TwoColumns'), '1')]
> > 
> > 
> > Any idea?
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
> > 
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
-- 
Jean-François Ménard
Logyka technologies inc.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Re: Problem building from CVS

Posted by Paul Spencer <pa...@mindspring.com>.
1) Did you stop the test database, if it was running, and start the 
production database before quickStart?

2) If the production database does not start correctly, i.e. you see 
errors when starting, delete the database files that are in 
${jetspeed-2-home}/src/sql/database/hsql.  The files Production.* will 
be recreated by maven.  The production database must be stopped when 
deleting the files.

Paul Spencer


Jean-François Ménard wrote:
> When I try to build from a fresh checkout, following the "Getting
> started" instructions:
> 
> 	- allClean allBuild go fine
> 	- quickStart give me, after a while:
> 
> db.execute:
>     [sql] Executing file:
> /home/jeff/cvs_downloads/apache/jakarta-jetspeed-2/src/sql/populate-entities-for-default-psml.sql
>     [sql] [ERROR] Failed to execute: INSERT INTO PORTLET_ENTITY (OID,
> PORTLET_DEFINITION_ID, ID) VALUES (1, (SELECT ID FROM PORTLET_DEFINITION
> WHERE NAME = 'TwoColumns'), '1')
>  
> BUILD FAILED
> File......
> file:/home/jeff/cvs_downloads/apache/jakarta-jetspeed-2/maven.xml
> Element... maven:reactor
> Line...... 431
> Column.... 40
> Unable to obtain goal [fullDeploy] --
> file:/home/jeff/cvs_downloads/apache/jakarta-jetspeed-2/portal/maven.xml:493:39: <sql> java.sql.SQLException: Single value expected in statement [INSERT INTO PORTLET_ENTITY (OID, PORTLET_DEFINITION_ID, ID) VALUES (1, (SELECT ID FROM PORTLET_DEFINITION WHERE NAME = 'TwoColumns'), '1')]
> 
> 
> Any idea?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Problem building from CVS

Posted by Jean-François Ménard <me...@logyka.com>.
When I try to build from a fresh checkout, following the "Getting
started" instructions:

	- allClean allBuild go fine
	- quickStart give me, after a while:

db.execute:
    [sql] Executing file:
/home/jeff/cvs_downloads/apache/jakarta-jetspeed-2/src/sql/populate-entities-for-default-psml.sql
    [sql] [ERROR] Failed to execute: INSERT INTO PORTLET_ENTITY (OID,
PORTLET_DEFINITION_ID, ID) VALUES (1, (SELECT ID FROM PORTLET_DEFINITION
WHERE NAME = 'TwoColumns'), '1')
 
BUILD FAILED
File......
file:/home/jeff/cvs_downloads/apache/jakarta-jetspeed-2/maven.xml
Element... maven:reactor
Line...... 431
Column.... 40
Unable to obtain goal [fullDeploy] --
file:/home/jeff/cvs_downloads/apache/jakarta-jetspeed-2/portal/maven.xml:493:39: <sql> java.sql.SQLException: Single value expected in statement [INSERT INTO PORTLET_ENTITY (OID, PORTLET_DEFINITION_ID, ID) VALUES (1, (SELECT ID FROM PORTLET_DEFINITION WHERE NAME = 'TwoColumns'), '1')]


Any idea?


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org