facebook

problem in struts with myeclipse 4.0

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #233536 Reply

    nwanglu
    Member

    eclipse 3.1 rc3+ myeclipse 4.0
    i create a j2ee webproject then add struts capabilities 1.2 to it,
    create myjsp.jsp from template struts 1.2 .
    1.jsp***************
    <%@ page language=”java” pageEncoding=”UTF-8″%>

    <%@ taglib uri=”/WEB-INF/struts-html.tld” prefix=”html” %>
    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
    <html:html locale=”true”>
    <head>
    <html:base />

    <title>MyJsp.jsp</title>
    </head>

    <body>
    This a struts page. <br>
    </body>
    </html:html>

    MY web.xml
    <?xml version=”1.0″ encoding=”UTF-8″?>
    <web-app xmlns=”http://java.sun.com/xml/ns/j2ee&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; version=”2.4″ xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”&gt;
    <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>debug</param-name>
    <param-value>3</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>3</param-value>
    </init-param>
    <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    </web-app>

    MY STRUTS-CONFIG.XML
    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE struts-config PUBLIC “-//Apache Software Foundation//DTD Struts Configuration 1.1//EN” “http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd”&gt;

    <struts-config>
    <data-sources />
    <form-beans />
    <global-exceptions />
    <global-forwards />
    <action-mappings />
    <message-resources parameter=”com.yourcompany.struts.ApplicationResources” />
    </struts-config>

    seems nothing wrong,but,
    after i deploy and wrong tomcat,problem happened:
    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    javax.servlet.ServletException: org/apache/commons/logging/LogFactory
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
    org.apache.jsp.MyJsp_jsp._jspService(MyJsp_jsp.java:75)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

    root cause

    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    org.apache.struts.util.MessageResources.<clinit>(MessageResources.java:101)
    org.apache.struts.taglib.html.HtmlTag.<clinit>(HtmlTag.java:93)
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    java.lang.Class.newInstance0(Class.java:350)
    java.lang.Class.newInstance(Class.java:303)
    org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:116)
    org.apache.jsp.MyJsp_jsp._jspx_meth_html_html_0(MyJsp_jsp.java:87)
    org.apache.jsp.MyJsp_jsp._jspService(MyJsp_jsp.java:66)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.

    ——————————————————————————–

    Apache Tomcat/5.0.28

    //tomcat ‘s common lib is default,

    NOW,HOW CAN I DO? THANKS!

    #233537

    nwanglu
    Member

    my os is: win xp sp2
    jdk version is: 5.0

    #233538

    Riyad Kalla
    Member

    Part of adding Struts Capabilities to your project is to add all the necessary Struts libraries. This includes commons-logging.jar. It seems you have tampered with the added JARs or just forgotten to include them in your WEB-INF/lib directory.

    #233541

    nwanglu
    Member

    @support-rkalla wrote:

    Part of adding Struts Capabilities to your project is to add all the necessary Struts libraries. This includes commons-logging.jar. It seems you have tampered with the added JARs or just forgotten to include them in your WEB-INF/lib directory.

    i am sure
    commons-beanutils.jar
    commons-digester.jar
    commons-fileupload.jar
    commons-logging.jar
    commons-validator.jar
    jakarta-oro.jar

    these jars ‘re in the tomcat/webapp/ deploy-project/WEB-INF/lib directory…..
    myeclipse 3.84 dose’nt has this problem….

    #233542

    Riyad Kalla
    Member

    Hmm this is very strange. Is this a web project? If you open up your project properties and go to MyEclipse-Web, what settings do you have in that panel?

    Also what is the contents of your Java Build Path > Libraries tab?

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: problem in struts with myeclipse 4.0

You must be logged in to post in the forum log in