Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Import/Export problem

 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I am using WSSAD 5.0 .
I made a simple web project(test2) and when i wanted to import a new WAR file in that project it asked me either to add this file to a new project or to existing project . i clicked the radio button of the existing project but the new dialog box didnt show me the project (test2) i have already made but shown a blank view. Eventualy i manually typed the name of the existing project in that text box ..at the same time error has been shown at the top saying "
THE J2EE LEVEL OF THE WAR FILE DOES NOT MATCH THE WEB PROJECT LEVEL. "
If any one knows this .. then thanks ..
Kyle must know this
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Awais -- good to see you again. Where did the new WAR file come from? Was it created in an earlier version of WSAD, or some other tool?
Kyle
 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your .war and the project you creating using the same j2ee level?
 
Awais Bajwa
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kyle:
I created this war file outside of Studio from a standart java utility .This war contains a complete deployable web ablicaiont sample of very few jsps and servlets.
William: Sorry i do not understand what is ment same J2ee Level. I created a web project first and then tyied to import a war file that didnt work as i wrote above.
Awais
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you created the WAR file you provided it with a web.xml deployment descriptor. That DD will refer to a specific version of the Servlet specification. Could you post it and let us look at it?
Kyle
 
Awais Bajwa
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Kyle ,
That application is a little demo of struts and use using servlet 2.2 api specs.
Here is the web.xml i embedded in WAR file.

************************************************
<?xml version="1.0" encoding="ISO-8859-1"?>
< !DOCTYPE web-app<br /> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"<br /> "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">;
<web-app>
< !-- Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>
<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>0</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
< !-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
< !-- The Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
< !-- Application Tag Library Descriptor -->
<taglib>
<taglib-uri>/WEB-INF/app.tld</taglib-uri>
<taglib-location>/WEB-INF/app.tld</taglib-location>
</taglib>
< !-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
</web-app>
************************************************
Awais
[ March 05, 2003: Message edited by: Awais Bajwa ]
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you created the initial web project in Studio it created a web.xml file. My guess is that it was created to be a J2EE 1.3 (Servlet 2.3) web project and that is why your servlet 2.2 web project is giving it fits. J2EE 1.3 is the default.
In general, though you don't import a WAR file into an existing project. That overwrites the existing project. If you want to create a web project from a WAR file don't import it into a project, let it create a new project from the WAR file.
Kyle
 
Awais Bajwa
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have got your idea and it is very much clear now thanks Kyle.

Awais
 
keep an eye out for scorpions and black widows. But the tiny ads are safe.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic