I believe I found the issue…
The dependencies cannot be listed in the POM dependencies, but on the plugin 
dependencies:

...
<plugin>

        <dependencies>
                <!-- Derby -->
                <dependency>
                        <groupId>org.apache.derby</groupId>
                        <artifactId>derbyclient</artifactId>
                        <version>${derby.version}</version>
                        <scope>runtime</scope>
                </dependency>


        </dependencies>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
…

Sorry abou the spam…

/rp


> On 24 Feb 2015, at 19:18, Rui Lopes <[email protected]> wrote:
> 
> Hi all!
> 
> I’ve been trying to run jetty using the maven plugin but I’m getting the 
> ClassNotFoundException when I try to define a JDBC Realm or a mail resource.
> 
> In my pom.xml I have:
> …
> <dependency>
>       <groupId>org.eclipse.jetty</groupId>
>       <artifactId>jetty-server</artifactId>
>       <scope>runtime</scope>
> </dependency>
> <dependency>
>       <groupId>org.eclipse.jetty</groupId>
>       <artifactId>jetty-plus</artifactId>
>       <scope>runtime</scope>
> </dependency>
> <dependency>
>       <groupId>org.eclipse.jetty</groupId>
>       <artifactId>jetty-webapp</artifactId>
>       <scope>runtime</scope>
> </dependency>
> <dependency>
>       <groupId>org.apache.derby</groupId>
>       <artifactId>derbyclient</artifactId>
>       <scope>runtime</scope>
> </dependency>
> ...
> 
> <build>
>       <plugins>
>               <plugin>
>                       <groupId>org.eclipse.jetty</groupId>
>                       <artifactId>jetty-maven-plugin</artifactId>
>                       <version>9.3.0.M1</version>
>                       <configuration>
>                               
> <webAppSourceDirectory>${webapp.dir}</webAppSourceDirectory>
>                               <loginServices>
>                                       <loginService 
> implementation="org.eclipse.jetty.security.JDBCLoginService">
>                                               <name>MY JDBC Realm</name>
>                                               
> <config>${project.basedir}/etc/jdbcRealm.properties</config>
>                                       </loginService>
>                               </loginServices>
>                       </configuration>
>               </plugin>
>       </plugins>
> </build>
> …
> 
> And in my jdbcRealm.properties file:
> jdbcdriver = org.apache.derby.jdbc.ClientDriver
> url = jdbc:derby://localhost/gsrdb
> username = XXX
> password = XXX
> usertable = player
> usertablekey = email
> usertableuserfield = email
> usertablepasswordfield = password
> roletable = role
> roletablekey = id
> roletablerolefield = groupname
> userroletable = player_roles
> userroletableuserkey = player_id
> userroletablerolekey = role_id
> cachetime = 300
> 
> 
> When I call mvn jetty:run:
> …
> 2015-02-24 18:57:54.733:WARN:oejuc.AbstractLifeCycle:main: FAILED 
> JDBCLoginService[MY JDBC Realm]: java.lang.ClassNotFoundException: 
> org.apache.derby.jdbc.ClientDriver
> java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver
>       at 
> org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
>       at 
> org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
>       at 
> org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
>       at 
> org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
> …
> 
> When running with mvn -X jetty:run, I can see:
> …
> [INFO] >>> jetty-maven-plugin:9.3.0.M1:run (default-cli) > test-compile @ 
> gsr-jetty >>>
> [DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=2, 
> ConflictMarker.markTime=0, ConflictMarker.nodeCount=17, 
> ConflictIdSorter.graphTime=1, ConflictIdSorter.topsortTime=0, 
> ConflictIdSorter.conflictIdCount=13, ConflictIdSorter.conflictIdCycleCount=0, 
> ConflictResolver.totalTime=5, ConflictResolver.conflictItemCount=16, 
> DefaultDependencyCollector.collectTime=111, 
> DefaultDependencyCollector.transformTime=10}
> [DEBUG] pt.ipb.gsr:gsr-jetty:jar:0.1
> [DEBUG]    pt.ipb.gsr:gsr-war:war:0.1:runtime
> [DEBUG]    org.eclipse.jetty:jetty-server:jar:9.3.0.M1:runtime
> [DEBUG]       javax.servlet:javax.servlet-api:jar:3.1.0:runtime
> [DEBUG]       org.eclipse.jetty:jetty-http:jar:9.3.0.M1:runtime
> [DEBUG]          org.eclipse.jetty:jetty-util:jar:9.3.0.M1:runtime
> [DEBUG]       org.eclipse.jetty:jetty-io:jar:9.3.0.M1:runtime
> [DEBUG]    org.eclipse.jetty:jetty-webapp:jar:9.3.0.M1:runtime
> [DEBUG]       org.eclipse.jetty:jetty-xml:jar:9.3.0.M1:runtime
> [DEBUG]       org.eclipse.jetty:jetty-servlet:jar:9.3.0.M1:runtime
> [DEBUG]          org.eclipse.jetty:jetty-security:jar:9.3.0.M1:runtime
> [DEBUG]    javax.mail:javax.mail-api:jar:1.5.2:runtime
> [DEBUG]       javax.activation:activation:jar:1.1:runtime
> [DEBUG]    org.apache.derby:derbyclient:jar:10.11.1.1:runtime
> ...
> 
> 
> Any clues on what am I doing wrong?
> 
> Thanks guys!
> 
> /rp
> 
> _______________________________________________
> jetty-users mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe from 
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to