This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 160939 - No XML Unescape
Summary: No XML Unescape
Status: RESOLVED WORKSFORME
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Tomcat (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-23 19:19 UTC by ememisya
Modified: 2009-06-30 14:23 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ememisya 2009-03-23 19:19:41 UTC
The "Copy Project", "Rename Project" functionality, basically anything which modifies context.xml or any other, doesn't
unescape XML.

Assuming I had a resource with the password ">>" in my context.xml

<Resource auth="Container" 
   password=">>" />

Once I copy or rename the project, it turns into,

<Resource auth="Container" 
   password="&gt;&gt;" />

Which fails to login.
Comment 1 Andrey Yamkovoy 2009-03-24 08:49:53 UTC
As far as I know this functionality is in the Project UI API module.
Reassign to Projects for evaluation.
Comment 2 Milos Kleint 2009-03-24 10:42:03 UTC
context.xml? are we talking about web projects? please include more detailed information about your problem.
Comment 3 David Konecny 2009-03-24 23:47:53 UTC
Does not happen to me either. I created a fresh web application for Tomcat and added to context.xml

Resource auth="Container" 
   password=">>" />

and moved project to different folder and/or renamed it and my context.xml stays as it was.
Comment 4 David Konecny 2009-04-02 04:12:10 UTC
Feel free to reopen if you still have the problem and provide more info on how to reproduce. Thanks.
Comment 5 ememisya 2009-04-09 18:22:26 UTC
Here are the steps to reproduce the problem.

1-) Create a new Web Application, name it "WebApplication1"

2-) Edit the context.xml as below.

OLD:
<Context path="/WebApplication1"/>

NEW:
<Context path="/WebApplication1">
    <Resource 
    auth="Container" 
    driverClassName="com.mysql.jdbc.Driver"
    logAbandoned="true"
    maxActive="100"
    maxIdle="30"
    maxWait="10000"
    name="jdbc/glc"
    removeAbandoned="true"
    removeAbandonedTimeout="60"
    type="javax.sql.DataSource"
    url="jdbc:mysql://localhost:3306/test?autoReconnect=true"
    username="test"
    password="TEST>>"
    />
</Context>

3-) Save the context.xml

4-) Right click on the project from the "Projects" window and select "Rename..."

5-) Rename the project to "TestCase" check the "Also Rename Project Folder" option.

6-) Click OK.

7-) One the rename is complete, the IDE will also rename the context.xml for you.

8-) Bug reproduced, new context xml appears like so:

<Context path="/TestCase">
  <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" logAbandoned="true" maxActive="100" maxIdle="30"
maxWait="10000" name="jdbc/glc" password="TEST&gt;&gt;" removeAbandoned="true" removeAbandonedTimeout="60"
type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/test?autoReconnect=true" username="test"/>
</Context>

I hope this helps, just something I noticed as I was renaming my project.
Comment 6 David Konecny 2009-04-14 00:04:37 UTC
Thanks. I can reproduce it now. It is a defect in Tomcat server plugin which update context.xml. Lowering priority as
you can workaround this by hand.
Comment 7 Jindrich Sedek 2009-04-15 16:44:29 UTC
I belive this issue is no more incomplete.
Comment 8 Petr Hejl 2009-04-16 11:52:07 UTC
Such values in attributes should be escaped. So NetBeans isn't doing anything wrong. I've just tested the whole thing
and I can access the database.

So in case you really can't access it - it has to be a bug in reading xml compliant file in tomcat. Not a P2; perhaps no
issue at all.
Comment 9 Petr Hejl 2009-06-30 14:23:37 UTC
See previous comment.