facebook

struts taglib uri problem

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

    Island1956
    Member

    I am using a fresh install of j2sdk1.4.2_08, Tomcat 4.1.31, Eclipse 3.0.2 and MyEclipse 3.8.4 on Windows XP pro.
    1. created a j2ee web project
    2. added 1.1 struts support
    3. used the wizard for new Struts 1.1 Form, Action & JSP
    When I deploy, start the application server and exec the urL…
    1. on the console log I get ‘Exception initializing TldLocationsCache: XML parsing error on file /WEB-INF/web.xml: (line 2, col 9): Document is invalid: no grammar found.’
    2. in the browser I get ‘org.apache.jasper.JasperException: This absolute uri (http://jakarta.apache.org/struts/tags-bean) cannot be resolved in either web.xml or the jar files deployed with this application’

    What is the fix? 🙁

    #228167 Reply

    Riyad Kalla
    Member

    Post your web.xml file please.

    #228176 Reply

    Island1956
    Member

    This is the file as created by MyEclipse 3.8.4
    If I add the <taglib> node it tells me it is not a valid tag.
    Is the default locations correct in the struts.jar’s and tld’s in 3.8.4?

    <?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>

    #228179 Reply

    Riyad Kalla
    Member

    You are trying to run a web application following the Web 2.4 spec on Tomcat 4.1 which only supports up to web 2.3 spec. Either upgrade tomcat or don’t use the web 2.4 spec doctype for your web.xml file.

    #228192 Reply

    Island1956
    Member

    Ahh and which version of MyEclipse supports creating applications using the 2.3 servlet without modifying the files created by the wizards I intend to rely on?

    #228204 Reply

    Riyad Kalla
    Member

    Ahh and which version of MyEclipse supports creating applications using the 2.3 servlet without modifying the files created by the wizards I intend to rely on?

    All of them, just do File > New > Project > Web Project > (Select Web 2.3 Spec) > Finish

    Now you can copy the DOCTYPE from that web.xml file into your existing one.

    #228280 Reply

    Island1956
    Member

    So I create a j2ee 1.3 project to get the correct web.xml?
    I just want to create a web project based on Java 1.4.2, Struts 1.1 not using Eclipse 2.x. Should I just had created a j2ee 1.3 in the first place. Is there a good matrix of Java, J2ee, Eclipse, Tomcat and MyEclipse interrelationships anywhere?

    #228283 Reply

    Riyad Kalla
    Member

    I don’t understand your statement. J2EE is a standard, part of that standard are different version of specs that it supports (Web, Servlet, JSP, EJB, etc.). Tomcat is not a full fledges J2EE app server, it supports a subset of the J2EE spec, namely the Web/Servlet and JSP specs (no EJBs). If you are trying to run a Web 2.3 app (J2EE 1.3) you need Tomcat 4.1, your problem started because you were trying to run a Web 2.4 app (J2EE 1.4) on Tomcat 4.1, which only supports up to Web 2.3 spec. This has nothign to do with Eclipse or MyEclipse or any 3rd party developer tools. This is the same as you trying to run Java 5.0 code on a 1.4 runtime, it just won’t work.

    The steps I am giving you are a quick way to have MyEclipse generate a web 2.3 compliant web.xml file for you, then I was instructing you to grab the DOCTYPE header from that file and paste it over the schema declaration you had in your existing web 2.4 compliant file, the reason for this is that the structure of the two files only changed a little bit, so doing this trick would get you up and running very quickly so you could run your app on Tomcat 4.1.

    Now, given all that information, can you clarify your question for me?

    #228336 Reply

    Island1956
    Member

    -“I just want to create a web project based on Java 1.4.2, Struts 1.1 not using Eclipse 2.x. Should I just had created a j2ee 1.3 in the first place.” is very clear and “yes” without the …noise… would have been an excellent response.

    Thank you – John

    “Is there a good matrix of Java, J2ee, Eclipse, Tomcat and MyEclipse interrelationships anywhere?”
    I will look elsewhere…

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: struts taglib uri problem

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