cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Servlet 2.4 with Netweaver Developer Studio 7.0?

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

p_2_5_6_9_6_0
Active Participant
0 Kudos

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.

Former Member
0 Kudos

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

Answers (4)

Answers (4)

p_2_5_6_9_6_0
Active Participant
0 Kudos

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.

Former Member
0 Kudos

I have in NWDS preferences in Java > Installed JRE: jdk1.5.0_15 (C:\Program Files\Java\jdk1.5.0_15)

I have set it back to j2sdk1.4.2_18, I am now doing a full build.

Is this the correct way?

Former Member
0 Kudos

Even with jdk 1.4 or 1.5 I get same errors...

Former Member
0 Kudos

My configuration is:

SAP NetWeaver Developer Studio

Version: 7.0.14

Build id: 200711171656

with:

j2sdk1.4.2_18

or

jdk1.5.0_15

When I create a new Web Module Project and that I edit the web.xml with Servlet 2.4 or 2.5, I get resolver errors.

Kind regards,

Tanguy

Former Member
0 Kudos

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

p_2_5_6_9_6_0
Active Participant
0 Kudos

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.

Former Member
0 Kudos

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

p_2_5_6_9_6_0
Active Participant
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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