2008/10/8 Maxim Suponya <[EMAIL PROTECTED]>

> Hi,
> I have a web app that is built using maven 2.0.8. The application's
> pom.xml contains following dependency:
>
>      <dependency>
>        <groupId>org.apache.felix</groupId>
>        <artifactId>org.apache.felix.framework</artifactId>
>        <version>1.2.1</version>
>      </dependency>
>
> But felix, in turn, depends on a project defined in
> javax.servlet-1.0.0.pom which subsequently makes a jar file called
> javax.servlet-1.0.0.jar ending up in WEB-INF/lib together with
> org.apache.felix.framework-1.2.1.jar.


have you tried using:

     <dependency>
       <groupId>org.apache.felix</groupId>
        <artifactId>org.apache.felix.framework</artifactId>
       <version>1.2.1</version>
       <exclusions>
         <exclusion>
           <groupId>org.apache.felix</groupId>
           <artifactId>javax.servlet</artifactId>
         </exclusion>
       </exclusions>
     </dependency>

to tell Maven to exclude the transitive servlet dependency?


> When the web application starts and the servlet that launches felix gets
> initialized, a ClassCastException is thrown saying that this servlet is
> not a Servlet.. this is due to presence of javax.servlet-1.0.0.jar with
> Servlet.class in WEB-INF/lib which comes in conflict with the one that's
> provided by Tomcat.
>
> Adding <scope>provided</scope> in my app's pom.xml doesn't make any
> difference.
>
>      <dependency>
>        <groupId>org.apache.felix</groupId>
>        <artifactId>javax.servlet</artifactId>
>        <version>1.0.0</version>
>        <scope>provided</scope>
>      </dependency>
>
> Is there any way around this?
>
> Thanks a lot,
>
> Maxim
>
> - ----------------
> IMPORTANT NOTICE : The information in this email is confidential and may
> also be privileged. If you are not the intended recipient, any use or
> dissemination of the information and any disclosure or copying of this email
> is unauthorised and strictly prohibited. If you have received this email in
> error, please promptly inform us by reply email or telephone. You should
> also delete this email and destroy any hard copies produced.


-- 
Cheers, Stuart

Reply via email to