Skip to Content
avatar image
Former Member

How to use Servlet 2.4 with Netweaver Developer Studio 7.0?

Hello,

When I define my web.xml as follows:

<!DOCTYPE web-app 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">

I get an error in french: "La DTD du type de lélément racine "" doit se terminer par '>'." Saying that the DTD of type of root element must end with '>'

How can I solve this error?

Thanks for your help,

Tanguy Mezzano

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 26, 2008 at 03:25 PM

    Hi,

    The root element (<? xml >) of the .xml file in question currently ends with a '>'.

    You need to modify it to end with a '?>'. Use the source view of your NWDS to edit the file. Then build and deploy.

    Hope that helps.

    Thanks.

    p256960.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello,

      the tag <?xml already ends with ?>

      my web.xml file is as follows:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app 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" >
      
      <web-app>
      	<display-name>ShowRequestHeaders</display-name>
      	<description>This application is used to output the http request headers.</description>
      	
      </web-app>
      
      

      and I still get that it does not end with '>'

      Thanks for replying, I'll give points

  • avatar image
    Former Member
    Nov 26, 2008 at 03:37 PM

    try it without dtd - use a schema instead

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 26, 2008 at 03:42 PM

    Hi,

    <?xml version="1.0" encoding="UTF-8"?>

    <!DOCTYPE web-app 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" >

    There is a " (double quote missing in the xsi:schemaLocation attribute. This is the reason. I am guessing that you may have tried manually editing this web.xml file and may not have correctly edited it.

    To correct the <? xml ?> and <!DOCTYPE> tags - please openup a blank Web Module Project and copy these two tags only from the web.xml and overwrite the same tags in your web.xml.

    Hope that this helps.

    Thanks.

    p256960.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I have an error that says that value of schemalocation needs to have a pair number of URI's.

      So, there are no quotes needed between those two URI's.

      But when I use the xsd without the DOCTYPE, I get two errors:

      1) The tag preceding the root element needs to be well defined

      2) Resolver failed C:\Program Files\SAP\IDE70\eclipse\plugins\com.tssap.j2ee.ui_2.0.0\definitions\C:\Documents and Settings\...\workspace\ShowRequestHeaders\WEB-INF\j2ee_1_4.xsd (The filename, directory name, or volume label syntax is incorrect)

      I am using SAP Netweaver Developer Studio 7.0, I don't know how it setup NWDS to use the correct xsd.

      Regards,

      Tanguy

  • avatar image
    Former Member
    Nov 26, 2008 at 04:17 PM

    Hi,

    Can you elaborate a little more on what the project is? The different components maybe?

    It does not seem like an XML error anymore. It could be a problem with the project creation wherein the problem is resolved by recreating the probject from scratch. However, that is a drastic step.

    No need to try using the code without <DOCTYPE> because it is a standard schema tag that is required for xsd.

    Also can you tell us what did you do with the servlet (web.xml) .. was it working before any changes or is it in the state it was created it?

    Thanks.

    p256960.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I created that JSP application and had at first:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
      

      Then I copy and paste that code with

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

      in order to use new functionalities of Servlet 2.4 but then I get errors in NWDS.

      Does NWDS 7.0 only support Servlet 2.3 and not 2.4 or 2.5, or is there a way to enable it by copying xsd files in some specific directory?

      Thanks again,

      Tanguy

  • avatar image
    Former Member
    Nov 26, 2008 at 04:35 PM

    Hi,

    I can see now what you are trying to do.

    But that approach is incorrect. NWDS 7.0 will support the Servlet Specification that comes with the installation of J2EE that you have currently installed. Unfortunately we cannot switch it using an xml reference in the web.xml.

    J2EE 1.4 SDK contains an implementation of the Java Servlet 2.4 specification.

    In order to use the Servlet 2.4 version - install the respective J2EE version. Please see:

    http://java.sun.com/products/servlet/download.html

    You may also try downloading the required J2EE and copying the j2ee.jar into the build path of your problect - it may work (I am not entirely sure about that)

    Although I recommend that you dont because I have tried switching JDKs and J2EE in the middle of development and deployment is a major headache (at least it was for me).

    Sorry about the confusion.

    Hope that the project works out for you.

    Thanks.

    p256960.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Tanguy

      Did you manage to solve your issue in the end?

      If you did, can you post here what your solution was please

      Many thanks