Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] First experiences using Jetty for unittest

Also, aside from the jsp dependencies, none of those other things were
coming from missing dependencies in jetty itself, looks your webapp or
dependencies in your webapp, were trying to use stuff that were not
declared in your maven setup...

alternately there is a jetty-maven-plugin that would let you just
start your webapp in an instance of jetty from the cli

http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin

there are jetty7 versions of that plugin as well.

cheers,
jesse

--
jesse mcconnell
jesse.mcconnell@xxxxxxxxx



On Fri, Jul 16, 2010 at 08:30, Jesse McConnell
<jesse.mcconnell@xxxxxxxxx> wrote:
> Jetty 7 has aggregates where are a single dependency for all of the
> bits and pieces you might need..you must have just missed it.
>
> if there is a particular bundle that you need rolled then open an
> issue for it and we'll see about added one...for example I am not sure
> if we have the jsp aggregate bundle yet which it seems like you might
> need.
>
> http://repo2.maven.org/maven2/org/eclipse/jetty/aggregate/
>
> cheers,
> jesse
>
> --
> jesse mcconnell
> jesse.mcconnell@xxxxxxxxx
>
>
>
> On Fri, Jul 16, 2010 at 08:22, Tom <tbee@xxxxxxxx> wrote:
>> I have a number of unittest of a servlet running against Tomcat. This is not
>> practical because it requires Tomcat to be started (manually) before the
>> unittest can run. Since I'm also using Maven, so I'd like to start the
>> webapp container as part of the unittest, so I figured I'd give Jetty a try.
>>
>> Initially I googled Jetty 6 and added the corresponding dependency to my
>> pom, and it downloaded fine. But then during the browsing of the
>> documentation I saw that there is a Jetty 7 hosted by Eclipse. So I wanted
>> to change my dependency to match that. But is seems there is no single
>> pom-artifact that just adds a full installation of Jetty 7. Very
>> unpractical! For unittesting it is not required to have a lean Jetty, just
>> roll it in.
>>
>> I worked around that by adding the embedded-test artifact as a dependency.
>> And started to setup Jetty; that was quite simple and I quickly had a server
>> that should be able to start my webapp. Great! But then JAR hell broke lose.
>> Everytime I started the server I needed another JAR; initially the JSP
>> implementation was missing. So I copied the dependencies from the
>> embedded-test directly into my pom and tried adding the JSP component. After
>> that was ok, I got a missing Apache Juli, com.sun.org.apache.commons.Log,
>> and I stopped at: java.lang.NoSuchMethodError:
>> org.apache.xerces.xni.Augmentations.removeAllItems()
>>
>> So I switched back to Jetty 6, which was a nice and single dependency. But I
>> ran into the same missing third party jars. Further investigation is needed
>> to determine why all these problems occur (remember that the project is
>> compiling and working fine ATM under Tomcat). I'll try again in another
>> project someday, but this was a frustrating ride so far.
>>
>> If anyone can give pointers on what I may have done wrong, please do!
>>
>> Tom
>> _______________________________________________
>> jetty-users mailing list
>> jetty-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>
>


Back to the top