• 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
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

Corrupted WEB XML File

 
Ranch Hand
Posts: 2051
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have set the Rational Application Developer up on a new computer.

I am moving some servlets from one package to another.
When I do some random line of code in the web.xml gets corrupted.
Another thing that happens is the move function will not work on a subsequent file unless I close the development environment and open it again.

I had this trouble before on my previous computer but at some point I was prompted to do some function on the web.xml to sync it or something to that affect.

I really can't remember the details but after I did this I never had these issues again.
 
Sheriff
Posts: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know Rational Application Developer, but maybe someone else here does.  You might get better responses on a forum dedicated to RAD.
 
Marshal
Posts: 3267
487
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Steve Dyke wrote:When I do some random line of code in the web.xml gets corrupted.


It's not really clear (to me) what is happening.

Where are you making the code change (web.xml, servlet, ??), and specifically what do you mean by gets corrupted?  Can you share examples or explain further?
 
Steve Dyke
Ranch Hand
Posts: 2051
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:

Steve Dyke wrote:When I do some random line of code in the web.xml gets corrupted.


It's not really clear (to me) what is happening.

Where are you making the code change (web.xml, servlet, ??), and specifically what do you mean by gets corrupted?  Can you share examples or explain further?



Within my Project Explorer view I right click on a servlet class file???, click the Refactor option, click the Move option, select the package I want to move the servlet class file??? to.
At this point the web.xml does not get auto updated with the selected package path. I open web.xml to search for the servlet.
The servlet definition name will be located in three areas. The normal definition as expected, the mapping area as expected, and the unexpected(what I am calling corrupted). The servlet name will be imbedded into a totally unrelated servlet definition.    
 
Ron McLeod
Marshal
Posts: 3267
487
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Steve Dyke wrote:At this point the web.xml does not get auto updated with the selected package path.


Is that supposed to happen?  

I just tried creating a version 2.5 Dynamic Web Project using Eclipse 2019-03.  The web.xml file was created and initialized as expected.  When I created a new Servlet it was automatically populated in the web.xml descriptor, but when I renamed the Servlet, or moved it to a different package, the web.xml descriptor was not changed, and I needed to update the <servlet-class> element manually.

Also, do you really need to use a web.xml descriptor?  Starting with Servlet version 3.0 (Java EE 6?), the configuration can be done using annotations (unless this is a Rational Application Developer ism).
 
Steve Dyke
Ranch Hand
Posts: 2051
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:

Also, do you really need to use a web.xml descriptor?  Starting with Servlet version 3.0 (Java EE 6?), the configuration can be done using annotations (unless this is a Rational Application Developer ism).



Yes this is RAD.

I am not simply changing the servlet name. I am moving it from one package to another.
 
Ron McLeod
Marshal
Posts: 3267
487
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:... when I renamed the Servlet, or moved it to a different package, the web.xml descriptor was not changed, and I needed to update the <servlet-class> element manually ...



Ahh .. it looks like why it didn't update for me was because I didn't check the Update fully qualified names in non-Java file option when I performed the move.  After doing that, the web.xml descriptor does in-fact get updated properly.  Are you already doing this?



 
Steve Dyke
Ranch Hand
Posts: 2051
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:

Ron McLeod wrote:... when I renamed the Servlet, or moved it to a different package, the web.xml descriptor was not changed, and I needed to update the <servlet-class> element manually ...



Ahh .. it looks like why it didn't update for me was because I didn't check the Update fully qualified names in non-Java file option when I performed the move.  After doing that, the web.xml descriptor does in-fact get updated properly.  Are you already doing this?



Sorry it has taken so long to get back to you on this.

I have selected the option you suggested. Then I click the preview I get this dialog box message:

Move compilation unit 'ShippingDocumentPackageDataControllerV8.java' to 'com.FAIWebApp._shipping.controllers.

Original Source
<servlet>
<description>
</description>
<display-name>
MOTrackingOPProcessUserOPEmailListServlet</display-name>
<servlet-name>MOTrackingOPProcessUserOPEmailListServlet</servlet-name>
<servlet-class>
com.FAIWebApp.supplierquality.MOTrackingOPProcessUserOPEmailListServlet</servlet-class>
</servlet>

Refactored Source
<servlet>
<description>
</description>
<display-name>
MOTrackingOPProcessUserOPEmailListServlet</display-name>com.FAIWebApp._shipping.controllers.ShippingDocumentPackageDataControllerServletV8s>
com.FAIWebApp.supplierquality.MOTrackingOPProcessUserOPEmailListServlet</servlet-class>
</servlet>

If I proceed then I have to manually adjust the web.xml.
Also. the move process will hang on the next one I try unless I close RAD and reopen it.
 
I am Arthur, King of the Britons. And this is a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic