-1

I use MyEclipse 10 to build an empty web with adding Struts 2.1 capability. In MyEclipse 10, I only add Struts 2 Core Libraries, which contain below libraries in WEB-INF/lib:

antlr-2.7.2.jar
aopalliance-1.0.jar
classworlds-1.1.jar
commons-beanutils-1.7.0.jar
commons-chain-1.2.jar
commons-collections-3.2.jar
commons-digester-2.0.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-lang-2.3.jar
commons-logging-1.0.4.jar
commons-logging-api-1.1.jar
commons-validator-1.3.1.jar
freemarker-2.3.16.jar
javassist-3.7.ga.jar
json-lib-2.1-jdk15.jar
ognl-3.0.jar
oro-2.0.8.jar
sslext-1.2-0.jar
struts2-convention-plugin-2.2.1.jar
struts2-core-2.2.1.jar
struts2-embeddedjsp-plugin-2.2.1.jar
struts2-json-plugin-2.2.1.jar
xwork-core-2.2.1.jar

My web application contains no any Struts action. so struts.xml is also empty as below:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>


</struts>    

My web.xml is as below:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
  <display-name></display-name> 
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <filter>
    <filter-name>struts2</filter-name>
    <filter-class>
        org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
    </filter-class>
  </filter>
  <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
</web-app>

My index.jsp is below:

<%@ page language="java" import="java.util.*" pageEncoding="UTF8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">

    <title>My JSP 'index.jsp' starting page</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
  </head>

  <body>
    This is my JSP page. <br>
  </body>
</html>

After deploy to Geronimo 2.2.1, Geronimo showed me deploy failed because the below errors:

org/apache/struts/taglib/html/FormTag
java.lang.NoClassDefFoundError: org/apache/struts/taglib/html/FormTag
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at org.apache.geronimo.kernel.classloader.JarFileClassLoader.access$200(JarFileClassLoader.java:52)
    at org.apache.geronimo.kernel.classloader.JarFileClassLoader$6.run(JarFileClassLoader.java:302)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.geronimo.kernel.classloader.JarFileClassLoader.findClass(JarFileClassLoader.java:254)
    at org.apache.geronimo.kernel.config.MultiParentClassLoader.loadOptimizedClass(MultiParentClassLoader.java:416)
    at org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:256)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at org.apache.geronimo.jasper.deployment.JspModuleBuilderExtension.parseTldFile(JspModuleBuilderExtension.java:472)
    at org.apache.geronimo.jasper.deployment.JspModuleBuilderExtension.getListenerClasses(JspModuleBuilderExtension.java:433)
    at org.apache.geronimo.jasper.deployment.JspModuleBuilderExtension.createJspClassFinder(JspModuleBuilderExtension.java:189)
    at org.apache.geronimo.jasper.deployment.JspModuleBuilderExtension.addGBeans(JspModuleBuilderExtension.java:158)
    at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans(TomcatModuleBuilder.java:513)
    at org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder.addGBeans(SwitchingModuleBuilder.java:165)
    at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:652)
    at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:257)
    at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:136)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
    at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:130)
    at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:851)
    at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:237)
    at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
    at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
    at java.lang.Thread.run(Thread.java:619)

However, as you can see, my web application contains not any Struts Action class, nor my web application uses any Struts1. It is just an empty web application. so I don't know why Geronimo tells me that NoClassFoundException for Struts1 object: org/apache/struts/taglib/html/FormTag

wureka
  • 731
  • 1
  • 11
  • 26
  • first of all check without `StrutsPrepareAndExecuteFilter` and can you show index.jsp also – Umesh Awasthi Jan 02 '12 at 06:35
  • ok, I added my index.jsp to my post, and follow your suggestions: 1. remove filer containing StrutsPrepareAndExecuteFilter and its filter-mapping 2. re-export the web to war file 3. use Geronimo console to deploy the war file As a result, Geronimo report the same error. – wureka Jan 02 '12 at 06:58
  • than i am sure its not related to Struts2.I hope some one will look at this or will try to deploy it on Geronimo in evening – Umesh Awasthi Jan 02 '12 at 07:02
  • Many thanks to @UmeshAwasthi 's help. Your direction shows me a way to solve my problem. Finally I found that a library sslext-1.2-0.jar will use the Struts1 object. After I remove the jar file, the deployment is OK. Thank you again – wureka Jan 02 '12 at 07:14
  • Good, you figured it out..Good way to go :) – Umesh Awasthi Jan 02 '12 at 07:22

0 Answers0