java.lang.ClassNotFoundException: org.eclipse.jetty.webapp.WebAppContext when starting jetty

5,011 views
Skip to first unread message

raphael

unread,
Oct 31, 2009, 11:49:37 AM10/31/09
to Repo and Gerrit Discussion
Hi,
I followed http://gregmeiste.com/2009/06/gerrit-code-review-installation/
but I get this error:
2009-10-31 15:27:26.605::INFO: jetty-6.1.21
2009-10-31 15:27:26.645::WARN: EXCEPTION
java.lang.ClassNotFoundException:
org.eclipse.jetty.webapp.WebAppContext
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
...

when starting jetty.
I use Unbuntu 8.04.

Any idea about the error?

Raph

Shawn Pearce

unread,
Oct 31, 2009, 2:02:34 PM10/31/09
to repo-d...@googlegroups.com
On Sat, Oct 31, 2009 at 08:49, raphael <raphae...@googlemail.com> wrote:
> I followed http://gregmeiste.com/2009/06/gerrit-code-review-installation/
> but I get this error:
> 2009-10-31 15:27:26.605::INFO:  jetty-6.1.21
> 2009-10-31 15:27:26.645::WARN:  EXCEPTION
> java.lang.ClassNotFoundException:
> org.eclipse.jetty.webapp.WebAppContext

You are using configuration files for Jetty 7.x, but on a Jetty 6.x container.

Either upgrade your version of Jetty to 7.x and retry, or recreate the
$JETTY_HOME/contexts/gerrit.xml file using the Jetty 6 variant that is
included in the WAR.

raphael

unread,
Oct 31, 2009, 7:24:46 PM10/31/09
to Repo and Gerrit Discussion
Thanks for the help.
I cleanup my mess ans started again from scratch and I now get this
error:

2009-10-31 23:21:28.209::INFO: jetty-6.1.21
2009-10-31 23:21:28.372::INFO: Deploy /home/gerrit2/jetty/contexts/
test-jndi.xml -> org.mortbay.jetty.webapp.WebAppContext@176c74b{/test-
jndi,/home/gerrit2/jetty/contexts/test-jndi.d}
2009-10-31 23:21:28.429::INFO: Deploy /home/gerrit2/jetty/contexts/
javadoc.xml -> org.mortbay.jetty.handler.ContextHandler@2a5330{/
javadoc,file:/home/gerrit2/jetty/javadoc/}
2009-10-31 23:21:28.447::WARN: Config error at <New id="ReviewDb"
class="org.mortbay.jetty.plus.naming.Resource"><Arg/><Arg>jdbc/
ReviewDb</Arg><Arg>
<New class="org.apache.commons.dbcp.BasicDataSource"><Set
name="driverClassName">com.mysql.jdbc.Driver</Set><Set
name="url">jdbc:mysql://localhost/gerrit2?user=gerrit2&password=toto</
Set><Set name="initialSize">4</Set><Set name="maxActive">8</Set><Set
name="minIdle">4</Set><Set name="maxIdle">4</Set><Set
name="maxWait">60000</Set></New>
</Arg></New>
2009-10-31 23:21:28.447::WARN: EXCEPTION
java.lang.ClassNotFoundException:
org.apache.commons.dbcp.BasicDataSource
...

Any idea?

Raph


On Oct 31, 6:02 pm, Shawn Pearce <s...@google.com> wrote:
> On Sat, Oct 31, 2009 at 08:49, raphael <raphael.co...@googlemail.com> wrote:
> > I followedhttp://gregmeiste.com/2009/06/gerrit-code-review-installation/

Shawn Pearce

unread,
Oct 31, 2009, 7:44:11 PM10/31/09
to repo-d...@googlegroups.com
On Sat, Oct 31, 2009 at 16:24, raphael <raphae...@googlemail.com> wrote:
> 2009-10-31 23:21:28.447::WARN:  EXCEPTION
> java.lang.ClassNotFoundException:
> org.apache.commons.dbcp.BasicDataSource

You didn't install the commons-dbcp or commons-pool JARs into your
$JETTY_HOME/lib/plus or ext directory. Check the Gerrit install guide
again, it mentions these needing to be installed.

Emmanuel Grumbach

unread,
Nov 1, 2009, 2:29:17 AM11/1/09
to repo-d...@googlegroups.com
This happens to me although commons-pool JARs are in $JETTY_HOME/lib/plus but gerrit is working...

Emmanuel Grumbach
egru...@gmail.com

raphael

unread,
Nov 5, 2009, 5:39:31 PM11/5/09
to Repo and Gerrit Discussion
That's.
I now have c3p0-0.9.1.2.jar commons-dbcp-1.2.2.jar commons-
pool-1.5.3.jar jetty-plus-6.1.21.jar mysql-connector-java-5.0.8.jar
in the /home/gerrit2/jetty/lib/plus/ directory.
And now the log file gives:
2009-11-05 22:28:31.950::INFO: jetty-6.1.21
2009-11-05 22:28:32.250::INFO: Deploy /home/gerrit2/jetty/contexts/
test-jndi.xml -> org.mortbay.jetty.webapp.WebAppContext@176c74b{/test-
jndi,/home/gerrit2/jetty/contexts/test-jndi.d}
2009-11-05 22:28:32.352::INFO: Deploy /home/gerrit2/jetty/contexts/
javadoc.xml -> org.mortbay.jetty.handler.ContextHandler@2a5330{/
javadoc,file:/home/gerrit2/jetty/javadoc/}
2009-11-05 22:28:32.401::INFO: Deploy /home/gerrit2/jetty/contexts/
gerrit.xml -> org.mortbay.jetty.webapp.WebAppContext@1d7ad1c{/,/home/
gerrit2/jetty/webapps/gerrit.war}
2009-11-05 22:28:32.714::INFO: No Transaction manager found - if your
webapp requires one, please configure one.
2009-11-05 22:28:33.339::INFO: Extract /home/gerrit2/jetty/webapps/
gerrit.war to /tmp/Jetty_192_168_1_3_80_gerrit.war____wsmnjl/webapp
2009-11-05 22:28:35.330::INFO: No Transaction manager found - if your
webapp requires one, please configure one.
2009-11-05 22:28:38,143::INFO :
com.google.gerrit.server.config.GerritServerConfigProvider - No /home/
gerrit2/cfg/gerrit.config; assuming defaults
2009-11-05 22:28:39,418::WARN : com.google.gerrit.git.PushReplication
- No /home/gerrit2/cfg/replication.config; not replicating

Does it look fine?

I still don't manage to connect to gerrit.

Raph

On Oct 31, 11:44 pm, Shawn Pearce <s...@google.com> wrote:

Shawn Pearce

unread,
Nov 5, 2009, 5:49:19 PM11/5/09
to repo-d...@googlegroups.com
On Thu, Nov 5, 2009 at 14:39, raphael <raphae...@googlemail.com> wrote:
> And now the log file gives:
> 2009-11-05 22:28:38,143::INFO :
> com.google.gerrit.server.config.GerritServerConfigProvider  - No /home/
> gerrit2/cfg/gerrit.config; assuming defaults
> 2009-11-05 22:28:39,418::WARN : com.google.gerrit.git.PushReplication
> - No /home/gerrit2/cfg/replication.config; not replicating

Well, it opened the database this time.

> I still don't manage to connect to gerrit.

Can you explain this further? It looks like Gerrit opened its
database, so it should have been ready to handle requests.

raphael

unread,
Nov 7, 2009, 12:16:41 AM11/7/09
to Repo and Gerrit Discussion
Hi,
I was using port 80 and had this error:
failed SelectChann...@192.168.1.3:80:
java.net.SocketException: Permission denied

Now I use port 10000 and I manage to access the web page.
But I can't see any of the git projects in my /home/gerrit2/
repositories directory.
Is there anything in the logs that should list the repositories that
are found?

Raph

On Nov 5, 10:49 pm, Shawn Pearce <s...@google.com> wrote:

raphael

unread,
Nov 7, 2009, 1:18:24 AM11/7/09
to Repo and Gerrit Discussion
Hi,
I now found the Project Configuration page.
I managed to create an account and make it admin.
But when I try to load the nextval function into mysql (using
phpmyadmin) I get this error:

SQL query:

CREATE FUNCTION nextval_project_id(

) RETURNS BIGINTLANGUAGE SQL NOT DETERMINISTICMODIFIES SQL DATA BEGIN
INSERT INTO project_id( s )
VALUES (
NULL
);
MySQL said:

#1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '' at line 7

Raph

On Nov 7, 5:16 am, raphael <raphael.co...@googlemail.com> wrote:
> Hi,
> I was using port 80 and had this error:
> failed SelectChannelConnec...@192.168.1.3:80:

Shawn Pearce

unread,
Nov 7, 2009, 12:37:51 PM11/7/09
to repo-d...@googlegroups.com
On Fri, Nov 6, 2009 at 21:16, raphael <raphae...@googlemail.com> wrote:
> I was using port 80 and had this error:
> failed SelectChann...@192.168.1.3:80:
> java.net.SocketException: Permission denied

To run on ports below 1024 on UNIX you need to run the process as
root. This is extremely unsafe for a network server written in
pure-Java (like Jetty/Tomcat/Gerrit Code Review) because the server is
unable to change its user identity to a less powerful user before it
starts to process data received over the network. Long story short,
it is strongly recommended that you run on a port >1024 as a non-root
user.

> Now I use port 10000 and I manage to access the web page.
> But I can't see any of the git projects in my /home/gerrit2/
> repositories directory.
> Is there anything in the logs that should list the repositories that
> are found?

No. The repositories have to be registered first. See:

http://gerrit.googlecode.com/svn/documentation/2.0/project-setup.html

Shawn Pearce

unread,
Nov 7, 2009, 12:40:05 PM11/7/09
to repo-d...@googlegroups.com
On Fri, Nov 6, 2009 at 22:18, raphael <raphae...@googlemail.com> wrote:
> I now found the Project Configuration page.
> I managed to create an account and make it admin.
> But when I try to load the nextval function into mysql (using
> phpmyadmin) I get this error:
...

> #1064 - You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use
> near '' at line 7

Oh, I think I know what's wrong. The function is like 6 lines:

CREATE FUNCTION nextval_project_id ()
RETURNS BIGINT
LANGUAGE SQL
NOT DETERMINISTIC
MODIFIES SQL DATA
BEGIN
INSERT INTO project_id (s) VALUES (NULL);

DELETE FROM project_id WHERE s = LAST_INSERT_ID();
RETURN LAST_INSERT_ID();
END;

But phpMyAdmin helpfully ended it at the first ";" right after the
INSERT and only sent that part to the MySQL server. I suggest running
the script by hand from the command line using the MySQL command line
client tool, as you need to submit the entire block to MySQL at once.

raphael

unread,
Nov 9, 2009, 1:39:19 AM11/9/09
to Repo and Gerrit Discussion
Thanks very much.
I managed to set up an admin and a user account.

Now I am trying to use the system.
But I don't really understand the process.
I've copied a repository in the /home/gerrit/repositories and
installed it in gerrit.
I can see the branches.
The ssh test works.
So in another clone of the same repository I created to test branch.
I've committed some changes.
Then on gerrit I've created a branch as well.
When I try to push I get this message:
raph@cascade-dc1:~/src/GasSensor$ git push ssh://raph@cascade-dc1:29418/GasSensor
HEAD:refs/for/titi
Counting objects: 5, done.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 280 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
To ssh://raph@cascade-dc1:29418/GasSensor
! [remote rejected] HEAD -> refs/for/titi (you are not committer
raph@cascade-dc1)
error: failed to push some refs to 'ssh://raph@cascade-dc1:29418/
GasSensor'

raph@cascade-dc1:~/src/GasSensor$ git log
commit 9947fc33ce9908e38b9123bbdbfaf3e88a603162
Author: raph <raph@cascade-dc1>
Date: Sun Nov 8 23:31:09 2009 +0000

Raph

On Nov 7, 5:40 pm, Shawn Pearce <s...@google.com> wrote:

Shawn Pearce

unread,
Nov 9, 2009, 10:35:04 AM11/9/09
to repo-d...@googlegroups.com
On Sun, Nov 8, 2009 at 22:39, raphael <raphae...@googlemail.com> wrote:
> When I try to push I get this message:
...

>  ! [remote rejected] HEAD -> refs/for/titi (you are not committer
> raph@cascade-dc1)
...

> raph@cascade-dc1:~/src/GasSensor$ git log
> commit 9947fc33ce9908e38b9123bbdbfaf3e88a603162
> Author: raph <raph@cascade-dc1>

Gerrit requires that the committer identity (see git log
--pretty=full) use an email address which is also stored in your user
account (see Settings > Identities). This isn't typically required by
Git... but is done in Gerrit so project maintainers can assume the
address given in a commit can be used at some time in the future to
contact the author if necessary.

You need to configure user.email on your system. This is "step 1" of
almost any Git user guide these days:

git config --global user.name "Your Name"
git config --global user.email "your....@your.provider.example.com"

And then recreate the commit with the same message before you upload:

git commit --author="$(git config user.name) $(git config user.email)" --amend

Tomas Winkler

unread,
Nov 9, 2009, 11:41:20 AM11/9/09
to repo-d...@googlegroups.com

Sorry to hitchhike this conversation but I have related question
I have gerrit configured with LDAP so the user is configured with
system login and not with full name.
e.g. tomas vs. Tomas Winkler
When I'm trying to 'repo upload' it tries to use 'Tomas Winkler' is it
appears in commit message in stead of tomas and fails. The full name
is retrieved git var GIT_COMMITTER_IDENT and not with what I've
configured in repo setup.

.git/config
[user]
name = tomas

How can be this translation done? Where to solve this in gerrit or in repo?


Thanks
Tomas

raphael

unread,
Nov 9, 2009, 4:57:58 PM11/9/09
to Repo and Gerrit Discussion
Hi,
ok, that works now. I manage to push the branch.
Thanks very much.
I still don't really understand the process and the right management.
Is there a documentation somewhere?
Raph

On Nov 9, 3:35 pm, Shawn Pearce <s...@google.com> wrote:
> On Sun, Nov 8, 2009 at 22:39, raphael <raphael.co...@googlemail.com> wrote:
> > When I try to push I get this message:
> ...
> >  ! [remote rejected] HEAD -> refs/for/titi (you are not committer
> > raph@cascade-dc1)
> ...
> > raph@cascade-dc1:~/src/GasSensor$ git log
> > commit 9947fc33ce9908e38b9123bbdbfaf3e88a603162
> > Author: raph <raph@cascade-dc1>
>
> Gerrit requires that the committer identity (see git log
> --pretty=full) use an email address which is also stored in your user
> account (see Settings > Identities).  This isn't typically required by
> Git... but is done in Gerrit so project maintainers can assume the
> address given in a commit can be used at some time in the future to
> contact the author if necessary.
>
> You need to configure user.email on your system.  This is "step 1" of
> almost any Git user guide these days:
>
>   git config --global user.name "Your Name"
>   git config --global user.email "your.em...@your.provider.example.com"

Shawn Pearce

unread,
Nov 9, 2009, 5:11:08 PM11/9/09
to repo-d...@googlegroups.com
On Mon, Nov 9, 2009 at 13:57, raphael <raphae...@googlemail.com> wrote:
> I still don't really understand the process and the right management.
> Is there a documentation somewhere?

http://gerrit.googlecode.com/svn/documentation/2.0/index.html

?

Reply all
Reply to author
Forward
0 new messages