You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@archiva.apache.org by Thomas Harold <th...@nybeta.com> on 2012/10/04 05:30:22 UTC

archiva 1.3.5 under geronimo 3.0.0

Bunch of setup questions that I'm struggling with.

1) Can archiva 1.3.5 be deployed via the geronimo web console?

2) Should I be installing 1.4 instead?

3) Does the following thread (archiva 1.2 on geronimo 2.1.4) still 
document what the deployment plan XML file should look like?

http://mail-archives.apache.org/mod_mbox/archiva-users/200905.mbox/%3C23763493.post@talk.nabble.com%3E
>From 	v2cg4ss <ss...@datamentors.com>
Subject 	Re: Archiva install on Geronimo 2.1.4
Date 	Thu, 28 May 2009 14:58:38 GMT



Re: archiva 1.3.5 under geronimo 3.0.0

Posted by Thomas Harold <th...@nybeta.com>.
So I switched to the 1.4M3 WAR and read up a bit more on:

https://cwiki.apache.org/ARCHIVA/archiva-on-geronimo-202-with-mysql-backend.html

The first thing I stumbled across was that there is a deployment plan 
creator tool in the Geronimo Web Console under Applications / Plan 
Creator.  By feeding it the archiva WAR file, it spit out a 
geronimo-web.xml that I could then copy and edit for future attempts. 
So while I don't completely understand what I'm doing, the following 
should be fairly accurate.

According to the wiki link, commons-collections and commons-lang must be 
in the Geronimo Repository.  I had to add these as dependencies on the 
deployment file.  Geronimo 3.0.0 includes 2.6 of commons-lang and 3.2.1 
of commons-collections.

<dep:dependency>
     <dep:groupId>commons-lang</dep:groupId>
     <dep:artifactId>commons-lang</dep:artifactId>
     <dep:version>2.6</dep:version>
     <dep:type>jar</dep:type>
</dep:dependency>
<dep:dependency>
     <dep:groupId>commons-collections</dep:groupId>
     <dep:artifactId>commons-collections</dep:artifactId>
     <dep:version>3.2.1</dep:version>
     <dep:type>jar</dep:type>
</dep:dependency>

You will need to create a database pool using Resources / Datasources / 
create a new database pool "Using the Geronimo database pool wizard". 
For my initial testing, I went with "Derby embedded" with the pool named 
as "archiva".

This requires another dependency to be added (the artifactId should 
match the name of the database pool that you created).

<dep:dependency>
     <dep:groupId>console.dbpool</dep:groupId>
     <dep:artifactId>archiva</dep:artifactId>
</dep:dependency>

Plus you need to create the actual database inside of Derby / MySQL / 
PostgreSQL / whatever.  For Derby, this is done under the Advanced View, 
Application Server, Derby Server, Manager.

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

However, at this point, I'm stuck on deploying with a error that looks like:

ERROR [DeployTool] Error:
org.apache.geronimo.common.DeploymentException: Operation failed: start 
of org.apache.maven.archiva/apache-archiva-js-1.4-M3/1349657158172/war 
failed
         Unknown start exception
         Configuration 
org.apache.maven.archiva/apache-archiva-js-1.4-M3/1349657158172/war 
failed to start due to the following reasons:
   The service 
J2EEApplication=null,j2eeType=WebModule,name=org.apache.maven.archiva/apache-archiva-js-1.4-M3/1349657158172/war 
did not start because ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: Failed to start component 
[StandardEngine[Catalina].StandardHost[0.0.0.0].StandardContext[/archiva]]
java.lang.IllegalStateException: ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: Failed to start component 
[StandardEngine[Catalina].StandardHost[0.0.0.0].StandardContext[/archiva]]
         at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:898)
         at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
         at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
         at 
org.apache.geronimo.tomcat.TomcatContainer.addContext(TomcatContainer.java:310)
         at 
org.apache.geronimo.tomcat.TomcatWebAppContext.doStart(TomcatWebAppContext.java:567)

---------------------------------------------------------------
Current geronimo-web.xml deployment file looks like:
---------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">

     <dep:environment 
xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
         <dep:moduleId>
             <dep:groupId>org.apache.maven.archiva</dep:groupId>
             <dep:artifactId>apache-archiva-js-1.4-M3</dep:artifactId>
             <dep:type>war</dep:type>
         </dep:moduleId>

         <dep:dependencies>
             <dep:dependency>
                 <dep:groupId>org.apache.geronimo.configs</dep:groupId>
                 <dep:artifactId>system-database</dep:artifactId>
                 <dep:version>3.0.0</dep:version>
                 <dep:type>car</dep:type>
             </dep:dependency>
             <dep:dependency>
                 <dep:groupId>org.apache.geronimo.configs</dep:groupId>
                 <dep:artifactId>javamail</dep:artifactId>
                 <dep:version>3.0.0</dep:version>
                 <dep:type>car</dep:type>
             </dep:dependency>
             <dep:dependency>
                 <dep:groupId>commons-lang</dep:groupId>
                 <dep:artifactId>commons-lang</dep:artifactId>
                 <dep:version>2.6</dep:version>
                 <dep:type>jar</dep:type>
             </dep:dependency>
             <dep:dependency>
                 <dep:groupId>commons-collections</dep:groupId>
                 <dep:artifactId>commons-collections</dep:artifactId>
                 <dep:version>3.2.1</dep:version>
                 <dep:type>jar</dep:type>
             </dep:dependency>
             <dep:dependency>
                 <dep:groupId>console.dbpool</dep:groupId>
                 <dep:artifactId>archiva</dep:artifactId>
             </dep:dependency>
         </dep:dependencies>
     </dep:environment>

     <!-- URL -->
     <context-root>/archiva</context-root>

     <nam:resource-ref 
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
         <nam:ref-name>jdbc/users</nam:ref-name>
         <nam:resource-link>archiva</nam:resource-link>
     </nam:resource-ref>

     <nam:resource-ref 
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
         <nam:ref-name>mail/Session</nam:ref-name>
         <nam:resource-link>mail/MailSession</nam:resource-link>
     </nam:resource-ref>
</web-app>

Re: archiva 1.3.5 under geronimo 3.0.0

Posted by Olivier Lamy <ol...@apache.org>.
2012/10/4 Thomas Harold <th...@nybeta.com>:
> Bunch of setup questions that I'm struggling with.
>
> 1) Can archiva 1.3.5 be deployed via the geronimo web console?
Perso not tested :-)
I usually test with tomcat and embeded jetty.
>
> 2) Should I be installing 1.4 instead?
Perso (again): yup 1.4 is really more performant compared to previous versions.
>
> 3) Does the following thread (archiva 1.2 on geronimo 2.1.4) still document
> what the deployment plan XML file should look like?
Frankly no idea :-)
Is it mandatory for you to use geronimo :-)  IMHO tomee is a
good/modern alternative (http://tomee.apache.org)



>
> http://mail-archives.apache.org/mod_mbox/archiva-users/200905.mbox/%3C23763493.post@talk.nabble.com%3E
> From    v2cg4ss <ss...@datamentors.com>
> Subject         Re: Archiva install on Geronimo 2.1.4
> Date    Thu, 28 May 2009 14:58:38 GMT
>
>



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

Re: NullPointerException when Updating artifact index?

Posted by Olivier Lamy <ol...@apache.org>.
Note with 1.4-M3 we upgraded to last maven-indexer version. And last
lucene 3.6.1.
As the NPE comes from indexer and/or lucene this upgrade maybe fix
that (at least the upgrade do some performance improvement)

2012/11/1 Charles Kim <ch...@yahoo-inc.com>:
> Archiva 1.4-M2
> No, it doesn't always happen for the same artifact and that particular artifact exists btw.  It is hard for me to figure out what might be wrong based on the NullPointerException.  I'm not seeing anything now, but will keep an eye on it.
> Thanks
>
> -----Original Message-----
> From: Olivier Lamy [mailto:olamy@apache.org]
> Sent: Wednesday, October 31, 2012 4:03 PM
> To: users@archiva.apache.org
> Subject: Re: NullPointerException when Updating artifact index?
>
> Hi,
> Which archiva version are you using ?
> Does it always happen for the same artifact ? (here looks to be
> org.apache.ant:ant-launcher:1.8.1:null:null)
>
> 2012/10/31 Charles Kim <ch...@yahoo-inc.com>:
>> Any one has an idea why I'm getting this? It doesn't look like I'm getting this consistently but often enough to be concerned about.
>> I don't have much experience on how indexing works in Archiva. Any pointers to debug this would be appreciated.
>> Thanks.
>>
>>
>> 2012-10-31 00:38:11,811 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Index file packaged at '/home/y/var/yarchiva/data/repositories/public/.indexer'.
>> 2012-10-31 00:38:11,811 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Creating indexing context on resource: /home/y/var/yarchiva/data/repositories/public/org/apache/ant/
>> ant-launcher/1.8.1/ant-launcher-1.8.1.jar
>> 2012-10-31 00:38:11,811 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Updating artifact 'org.apache.ant:ant-launcher:1.8.1:null:null' in index..
>> 2012-10-31 00:38:11,927 ERROR [org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor] Error executing task
>> java.util.concurrent.ExecutionException: java.lang.NullPointerException
>>         at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
>>         at java.util.concurrent.FutureTask.get(FutureTask.java:111)
>>         at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable.waitForTask(ThreadedTaskQueueExecutor.java:167)
>>         at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable.run(ThreadedTaskQueueExecutor.java:135)
>> Caused by: java.lang.NullPointerException
>>         at org.apache.lucene.index.SegmentTermDocs.<init>(SegmentTermDocs.java:52)
>>         at org.apache.lucene.index.SegmentReader.termDocs(SegmentReader.java:963)
>>         at org.apache.lucene.index.IndexReader.termDocs(IndexReader.java:813)
>>         at org.apache.lucene.index.SegmentReader.termDocs(SegmentReader.java:956)
>>         at org.apache.lucene.search.TermQuery$TermWeight.scorer(TermQuery.java:74)
>>         at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:210)
>>         at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:170)
>>         at org.apache.lucene.search.Searcher.search(Searcher.java:98)
>>         at org.apache.lucene.search.Searcher.search(Searcher.java:108)
>>         at org.apache.maven.index.DefaultIndexerEngine.getOldDocument(DefaultIndexerEngine.java:158)
>>         at org.apache.maven.index.DefaultIndexerEngine.update(DefaultIndexerEngine.java:77)
>>         at org.apache.maven.index.DefaultNexusIndexer.addArtifactToIndex(DefaultNexusIndexer.java:371)
>>         at org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor.executeTask(ArchivaIndexingTaskExecutor.java:180)
>>         at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ThreadedTaskQueueExecutor.java:124)
>>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>>         at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>>         at java.lang.Thread.run(Thread.java:722)
>> 2012-10-31 00:38:11,928 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Creating indexing context on resource: /home/y/var/yarchiva/data/repositories/public/org/mortbay/jetty/jetty/6.1.25/jetty-6.1.25.pom
>> 2012-10-31 00:38:11,929 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Adding artifact 'org.mortbay.jetty:jetty:6.1.25:null:null' to index..
>> 2012-10-31 00:38:12,011 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Finishing indexing task on resource file : /home/y/var/yarchiva/data/repositories/public/org/mortbay/jetty/jetty/6.1.25/jetty-6.1.25.pom
>
>
>
> --
> Olivier Lamy
> Talend: http://coders.talend.com
> http://twitter.com/olamy | http://linkedin.com/in/olamy



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

RE: NullPointerException when Updating artifact index?

Posted by Charles Kim <ch...@yahoo-inc.com>.
Archiva 1.4-M2
No, it doesn't always happen for the same artifact and that particular artifact exists btw.  It is hard for me to figure out what might be wrong based on the NullPointerException.  I'm not seeing anything now, but will keep an eye on it.
Thanks

-----Original Message-----
From: Olivier Lamy [mailto:olamy@apache.org] 
Sent: Wednesday, October 31, 2012 4:03 PM
To: users@archiva.apache.org
Subject: Re: NullPointerException when Updating artifact index?

Hi,
Which archiva version are you using ?
Does it always happen for the same artifact ? (here looks to be
org.apache.ant:ant-launcher:1.8.1:null:null)

2012/10/31 Charles Kim <ch...@yahoo-inc.com>:
> Any one has an idea why I'm getting this? It doesn't look like I'm getting this consistently but often enough to be concerned about.
> I don't have much experience on how indexing works in Archiva. Any pointers to debug this would be appreciated.
> Thanks.
>
>
> 2012-10-31 00:38:11,811 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Index file packaged at '/home/y/var/yarchiva/data/repositories/public/.indexer'.
> 2012-10-31 00:38:11,811 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Creating indexing context on resource: /home/y/var/yarchiva/data/repositories/public/org/apache/ant/
> ant-launcher/1.8.1/ant-launcher-1.8.1.jar
> 2012-10-31 00:38:11,811 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Updating artifact 'org.apache.ant:ant-launcher:1.8.1:null:null' in index..
> 2012-10-31 00:38:11,927 ERROR [org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor] Error executing task
> java.util.concurrent.ExecutionException: java.lang.NullPointerException
>         at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
>         at java.util.concurrent.FutureTask.get(FutureTask.java:111)
>         at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable.waitForTask(ThreadedTaskQueueExecutor.java:167)
>         at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable.run(ThreadedTaskQueueExecutor.java:135)
> Caused by: java.lang.NullPointerException
>         at org.apache.lucene.index.SegmentTermDocs.<init>(SegmentTermDocs.java:52)
>         at org.apache.lucene.index.SegmentReader.termDocs(SegmentReader.java:963)
>         at org.apache.lucene.index.IndexReader.termDocs(IndexReader.java:813)
>         at org.apache.lucene.index.SegmentReader.termDocs(SegmentReader.java:956)
>         at org.apache.lucene.search.TermQuery$TermWeight.scorer(TermQuery.java:74)
>         at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:210)
>         at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:170)
>         at org.apache.lucene.search.Searcher.search(Searcher.java:98)
>         at org.apache.lucene.search.Searcher.search(Searcher.java:108)
>         at org.apache.maven.index.DefaultIndexerEngine.getOldDocument(DefaultIndexerEngine.java:158)
>         at org.apache.maven.index.DefaultIndexerEngine.update(DefaultIndexerEngine.java:77)
>         at org.apache.maven.index.DefaultNexusIndexer.addArtifactToIndex(DefaultNexusIndexer.java:371)
>         at org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor.executeTask(ArchivaIndexingTaskExecutor.java:180)
>         at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ThreadedTaskQueueExecutor.java:124)
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>         at java.lang.Thread.run(Thread.java:722)
> 2012-10-31 00:38:11,928 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Creating indexing context on resource: /home/y/var/yarchiva/data/repositories/public/org/mortbay/jetty/jetty/6.1.25/jetty-6.1.25.pom
> 2012-10-31 00:38:11,929 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Adding artifact 'org.mortbay.jetty:jetty:6.1.25:null:null' to index..
> 2012-10-31 00:38:12,011 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Finishing indexing task on resource file : /home/y/var/yarchiva/data/repositories/public/org/mortbay/jetty/jetty/6.1.25/jetty-6.1.25.pom



--
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

Re: NullPointerException when Updating artifact index?

Posted by Olivier Lamy <ol...@apache.org>.
Hi,
Which archiva version are you using ?
Does it always happen for the same artifact ? (here looks to be
org.apache.ant:ant-launcher:1.8.1:null:null)

2012/10/31 Charles Kim <ch...@yahoo-inc.com>:
> Any one has an idea why I'm getting this? It doesn't look like I'm getting this consistently but often enough to be concerned about.
> I don't have much experience on how indexing works in Archiva. Any pointers to debug this would be appreciated.
> Thanks.
>
>
> 2012-10-31 00:38:11,811 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Index file packaged at '/home/y/var/yarchiva/data/repositories/public/.indexer'.
> 2012-10-31 00:38:11,811 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Creating indexing context on resource: /home/y/var/yarchiva/data/repositories/public/org/apache/ant/
> ant-launcher/1.8.1/ant-launcher-1.8.1.jar
> 2012-10-31 00:38:11,811 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Updating artifact 'org.apache.ant:ant-launcher:1.8.1:null:null' in index..
> 2012-10-31 00:38:11,927 ERROR [org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor] Error executing task
> java.util.concurrent.ExecutionException: java.lang.NullPointerException
>         at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
>         at java.util.concurrent.FutureTask.get(FutureTask.java:111)
>         at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable.waitForTask(ThreadedTaskQueueExecutor.java:167)
>         at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable.run(ThreadedTaskQueueExecutor.java:135)
> Caused by: java.lang.NullPointerException
>         at org.apache.lucene.index.SegmentTermDocs.<init>(SegmentTermDocs.java:52)
>         at org.apache.lucene.index.SegmentReader.termDocs(SegmentReader.java:963)
>         at org.apache.lucene.index.IndexReader.termDocs(IndexReader.java:813)
>         at org.apache.lucene.index.SegmentReader.termDocs(SegmentReader.java:956)
>         at org.apache.lucene.search.TermQuery$TermWeight.scorer(TermQuery.java:74)
>         at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:210)
>         at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:170)
>         at org.apache.lucene.search.Searcher.search(Searcher.java:98)
>         at org.apache.lucene.search.Searcher.search(Searcher.java:108)
>         at org.apache.maven.index.DefaultIndexerEngine.getOldDocument(DefaultIndexerEngine.java:158)
>         at org.apache.maven.index.DefaultIndexerEngine.update(DefaultIndexerEngine.java:77)
>         at org.apache.maven.index.DefaultNexusIndexer.addArtifactToIndex(DefaultNexusIndexer.java:371)
>         at org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor.executeTask(ArchivaIndexingTaskExecutor.java:180)
>         at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ThreadedTaskQueueExecutor.java:124)
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>         at java.lang.Thread.run(Thread.java:722)
> 2012-10-31 00:38:11,928 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Creating indexing context on resource: /home/y/var/yarchiva/data/repositories/public/org/mortbay/jetty/jetty/6.1.25/jetty-6.1.25.pom
> 2012-10-31 00:38:11,929 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Adding artifact 'org.mortbay.jetty:jetty:6.1.25:null:null' to index..
> 2012-10-31 00:38:12,011 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Finishing indexing task on resource file : /home/y/var/yarchiva/data/repositories/public/org/mortbay/jetty/jetty/6.1.25/jetty-6.1.25.pom



--
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

NullPointerException when Updating artifact index?

Posted by Charles Kim <ch...@yahoo-inc.com>.
Any one has an idea why I'm getting this? It doesn't look like I'm getting this consistently but often enough to be concerned about.
I don't have much experience on how indexing works in Archiva. Any pointers to debug this would be appreciated. 
Thanks.


2012-10-31 00:38:11,811 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Index file packaged at '/home/y/var/yarchiva/data/repositories/public/.indexer'.
2012-10-31 00:38:11,811 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Creating indexing context on resource: /home/y/var/yarchiva/data/repositories/public/org/apache/ant/
ant-launcher/1.8.1/ant-launcher-1.8.1.jar
2012-10-31 00:38:11,811 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Updating artifact 'org.apache.ant:ant-launcher:1.8.1:null:null' in index..
2012-10-31 00:38:11,927 ERROR [org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor] Error executing task
java.util.concurrent.ExecutionException: java.lang.NullPointerException
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
        at java.util.concurrent.FutureTask.get(FutureTask.java:111)
        at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable.waitForTask(ThreadedTaskQueueExecutor.java:167)
        at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable.run(ThreadedTaskQueueExecutor.java:135)
Caused by: java.lang.NullPointerException
        at org.apache.lucene.index.SegmentTermDocs.<init>(SegmentTermDocs.java:52)
        at org.apache.lucene.index.SegmentReader.termDocs(SegmentReader.java:963)
        at org.apache.lucene.index.IndexReader.termDocs(IndexReader.java:813)
        at org.apache.lucene.index.SegmentReader.termDocs(SegmentReader.java:956)
        at org.apache.lucene.search.TermQuery$TermWeight.scorer(TermQuery.java:74)
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:210)
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:170)
        at org.apache.lucene.search.Searcher.search(Searcher.java:98)
        at org.apache.lucene.search.Searcher.search(Searcher.java:108)
        at org.apache.maven.index.DefaultIndexerEngine.getOldDocument(DefaultIndexerEngine.java:158)
        at org.apache.maven.index.DefaultIndexerEngine.update(DefaultIndexerEngine.java:77)
        at org.apache.maven.index.DefaultNexusIndexer.addArtifactToIndex(DefaultNexusIndexer.java:371)
        at org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor.executeTask(ArchivaIndexingTaskExecutor.java:180)
        at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ThreadedTaskQueueExecutor.java:124)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
2012-10-31 00:38:11,928 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Creating indexing context on resource: /home/y/var/yarchiva/data/repositories/public/org/mortbay/jetty/jetty/6.1.25/jetty-6.1.25.pom
2012-10-31 00:38:11,929 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Adding artifact 'org.mortbay.jetty:jetty:6.1.25:null:null' to index..
2012-10-31 00:38:12,011 DEBUG [org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor] Finishing indexing task on resource file : /home/y/var/yarchiva/data/repositories/public/org/mortbay/jetty/jetty/6.1.25/jetty-6.1.25.pom

Re: archiva 1.4M3 under geronimo 3.0.0 (was archiva 1.3.5)

Posted by Thomas Harold <th...@nybeta.com>.
On 10/24/2012 1:54 AM, Brett Porter wrote:
> Unfortunately it seems that Geronimo is swallowing the all important
> exception from the listener. Is there anywhere else in the console,
> archiva.log, or other that might show it?
>
> My only guess is that you might need the appserver.base system
> property to be set - the Tomcat instructions talk about that for
> Tomcat, but again not sure what the equivalent is for Geronimo.
>
> Perhaps the Geronimo lists might be able to provide some more
> assistance too?
>

appserver.base is something I'll have to look at.  I wasn't sure if that 
was going to be still needed for 1.4M3.  But I had seen it mentioned in 
a few of the HOWTOs on the Archiva wiki, so I'll have to find out where 
that is in Geronimo.

In fact, I think that's probably the right track to focus on because I 
dug this out of the Geronimo log (specifically "Could not resolve 
placeholder 'appserver.base' in string value"):

2012-10-23 20:24:16,922 ERROR [[/archiva]] Exception sending context 
destroyed event to listener instance of class org.apache.archiv
a.web.startup.ArchivaStartup
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid 
bean definition with name 'jcr-config' defined in URL [file:
/usr/local/share/geronimo-3.0.0/repository/default/apache-archiva-js-1.4-M3/1351030291765/apache-archiva-js-1.4-M3-1351030291765.war
/WEB-INF/classes/META-INF/spring-context.xml]: Could not resolve 
placeholder 'appserver.base' in string value [${appserver.base}/con
f/repository.xml]
         at 
org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.ja
va:209)
         at 
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.ja
va:220)
         at 
org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.jav
a:84)
ore.StandardContext.startInternal(StandardContext.java:5273)
(trimmed for brevity)

Re: archiva 1.4M3 under geronimo 3.0.0 (was archiva 1.3.5)

Posted by Brett Porter <br...@apache.org>.
Unfortunately it seems that Geronimo is swallowing the all important exception from the listener. Is there anywhere else in the console, archiva.log, or other that might show it?

My only guess is that you might need the appserver.base system property to be set - the Tomcat instructions talk about that for Tomcat, but again not sure what the equivalent is for Geronimo.

Perhaps the Geronimo lists might be able to provide some more assistance too?

On 24/10/2012, at 10:37 AM, Thomas Harold <th...@nybeta.com> wrote:

> Circling back around to this, I've gotten farther but I suspect I still have some setup errors with Geronimo.
> 
> 1) I created the "ArchivaDS" in Geronimo web console and pointed it at a PostgreSQL database.  This seems to work fine as I can run queries against the database using the Geronimo console.
> 
> - Create the login role in pgsql 9.1 (i.e. "archiva"), assign it a random password
> 
> - Create a group role (i.e. "archiva_app")
> 
> - Assign the login role to the group role as a member
> 
> - Create the archiva database as UTF-8
> 
> - Set the default privileges for the group role to all
> 
> - Also allow the group role create/temp/connect permissions
> 
> - Fix your pg_hba.conf file (since this is user/database specific, put it in front of the other, more general, entries)
> 
> host    archiva         archiva         127.0.0.1/32            md5
> 
> - Create the data pool in Geronimo's console and verify that you can run queries against it (create a temporary table like "geronimo_test" and do a test SELECT)
> 
> 2) Load the downloaded WAR file into the Geronimo plan creator (under Navigator(Advanced), Applications, Plan Creator).  You will need to fill in the name of the datasource/datapool that you configured.  I changed the context path to be "archiva" instead of the default.  For everything else, I just used the defaults.
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
>    <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
>        <dep:moduleId>
>            <dep:groupId>default</dep:groupId>
>            <dep:artifactId>apache-archiva-js-1.4-M3</dep:artifactId>
>            <dep:version>1351030291765</dep:version>
>            <dep:type>war</dep:type>
>        </dep:moduleId>
>        <dep:dependencies>
>            <dep:dependency>
>                <dep:groupId>console.dbpool</dep:groupId>
>                <dep:artifactId>ArchivaDS</dep:artifactId>
>                <dep:version>1.0</dep:version>
>                <dep:type>car</dep:type>
>            </dep:dependency>
>            <dep:dependency>
>                <dep:groupId>org.apache.geronimo.configs</dep:groupId>
>                <dep:artifactId>javamail</dep:artifactId>
>                <dep:version>3.0.0</dep:version>
>                <dep:type>car</dep:type>
>            </dep:dependency>
>        </dep:dependencies>
>    </dep:environment>
>    <context-root>archiva</context-root>
>    <nam:resource-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
>        <nam:ref-name>jdbc/users</nam:ref-name>
>        <nam:pattern>
>            <nam:groupId>console.dbpool</nam:groupId>
>            <nam:artifactId>ArchivaDS</nam:artifactId>
>            <nam:version>1.0</nam:version>
>            <nam:name>ArchivaDS</nam:name>
>        </nam:pattern>
>    </nam:resource-ref>
>    <nam:resource-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
>        <nam:ref-name>mail/Session</nam:ref-name>
>        <nam:pattern>
>            <nam:groupId>org.apache.geronimo.configs</nam:groupId>
>            <nam:artifactId>javamail</nam:artifactId>
>            <nam:version>3.0.0</nam:version>
>            <nam:name>mail/MailSession</nam:name>
>        </nam:pattern>
>    </nam:resource-ref>
> </web-app>
> 
> 3) At this point, the application deploys properly into Geronimo, but will not start up.  The error I'm now stuck on is:
> 
> 25339:  2012-10-23 18:54:41,880 ERROR [ContextLoader] Context initialization failed
> 25432:  2012-10-23 18:54:41,885 ERROR [[/archiva]] Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
> 25525:  2012-10-23 18:54:41,886 ERROR [[/archiva]] Exception sending context initialized event to listener instance of class org.apache.archiva.web.startup.ArchivaStartup
> 25618:  2012-10-23 18:54:41,888 ERROR [StandardContext] Error listenerStart
> 25619:  2012-10-23 18:54:41,888 ERROR [StandardContext] Context [/archiva] startup failed due to previous errors
> 25620:  2012-10-23 18:54:41,888 ERROR [ContainerBase] ContainerBase.addChild: start:
> 25707:  2012-10-23 18:54:41,892 ERROR [[/archiva]] Exception sending context destroyed event to listener instance of class org.apache.archiva.web.startup.ArchivaStartup
> 25801:  2012-10-23 18:54:41,895 WARN [TomcatWebAppContext] TomcatWebAppContext failed
> 25802:  2012-10-23 18:54:41,895 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: abstractName="default/apache-archiva-js-1.4-M3/1351030291765/war?J2EEApplication=null,j2eeType=WebModule,name=default/apache-archiva-js-1.4-M3/1351030291765/war"
> 
> Since this is a brand new instance of Geronimo, it's possible that I've forgotten to configure something.

--
Brett Porter
brett@apache.org
http://brettporter.wordpress.com/
http://au.linkedin.com/in/brettporter
http://twitter.com/brettporter






Re: archiva 1.4M3 under geronimo 3.0.0 (was archiva 1.3.5)

Posted by Thomas Harold <th...@nybeta.com>.
Circling back around to this, I've gotten farther but I suspect I still 
have some setup errors with Geronimo.

1) I created the "ArchivaDS" in Geronimo web console and pointed it at a 
PostgreSQL database.  This seems to work fine as I can run queries 
against the database using the Geronimo console.

- Create the login role in pgsql 9.1 (i.e. "archiva"), assign it a 
random password

- Create a group role (i.e. "archiva_app")

- Assign the login role to the group role as a member

- Create the archiva database as UTF-8

- Set the default privileges for the group role to all

- Also allow the group role create/temp/connect permissions

- Fix your pg_hba.conf file (since this is user/database specific, put 
it in front of the other, more general, entries)

host    archiva         archiva         127.0.0.1/32            md5

- Create the data pool in Geronimo's console and verify that you can run 
queries against it (create a temporary table like "geronimo_test" and do 
a test SELECT)

2) Load the downloaded WAR file into the Geronimo plan creator (under 
Navigator(Advanced), Applications, Plan Creator).  You will need to fill 
in the name of the datasource/datapool that you configured.  I changed 
the context path to be "archiva" instead of the default.  For everything 
else, I just used the defaults.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
     <dep:environment 
xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
         <dep:moduleId>
             <dep:groupId>default</dep:groupId>
             <dep:artifactId>apache-archiva-js-1.4-M3</dep:artifactId>
             <dep:version>1351030291765</dep:version>
             <dep:type>war</dep:type>
         </dep:moduleId>
         <dep:dependencies>
             <dep:dependency>
                 <dep:groupId>console.dbpool</dep:groupId>
                 <dep:artifactId>ArchivaDS</dep:artifactId>
                 <dep:version>1.0</dep:version>
                 <dep:type>car</dep:type>
             </dep:dependency>
             <dep:dependency>
                 <dep:groupId>org.apache.geronimo.configs</dep:groupId>
                 <dep:artifactId>javamail</dep:artifactId>
                 <dep:version>3.0.0</dep:version>
                 <dep:type>car</dep:type>
             </dep:dependency>
         </dep:dependencies>
     </dep:environment>
     <context-root>archiva</context-root>
     <nam:resource-ref 
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
         <nam:ref-name>jdbc/users</nam:ref-name>
         <nam:pattern>
             <nam:groupId>console.dbpool</nam:groupId>
             <nam:artifactId>ArchivaDS</nam:artifactId>
             <nam:version>1.0</nam:version>
             <nam:name>ArchivaDS</nam:name>
         </nam:pattern>
     </nam:resource-ref>
     <nam:resource-ref 
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
         <nam:ref-name>mail/Session</nam:ref-name>
         <nam:pattern>
             <nam:groupId>org.apache.geronimo.configs</nam:groupId>
             <nam:artifactId>javamail</nam:artifactId>
             <nam:version>3.0.0</nam:version>
             <nam:name>mail/MailSession</nam:name>
         </nam:pattern>
     </nam:resource-ref>
</web-app>

3) At this point, the application deploys properly into Geronimo, but 
will not start up.  The error I'm now stuck on is:

25339:  2012-10-23 18:54:41,880 ERROR [ContextLoader] Context 
initialization failed
25432:  2012-10-23 18:54:41,885 ERROR [[/archiva]] Exception sending 
context initialized event to listener instance of class 
org.springframework.web.context.ContextLoaderListener
25525:  2012-10-23 18:54:41,886 ERROR [[/archiva]] Exception sending 
context initialized event to listener instance of class 
org.apache.archiva.web.startup.ArchivaStartup
25618:  2012-10-23 18:54:41,888 ERROR [StandardContext] Error listenerStart
25619:  2012-10-23 18:54:41,888 ERROR [StandardContext] Context 
[/archiva] startup failed due to previous errors
25620:  2012-10-23 18:54:41,888 ERROR [ContainerBase] 
ContainerBase.addChild: start:
25707:  2012-10-23 18:54:41,892 ERROR [[/archiva]] Exception sending 
context destroyed event to listener instance of class 
org.apache.archiva.web.startup.ArchivaStartup
25801:  2012-10-23 18:54:41,895 WARN [TomcatWebAppContext] 
TomcatWebAppContext failed
25802:  2012-10-23 18:54:41,895 ERROR [GBeanInstanceState] Error while 
starting; GBean is now in the FAILED state: 
abstractName="default/apache-archiva-js-1.4-M3/1351030291765/war?J2EEApplication=null,j2eeType=WebModule,name=default/apache-archiva-js-1.4-M3/1351030291765/war"

Since this is a brand new instance of Geronimo, it's possible that I've 
forgotten to configure something.