You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2010/05/11 16:05:04 UTC

DO NOT REPLY [Bug 49271] New: xslt task no longer heeds classpath property

https://issues.apache.org/bugzilla/show_bug.cgi?id=49271

           Summary: xslt task no longer heeds classpath property
           Product: Ant
           Version: 1.8.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: deBakker_Bas@emc.com


The xslt task no longer heeds the classpath property. The reason is that in
XSLTProcess.java, the resolveProcessor method does not (in the default case)
call the loadClass method and therefore the thread context class loader is not
set.

This is a regression from 1.8.0.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49271] xslt task no longer heeds classpath attribute

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49271

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from Stefan Bodewig <bo...@apache.org> 2010-10-26 09:00:39 EDT ---
I think it is fixed again and assume Jesse can live with the current trunk
code.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49271] xslt task no longer heeds classpath attribute

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49271

Jesse Glick <jg...@netbeans.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jglick@netbeans.org

--- Comment #3 from Jesse Glick <jg...@netbeans.org> 2010-05-11 14:14:56 EDT ---
The fix looks wrong to me. TraXLiaison is part of primary Ant sources, so we
should not be loading *it* using some special class loader - unnecessary and
risks weird CCEs.

The use of getContextClassLoader in TraXLiaison.getFactory is also strange,
because it relies on some undocumented side effects from the task. It seems
XSLTProcess sets and restores the thread's CCL - but it only sets it in
loadClass. 943143 works only because loadClass is called at all - it could
throw away the result! Also, using Class.forName(String) from
TraXLiaison.getFactory is probably unnecessary and wrong.

Perhaps the proper fix is as follows:

1. Back out 943143; as part of assuming JDK 1.4+ I intentionally loaded
TraXLiaison directly, since it does not depend on anything outside the JRE.

2. Simplify TraXLiaison.getFactory to not call Class.forName(String). It can
continue to use TransformerFactory.newInstance for an unspecified factory; or
Class.forName with CCL on a specified factory. (Note that if you are bothering
to specify a classpath for the processor, you should very likely be specifying
the factory too - else how do you know for sure what you are getting? You could
be getting some unrelated factory that happened to be elsewhere in the
classpath.)

3. Make XSLTProcess.execute always create loader and call
setThreadContextLoader in case classpath != null; do not do this logic in
loadClass.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49271] xslt task no longer heeds classpath attribute

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49271

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |1.8.2

--- Comment #2 from Stefan Bodewig <bo...@apache.org> 2010-05-11 11:17:19 EDT ---
fixed with svn revision 943143

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 49271] xslt task no longer heeds classpath attribute

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49271

--- Comment #9 from Jackie Rosen <ja...@hushmail.com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.

-- 
You are receiving this mail because:
You are the assignee for the bug.

DO NOT REPLY [Bug 49271] xslt task no longer heeds classpath attribute

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49271

bas@x-hive.com <de...@emc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|xslt task no longer heeds   |xslt task no longer heeds
                   |classpath property          |classpath attribute

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49271] xslt task no longer heeds classpath attribute

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49271

bas@x-hive.com <de...@emc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |deBakker_Bas@emc.com

--- Comment #1 from bas@x-hive.com <de...@emc.com> 2010-05-11 10:16:01 EDT ---
As a workaround, you can explicitly specify
processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
as an attribute of the xslt task.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49271] xslt task no longer heeds classpath attribute

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49271

--- Comment #5 from Stefan Bodewig <bo...@apache.org> 2010-08-05 14:50:57 EDT ---
svn revision 982729 is along the lines of point 1 and 3 of comment #3

I extracted the loader creation into a method that is invoked from execute as
well as loadClass since loadClass may be invoked via the protected getLiaison
method and there wouldn't be any guarantee that execute has been called at all.

I've skipped point 2 since I don't think falling back to Class.forName(string)
likely doesn't do any harm (we shouldn't be getting there anyway).

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49271] xslt task no longer heeds classpath attribute

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49271

Alex Hvostov <al...@valuadder.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alex@valuadder.com

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49271] xslt task no longer heeds classpath attribute

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49271

--- Comment #7 from Jesse Glick <jg...@netbeans.org> 2010-10-26 12:43:00 EDT ---
Looked OK last I checked.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49271] xslt task no longer heeds classpath attribute

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49271

Jesse Glick <jg...@netbeans.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hoylen@hoylen.com

--- Comment #8 from Jesse Glick <jg...@netbeans.org> 2010-11-18 10:03:36 EST ---
*** Bug 50289 has been marked as a duplicate of this bug. ***

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 49271] xslt task no longer heeds classpath attribute

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49271

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #4 from Stefan Bodewig <bo...@apache.org> 2010-05-17 05:29:30 EDT ---
I agree with all of your points.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.