Hi,
I am porting an existing application into maven2 and have not had much 
luck with it.  The target platform is IBM WAS CE 1.1.1, which is based on 
Geronimo.  I am doing all of my maven work using Q for Eclipse, but have 
tried the entire process with the command line, too.

I have resolved all of my (somewhat complex) dependencies in the pom, but 
when the built war is deployed I get java.lang.ClassCastException: 
org.apache.struts.action.ActionServlet incompatible with 
javax.servlet.Servlet.

I would deeply appreciate some help identifying what I did wrong.

Here is the pom:
<project xmlns="http://maven.apache.org/POM/4.0.0";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
        <modelVersion>4.0.0</modelVersion>
        <groupId>MyAppWeb</groupId>
        <artifactId>MyAppWeb</artifactId>
        <packaging>war</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>MyAppWeb Maven Webapp</name>
        <url>http://maven.apache.org</url>
        <dependencies>
                <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                        <version>3.8.1</version>
                        <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-j2ee_1.4_spec</artifactId>
                    <version>1.1</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                        <groupId>antlr</groupId>
                        <artifactId>antlr</artifactId>
                        <version>2.7.2</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>avalon-logkit</groupId>
                        <artifactId>avalon-logkit</artifactId>
                        <version>2.1</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>bsf</groupId>
                        <artifactId>bsf</artifactId>
                        <version>2.3.0</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>commons-beanutils</groupId>
                        <artifactId>commons-beanutils</artifactId>
                        <version>1.7.0</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>commons-chain</groupId>
                        <artifactId>commons-chain</artifactId>
                        <version>1.1</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>commons-collections</groupId>
                        <artifactId>commons-collections</artifactId>
                        <version>3.1</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>commons-digester</groupId>
                        <artifactId>commons-digester</artifactId>
                        <version>1.8</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>commons-fileupload</groupId>
                        <artifactId>commons-fileupload</artifactId>
                        <version>1.1.1</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>commons-io</groupId>
                        <artifactId>commons-io</artifactId>
                        <version>1.1</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>commons-lang</groupId>
                        <artifactId>commons-lang</artifactId>
                        <version>2.1</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                        <version>1.0.4</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>commons-validator</groupId>
                        <artifactId>commons-validator</artifactId>
                        <version>1.3.1</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>org.dbunit</groupId>
                        <artifactId>dbunit</artifactId>
                        <version>2.2</version>
                        <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>log4j</groupId>
                        <artifactId>log4j</artifactId>
                        <version>1.2.14</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>jdom</groupId>
                        <artifactId>jdom</artifactId>
                        <version>1.0</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>javax.servlet</groupId>
                        <artifactId>jstl</artifactId>
                        <version>1.0.2</version>
                        <scope>provided</scope>
                </dependency>
                <dependency>
                        <groupId>oro</groupId>
                        <artifactId>oro</artifactId>
                        <version>2.0.8</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>taglibs</groupId>
                        <artifactId>standard</artifactId>
                        <version>1.0.2</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>org.apache.struts</groupId>
                        <artifactId>struts-core</artifactId>
                        <version>1.3.8</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>org.apache.struts</groupId>
                        <artifactId>struts-taglib</artifactId>
                        <version>1.3.8</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>org.apache.velocity</groupId>
                        <artifactId>velocity</artifactId>
                        <version>1.5</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>werken-xpath</groupId>
                        <artifactId>werken-xpath</artifactId>
                        <version>0.9.4</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>MavenMyAppFW</groupId>
                        <artifactId>MavenMyAppFW</artifactId>
                        <version>1.0-SNAPSHOT</version>
                        <scope>compile</scope>
                </dependency>
        </dependencies>
        <build>
                <finalName>MyAppWeb</finalName>
                <plugins>
                        <plugin>
 <artifactId>maven-compiler-plugin</artifactId>
                                <configuration>
                                        <source>1.5</source>
                                        <target>1.5</target>
                                </configuration>
                        </plugin>
                </plugins>
        </build>
</project>

Here is the web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" 
xmlns="http://java.sun.com/xml/ns/j2ee"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>
        <display-name>MyAppJava</display-name>
 
          <!-- Standard Action Servlet Configuration (with debugging) -->
  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>app-config-file</param-name>
      <param-value>/WEB-INF/application-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>auth-config-file</param-name>
      <param-value>/WEB-INF/auths.xml</param-value>
    </init-param>
    <init-param>
      <param-name>ref-config-file</param-name>
      <param-value>/WEB-INF/refdata.xml</param-value>
    </init-param>
    <init-param>
      <param-name>debug</param-name>
      <param-value>2</param-value>
    </init-param>
    <init-param>
      <param-name>detail</param-name>
      <param-value>2</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
  </servlet>
 
  <!-- Standard Action Servlet Mapping -->
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.wss</url-pattern>
  </servlet-mapping>
 
        <welcome-file-list>
                <welcome-file>index.html</welcome-file>
        </welcome-file-list>
 
  <resource-ref>
    <res-ref-name>jdbc/MyDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
  </resource-ref>
 
</web-app>

And here is the geronimo-web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1"; 
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1"; 
xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1"; 
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1";>
  <sys:environment>
    <sys:moduleId>
      <sys:groupId>default</sys:groupId>
      <sys:artifactId>MyAppJava</sys:artifactId>
      <sys:version>1.0</sys:version>
      <sys:type>car</sys:type>
    </sys:moduleId>
    <sys:dependencies>
      <sys:dependency>
        <sys:groupId>console.dbpool</sys:groupId>
        <sys:artifactId>MyDBPool</sys:artifactId>
      </sys:dependency>
    </sys:dependencies>
    <sys:inverse-classloading/>
  </sys:environment>
  <context-root>/MyApp</context-root>
  <nam:resource-ref>
    <nam:ref-name>jdbc/MyDS</nam:ref-name>
    <nam:resource-link>MyDBPool</nam:resource-link>
  </nam:resource-ref>
</web-app>


Cliff Hayden
 .   .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . . 
 
i b m   i n t e r a c t i v e
1 Rogers Street
Cambridge, MA  02142

617 693 7049   office
781 258 1723   mobile
617 693 7180   fax
[EMAIL PROTECTED]  email

Reply via email to