This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Serious Struts Compatibility issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Serious Struts Compatibility issue" Watch "Serious Struts Compatibility issue" New topic
Author

Serious Struts Compatibility issue

Yogaraj Khanal
Ranch Hand

Joined: Jun 06, 2007
Posts: 40
Hi All,
I have been working with struts for quite a while but facing various versioning issues.
I used Struts 1.3.8 and 2.0.6 and with Tomcat.I have some applications built on Tomcat 4.X and Resin WServer and Struts 1.2.7.
I have hard time solving error like Cookie.Tie,JasperException due to deprecited methods.
I have been installing and uninstalling Tomcat for hunderd times and switching between 4,5,and 6 to solve the compatibility issues.Since the application running in one doesn't run after some time.I am able to run so many tutorials in one config and again the same doesn't work.I am replacing jars with the latest and the earliest versions of Struts too.
Is there any platform that works for all???
Anyone Struts experts can guide me how to resolve this issue


Raj
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
All Struts 1 versions should run on all versions of Tomcat. However, Struts 2 requires a J2EE 1.4 compatible container, and only Tomcat 5 and above meet that requirement.

I'd have to know a lot more about your applications than I do to advise you on what might be going wrong. I will say, though, that if you're putting Struts jars in Tomcat shared directories, that could be causing the problems. Each Struts application should contain all Struts related jar files in its own WEB-INF/lib directory.


Merrill
Consultant, Sima Solutions
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

Are you using Netbeans. NB has good handling features


===Vyas Sanzgiri===
My Blog
Yogaraj Khanal
Ranch Hand

Joined: Jun 06, 2007
Posts: 40
hi ,
I am still getting this error:
Failed to load or instantiate TagExtraInfo class
orgapachestrutstaglibbeanCookieTie
Please suggest me what do I need to do to resolve it
I am using Struts 1.3.8 now
Regards,
Raj
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi Yogaraj,


Failed to load or instantiate TagExtraInfo class
orgapachestrutstaglibbeanCookieTie
Please suggest me what do I need to do to resolve it


When do you get this error, and which container are you using.

And please post the original errormessage (by copy/paste) and don't retype it yourself.

Herman
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
One of the things we find time and again causing problems when applications are upgraded to later versions of struts is not being thorough enough in removing old artifacts and replacing them with new ones. You may want to go through this list of things and see if you've done them all:
  • remove all struts-related jar files from your application and replace them with new ones that came from the download of Struts that you will be using. This includes Apache Commons Jar files
  • Replace DTD references in all xml files with a reference to the new DTD. Then make sure that the XML files themselves conform to the new DTD
  • In the case of migrating from any 1.2.x version to any 1.3.x version, change all URIs used in <%@ taglib> tags to the newer style that uses a namespace instead of an actual TLD file location. You can see examples of the URI required in any of the JSPs in the struts-examples-1.3.x.war file that comes with the download
  • Yogaraj Khanal
    Ranch Hand

    Joined: Jun 06, 2007
    Posts: 40
    This is the erroe I am getting with jdk 1.4 Tomcat 5.0 and Struts 1.2.7
    javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
    org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:741)
    org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
    org.apache.jsp.homepage_jsp._jspx_meth_html_form_0(homepage_jsp.java:106)
    org.apache.jsp.homepage_jsp._jspService(homepage_jsp.java:77)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    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:802)
    Yogaraj Khanal
    Ranch Hand

    Joined: Jun 06, 2007
    Posts: 40
    hi all,
    I am able to run a struts application using Resin,Struts 1.3.8 and jdk 1.4.
    I am migrating same applicaiton in same platform to tomcat 5.0 the index page opens all the other jsp pages are working.But as soon as click submit button I have no idea why this error is coming anyone got any clue
    I checked in jar and there I can see both ActionError and ActionErrors Classes in the jar.I don't know what to do next?
    The error is like this java.lang.NoClassDefFoundError: org/apache/struts/action/ActionError
    ActionBean.execute(ActionBean.java:29)
    org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
    org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
    org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
    org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
    org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
    org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
    org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Merrill Higginson
    Ranch Hand

    Joined: Feb 15, 2005
    Posts: 4864
    Originally posted by Yogaraj Khanal:
    The error is like this java.lang.NoClassDefFoundError: org/apache/struts/action/ActionError

    ActionError is deprecated in Struts 1.3. The solution is to remove all references to it and replace them with ActionMessage.
    [ July 05, 2007: Message edited by: Merrill Higginson ]
    Yogaraj Khanal
    Ranch Hand

    Joined: Jun 06, 2007
    Posts: 40
    But I didn't make use of that class ActionError anywhere in my code.
    Regards,
    Raj
    Yogaraj Khanal
    Ranch Hand

    Joined: Jun 06, 2007
    Posts: 40
    But I didn't make use of that class ActionError anywhere in my code.
    But I can see both classes in the jar Both ActionError and ActionErrors.
    Shall i unzip the jar delete those classes zip and put it back?
    Regards,
    Raj
    Merrill Higginson
    Ranch Hand

    Joined: Feb 15, 2005
    Posts: 4864
    Originally posted by Yogaraj Khanal:
    But I didn't make use of that class ActionError anywhere in my code.

    According to the stack trace you did. The stack trace indicates that at line 29 in a class named ActionBean, you made a reference to ActionError. If this line does not reference ActionError directly, perhaps it references another class that has a dependency on ActionError, such as a subclass of ActionError.
    [ July 05, 2007: Message edited by: Merrill Higginson ]
    Yogaraj Khanal
    Ranch Hand

    Joined: Jun 06, 2007
    Posts: 40
    I got your point but how do I find how are the ActionError and ActionMessage related and how do I repalce the deprecated methods in ActionError since I am not using any of those.I am sending you both my ActionBean and ActionFormBean code.
    import javax.servlet.*;
    import java.util.*;
    import javax.servlet.http.*;

    import org.apache.struts.action.*;

    public class ActionFormBean extends ActionForm
    {
    private String uname,pword;

    public void setUname(String uname)
    {
    this.uname=uname;
    }
    public String getUname()
    {
    return uname;
    }

    public void setPword(String pword)
    {
    this.pword=pword;
    }
    public String getPword()
    {
    return pword;
    }






    }



    import org.apache.struts.action.*;
    import org.apache.commons.beanutils.PropertyUtils;

    import javax.servlet.*;
    import java.io.*;
    import javax.servlet.http.*;

    public class ActionBean extends Action
    {
    public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest req,HttpServletResponse res)throws Exception
    {
    String uname=(String)PropertyUtils.getSimpleProperty(form,"uname");
    String pword=(String)PropertyUtils.getSimpleProperty(form,"pword");


    if(uname.equals("gates")&&pword.equals("tech"))
    {

    return (mapping.findForward("success"));
    }
    else
    {


    return (mapping.findForward("fail"));
    }
    }
    }
    Yogaraj Khanal
    Ranch Hand

    Joined: Jun 06, 2007
    Posts: 40
    Also I don't have any ActionError Class in my org.apache.struts.action package inside
    struts-core-1.3.8.jar

    I have only ActionErrors class I don't think this is what I want to make it work.
    Merrill Higginson
    Ranch Hand

    Joined: Feb 15, 2005
    Posts: 4864
    This is very strange. Is there a possibility that the compiled class file for ActionBean does not match the source? Try deleting all class files and recompiling the entire project, making sure that your compile-time classpath contains only Struts 1.3.8 jar files.
    [ July 05, 2007: Message edited by: Merrill Higginson ]
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Serious Struts Compatibility issue
     
    Similar Threads
    Tomcat searching for files in a wrong path?
    Eclipse and invalid ports
    JDK - Tomcat version compatibility
    Versioning pooling
    Cannot link to session EJB on Windows