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 98703 - javax.xml.transform.TransformerConfigurationException from web project
Summary: javax.xml.transform.TransformerConfigurationException from web project
Status: RESOLVED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Roderico Cruz
URL:
Keywords: RANDOM
: 98704 99552 (view as bug list)
Depends on:
Blocks: 98942
  Show dependency tree
 
Reported: 2007-03-22 16:56 UTC by _ potingwu
Modified: 2007-04-23 12:32 UTC (History)
10 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Exceptions I got (2.59 KB, text/plain)
2007-03-22 16:57 UTC, _ potingwu
Details
Sometime I got different but similar exceptions (3.63 KB, application/octet-stream)
2007-03-22 16:58 UTC, _ potingwu
Details
When NetBeans web JSF framework add more libraries (3.08 KB, text/plain)
2007-03-22 20:37 UTC, _ potingwu
Details
I put the dumpStack into GeneratedFilesHelper:generateBuildScriptFromStylesheet() method (17.80 KB, text/xml)
2007-03-23 11:24 UTC, Milan Kuchtiak
Details
Exception thrown when the fix was applied (2.19 KB, text/plain)
2007-03-23 21:47 UTC, Radko Najman
Details
Exception thrown with the old implemantation of WebProjectClassPathExtender (3.24 KB, text/plain)
2007-03-27 15:52 UTC, Radko Najman
Details
org-netbeans-modules-web-project.jar (1.51 MB, application/octet-stream)
2007-03-28 17:21 UTC, Milan Kuchtiak
Details
org-netbeans-modules-websvc-jaxwsmodel.jar (230.27 KB, application/octet-stream)
2007-03-28 17:23 UTC, Milan Kuchtiak
Details
regenerate dialog (27.56 KB, image/jpeg)
2007-03-30 17:07 UTC, Radko Najman
Details
Exception thrown while investigating issue #99552 (4.55 KB, text/plain)
2007-03-30 17:08 UTC, Radko Najman
Details
Diff file of build-impl.xsl for fixing 98703 (29.49 KB, text/xml)
2007-04-02 09:03 UTC, Roderico Cruz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ potingwu 2007-03-22 16:56:42 UTC
After update to the latest NetBeans binary (build 200703211900), Visual Web
framework is no longer working! It got the attached exceptions.

To reproduce it,
1. download Visual Web zip files or pack installer from
http://clue.sfbay.sun.com//kits/rave/visualweb/Build070321_13/ under NetBeans
binary build 200703211900.
2. Create a visual web project by, File -> New Project -> Web -> Web Application
-> (project name, server, ...) -> (Next) -> Under Frameworks page, check 'Visual
Web JavaServer Faces' -> (Finish)
Comment 1 _ potingwu 2007-03-22 16:57:43 UTC
Created attachment 39831 [details]
Exceptions I got
Comment 2 _ potingwu 2007-03-22 16:58:20 UTC
Created attachment 39832 [details]
Sometime I got different but similar exceptions
Comment 3 _ potingwu 2007-03-22 17:28:26 UTC
An easier way to debug visualweb under NetBeans workspace:
Under NetBeans source root,
1. cvs co visualwebstandard
2. cd visualweb/ravebuild
3. ant
4. cd rave/build
5. nb.exe

Then debugging both NetBeans and Visualweb will be simple.
Comment 4 _ potingwu 2007-03-22 20:34:36 UTC
Milan Kuchtiak wrote:
> Seems that libraries are added to the project and probably Project is being
> saved multiple times.
> Please, can you describe the steps to reproduce. 

I finally can reproduce this fatal showstopper by creating a NetBeans web
project with JavaServer Faces framework enabled.

When adding framework, Visual Web framework needs to add several libraries to
the project not like the other lightweight framework that only 1 or 2 libraries
are involved. Therefore, I make the NetBeans web project 'JavaServer Faces'
framework add more libraries to reproduce this symptom.

I.e., I modify org.netbeans.modules.web.jsf.JSFFrameworkProvider.extend() to:
...
                                try {
                                    cpExtender.addLibrary(jsfLibrary);
                                    cpExtender.addLibrary(jsfLibrary);
                                    Library jstlLibrary =
LibraryManager.getDefault().getLibrary("jstl11");
                                    if (jstlLibrary != null){
                                        cpExtender.addLibrary(jstlLibrary);
                                        cpExtender.addLibrary(jstlLibrary);
                                    }
...

Then when I create a NetBeans web project + JSF framework, I got the same fatal
error. (exceptions attached)
Comment 5 _ potingwu 2007-03-22 20:37:18 UTC
Created attachment 39838 [details]
When NetBeans web JSF framework add more libraries
Comment 6 Lukas Jungmann 2007-03-22 21:38:33 UTC
*** Issue 98704 has been marked as a duplicate of this issue. ***
Comment 7 Radko Najman 2007-03-23 09:42:34 UTC
I can reproduce it only with JDK 1.5, with 1.6 it works fine.
Comment 8 Milan Kuchtiak 2007-03-23 11:12:53 UTC
Seems that WebProjectClasspathModifier calls the ProjectManager.saveProject
multiple times when a web project is being created.

We did nothing with GeneratedFilesHelper recently.
Comment 9 Milan Kuchtiak 2007-03-23 11:24:46 UTC
Created attachment 39863 [details]
I put the dumpStack into GeneratedFilesHelper:generateBuildScriptFromStylesheet() method
Comment 10 Radko Najman 2007-03-23 14:43:43 UTC
I think the problem is more complicated. The project is saved very often because
of the fix for issue #56140. It is bad and it should be optimized.
But the real problem is in my opinion in refreshing build script when project is
saved
(org.netbeans.modules.web.project.WebProject$ProjectXmlSavedHookImpl.projectXmlSaved(WebProject.java:634)).
If JAX-WS needs to refresh it, it should be done only when it is necessary. I
don't see any reason to do it when a project is created, library added or
library modified.
Comment 11 Radko Najman 2007-03-23 21:45:31 UTC
Not a real fix but the problem should not appear so often, hopefully - little
bit optimized project saving and refreshing build script postponed about two
seconds. Hopefully this can at least little bit help for milestone 8 but need to
be reviewed and fixed by a better way in milestone 9.

I wouldn't say the problem is related to WebProjectClassPathModifier. It was
implemented on March 14 and the problem appeared on March 21 when changes in
GeneratedFilesHelper were done. WebProjectClassPathModifier do almost the same
as previous version of WebProjectClassPathExtender.
Rico, could you verify that there is no problem in GeneratedFilesHelper, please?
I'm attaching the exception thrown when this fix was applied.


Checking in classpath/WebProjectClassPathModifier.java;
/cvs/web/project/src/org/netbeans/modules/web/project/classpath/WebProjectClassPathModifier.java,v
 <--  WebProjectClassPathModifier.java
new revision: 1.2; previous revision: 1.1
done
Checking in WebProject.java;
/cvs/web/project/src/org/netbeans/modules/web/project/WebProject.java,v  <-- 
WebProject.java
new revision: 1.108; previous revision: 1.107
done
Comment 12 Radko Najman 2007-03-23 21:47:23 UTC
Created attachment 39897 [details]
Exception thrown when the fix was applied
Comment 13 _ potingwu 2007-03-26 17:12:36 UTC
> Rico, could you verify that there is no problem in GeneratedFilesHelper, please?

Yes, please! Sanity tests in visualweb build are still seeing this exception
almost every build.
Comment 14 Radko Najman 2007-03-27 15:50:12 UTC
I locally rollbacked the changes related to WebProjectClassPathModifier and I'm
still able to reproduce this problem with the old implementation of
WebProjectClassPathExtender. That's why I believe the problem is related to the
changes in org.netbeans.modules.websvc.api.jaxws.project.GeneratedFilesHelper
which were done on March 21.

Attaching a stack trace without WebProjectClassPathModifier.
Comment 15 Radko Najman 2007-03-27 15:52:54 UTC
Created attachment 40041 [details]
Exception thrown with the old implemantation of WebProjectClassPathExtender
Comment 16 _ potingwu 2007-03-27 16:57:16 UTC
> That's why I believe the problem is related to the
> changes in org.netbeans.modules.websvc.api.jaxws.project.GeneratedFilesHelper
> which were done on March 21.

Yes, I can confirm that the visualweb sanity test started to fail (~90% failed
because of this issue) exactly after importing NetBeans March 21 binary.
Comment 17 Radko Najman 2007-03-28 16:07:36 UTC
One more comment: regarding to issue #98704 (which was closed as a duplicate of
this issue) and regarding to my investigation this issue is random when creating
web project just with JSF or Struts framework.
Comment 18 Petr Blaha 2007-03-28 16:15:39 UTC
Hi Potingwu, are you able to reproduce the bug in 100% on more computers and
also manually? In case the bug isn't 100% reproducible it seems like no P1 since
there are no data lost and we will not assume the bug as stopper in Milestone 8.
Comment 19 Ch Nguyen 2007-03-28 16:28:41 UTC
PoTing is out of the office today.  The issue can be reproducible manually
intermittently but quite frequent.  Our QE team is going to verify (again) if
this bug is still a showstopper since Po-Ting had put in a workaround for it. 
We'll let you know.
Comment 20 Milan Kuchtiak 2007-03-28 17:14:22 UTC
I made some changes in web project and webswc/jaxwsmodel.
Please test this patch.
Comment 21 Milan Kuchtiak 2007-03-28 17:21:11 UTC
Created attachment 40097 [details]
org-netbeans-modules-web-project.jar
Comment 22 Milan Kuchtiak 2007-03-28 17:23:36 UTC
Created attachment 40098 [details]
org-netbeans-modules-websvc-jaxwsmodel.jar
Comment 23 _ potingwu 2007-03-28 18:11:26 UTC
I'm still seeing this exception after applying your patch! I'm not sure whether
it's less frequently or not. But after few project creations, I have seen it 2
or 3 times.
Comment 24 Roderico Cruz 2007-03-28 18:17:24 UTC
Po-Ting, kindly describe the steps to reproduce this. I followed the steps
described earlier in this bug but have been unsuccessful in reproducing it. 
Thanks. Rico
Comment 25 _ potingwu 2007-03-28 18:22:30 UTC
Please see my reproduce steps at "Thu Mar 22 19:34:36". You can reproduce it
easier when the framework adding more libraries. Therefore, I add more libraries
in NetBeans JSF framework and make the exceptions easier to appear.

I.e., I modify org.netbeans.modules.web.jsf.JSFFrameworkProvider.extend() to:
...
                                try {
                                    cpExtender.addLibrary(jsfLibrary);
                                    cpExtender.addLibrary(jsfLibrary);
                                    Library jstlLibrary =
LibraryManager.getDefault().getLibrary("jstl11");
                                    if (jstlLibrary != null){
                                        cpExtender.addLibrary(jstlLibrary);
                                        cpExtender.addLibrary(jstlLibrary);
                                    }
...
Comment 26 Roderico Cruz 2007-03-28 21:29:40 UTC
Found this: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5056688
Comment 27 Roderico Cruz 2007-03-29 00:10:57 UTC
This has been removed from the showstopper list see:
http://www.netbeans.org/issues/show_bug.cgi?id=99045.

Also, this does not happen in JDK 1.6.
The xsl script was changed significantly on March 21. From the explanation in 
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5056688, there was a problem
in JDK 1.5 where large xsl scripts exhibited this problem. This may explain why
this does not happen in JDK 1.6.
Comment 28 Radko Najman 2007-03-30 16:57:31 UTC
*** Issue 99552 has been marked as a duplicate of this issue. ***
Comment 29 Radko Najman 2007-03-30 17:06:30 UTC
I closed issue #99552 as a duplicate of this issue. While investigating that
issue I got the attached exception and build-impl.xml regenerate dialog was
shown. Created project contained an empty build-impl.xml.
Comment 30 Radko Najman 2007-03-30 17:07:48 UTC
Created attachment 40206 [details]
regenerate dialog
Comment 31 Radko Najman 2007-03-30 17:08:43 UTC
Created attachment 40207 [details]
Exception thrown while investigating issue #99552
Comment 32 Roderico Cruz 2007-03-30 17:13:47 UTC
Radko, cud not find any attached file. Was it the same transformer error as
previously described or is it a different error? Kindly attach the exception
that you got. Thanks.
Comment 33 _ potingwu 2007-03-30 17:31:15 UTC
Since yesterday, 03/29/2007, this issue becomes more serious! It's not only
dumping the exceptions, but also display >2 dialogs showing 'build-impl.xml
regenerate'. Then the created project contained an empty build-impl.xml.

As I seen from the comments that this may be a JDK bug. But we should try to not
trigger it as we did before 03/21. Thanks!
Comment 34 Roderico Cruz 2007-03-30 17:54:36 UTC
The build-impl.xsl file of the web project was modified again which made it an
even larger file. Looking at this closely and will let you know.
Comment 35 Nam Nguyen 2007-03-31 17:31:16 UTC
This is what I did to confirm the "size" theory (and clear particulars from REST
script section):

(1) I tried removing the 25 lines that I added on 3/30.  This does make the
IOException go away.  

(2) Then I added about 30 line of dummy:  
    <echo>Fooling around with size ${{what.is.size.limit}}</echo>
in some target.  This recreate the IOException.

Rico is trying TransformationFactory option to not inline templates.  If this
does not work, I think we have other options:
#1: temporary solution: clean up build-impl.xsl to reduce size.
#2: partition the xsl using import mechanism.  I guess the build script
extension framework is not ready for M9?
Comment 36 Roderico Cruz 2007-04-02 08:51:19 UTC
Fixed. 
The problem was that the main template became very large. Since each template in
the xsl script was generated into Java methods, it came to a point where the
generated Java method for the main template exceeded the 64K limit for methods
in the JVM. 
I  fixed this by refactoring the build-impl.xsl script to reduce the size of the
main template. The script for calling wsimport now invokes a template which
takes care of the different permutations of the options passed in to wsimport,
i.e., jaxws 2.1 vs. 2.0, jsr109 vs. non-jsr109, etc.
Comment 37 Roderico Cruz 2007-04-02 08:54:39 UTC
btw, xalan in JDK 1.5 was not inlining all the templates into one method. It was
1 template to 1 method. The problem was that the method exceeded 64K. So passing
the inlining attribute to the TransformationFactory was not the solution.
Comment 38 Roderico Cruz 2007-04-02 09:03:35 UTC
Created attachment 40242 [details]
Diff file of build-impl.xsl for fixing 98703
Comment 39 Ch Nguyen 2007-04-02 17:06:24 UTC
I'm glad that this is now fixed.  In which NB build that has the fix?  Thanks.
Comment 40 Roderico Cruz 2007-04-02 18:30:59 UTC
This was fixed around 1 a.m. April 2 PST, so any build after that will have this
fix.
Comment 41 Andrei Badea 2007-04-04 09:41:50 UTC
Reopening because of the following comment I sent to cvs@web.netbeans.org and to
which I got no reply:

Not very well visible from the text diff, but you have:

<xsl:variable name="jaxws21_var">
  <xsl:choose>
    <xsl:when test="$jaxwsversion = 'jaxws21lib'">
      <xsl:value-of select="true()"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="false()"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:variable>

which looks overcomplicated. Can't you just

<xsl:variable name="jaxws21_var" select="$jaxwsversion = 'jaxws21lib'">

? Also, in the invokeWsimport template, which the jaxws21_var variable is passed
to, you have:

<xsl:if test="$isJaxws21 = 'true' and $isJSR109 = 'true'">

Since these variables contain boolean values, can't you just

<xsl:if test="$isJaxws21 and $isJSR109">

? Why is the conversion to string necessary?
Comment 42 Roderico Cruz 2007-04-16 19:40:38 UTC
OK will implement these improvements. Thanks.
Comment 43 Lukas Jungmann 2007-04-18 13:38:31 UTC
Original issue is fixed => P3