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 59943 - Xml TransformerFactory broken when running inside embedded tomcat
Summary: Xml TransformerFactory broken when running inside embedded tomcat
Status: CLOSED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Tomcat (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Sherold Dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-14 16:16 UTC by tomd
Modified: 2006-03-24 13:03 UTC (History)
0 users

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 tomd 2005-06-14 16:16:21 UTC
Calling javax.xml.transform.TransformerFactory.newInstance() when running inside
the embedded tomcat throws the following exception:

javax.xml.transform.TransformerFactoryConfigurationError: Provider
org.apache.xalan.processor.TransformerFactoryImpl not found
	javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
	org.apache.jsp.index_jsp._jspService(index_jsp.java:65)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)

That's NOT the default TransformerFactory for my platform. If I create a
standard java application project and run it from inside the IDE, I get a
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl instance. I
tested it using jython from outside the IDE as well. 

Running under JDK 1.5.0 btw.

Steps to reproduce with NB4.1:
 - Create a new web project.
 - Add this to index.jsp: <%=
javax.xml.transform.TransformerFactory.newInstance() %>
 - Run project, observe stack trace.

I read up on the TransformerFactory.newInstance() method. I can verify that the
"javax.xml.transform.TransformerFactory" system property is not set, there is no
lib/jaxp.properties file in the jre directory, and doing a getResource() for 
"META-INF/services/javax.xml.transform.TransformerFactory" returns null. This is
a standard JDK 1.5.0 with standard Netbeans 4.1 installed.

I originally encountered the error trying to use DWR (https://dwr.dev.java.net/)
in a web project, and this bug is preventing me from doing so. I might plonk a
xalan jar into the project's lib directory as a workaround while the bug remains
present, as that is all I can think of to continue at this point.
Comment 1 Sherold Dev 2005-06-14 18:21:27 UTC
This seems to be caused by the j2se 1.4 compatibility pack.

If you do not plan to use bundled tomcat with j2se 1.4 you can remove it as a
work-around until we figure out a better way how to fix it.

You can do so by removing the following files:

$NB_INSTALL_DIR/enterprise1/jakarta-tomcat-5.5.7/bin/jmx.jar
$NB_INSTALL_DIR/enterprise1/jakarta-tomcat-5.5.7/common/endorsed/xercesImpl.jar
$NB_INSTALL_DIR/enterprise1/jakarta-tomcat-5.5.7/common/endorsed/xml-apis.jar

TM -> 4.2.
Comment 2 tomd 2005-06-15 05:36:26 UTC
Yup, removing those files fixed it, thanks for the workaround.
Comment 3 Sherold Dev 2005-10-13 17:17:24 UTC
F.

Checking in external/build.xml;
/cvs/tomcatint/external/build.xml,v  <--  build.xml
new revision: 1.29; previous revision: 1.28
done
Checking in external/jakarta-tomcat-5.5.9.zip;
/cvs/tomcatint/external/jakarta-tomcat-5.5.9.zip,v  <--  jakarta-tomcat-5.5.9.zip
new revision: 1.2; previous revision: 1.1
done
Checking in tomcat5/src/org/netbeans/modules/tomcat5/ide/StartTomcat.java;
/cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/ide/StartTomcat.java,v 
<--  StartTomcat.java
new revision: 1.78; previous revision: 1.77
done
RCS file:
/cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/util/EditableProperties.java,v
done
Checking in tomcat5/src/org/netbeans/modules/tomcat5/util/EditableProperties.java;
/cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/util/EditableProperties.java,v
 <--  EditableProperties.java
initial revision: 1.1
done
Checking in tomcat5/src/org/netbeans/modules/tomcat5/util/Utils.java;
/cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/util/Utils.java,v  <-- 
Utils.java
new revision: 1.3; previous revision: 1.2
done
Comment 4 Jaroslav Pospisil 2005-12-08 13:59:48 UTC
VERIFIED