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 62448 - Exception 'You need to have xerces.jar available to use XMLUtil.write under JDK 1.4' is thrown during deployment of J2EE app
Summary: Exception 'You need to have xerces.jar available to use XMLUtil.write under J...
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Infrastructure (show other bugs)
Version: 5.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: Sherold Dev
URL:
Keywords:
: 62917 (view as bug list)
Depends on:
Blocks: 62440
  Show dependency tree
 
Reported: 2005-08-17 09:07 UTC by Petr Blaha
Modified: 2005-09-05 10:01 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stack trace (2.27 KB, text/plain)
2005-08-17 09:09 UTC, Petr Blaha
Details
xerces (5.70 KB, text/plain)
2005-08-20 15:48 UTC, Sherold Dev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Blaha 2005-08-17 09:07:46 UTC
[build 20050816]
Configuration: jdk 1.4.2
Steps to reproduce:
1) create J2EE app
2) add session bean in EJB module
3) deploy J2EE app
ERROR: get exception java.io.IOException: You need to have xerces.jar available
to use XMLUtil.write under JDK 1.4: java.lang.ClassNotFoundException:
org.apache.xml.serialize.XMLSerializer
Comment 1 Petr Blaha 2005-08-17 09:09:18 UTC
Created attachment 23970 [details]
stack trace
Comment 2 Petr Blaha 2005-08-17 09:18:33 UTC
The issue is more serious, I can't redeploy project. Changing priority to P1.
Deployment doesn't work for NetBeans that runs on jdk 1.4.2.
Comment 3 Radko Najman 2005-08-17 15:06:20 UTC
I was able to reproduce this problem with internal Tomcat as well. It seems to
be xml module issue, not sunappserver. Reassigning to xml.
Petre, could you look at it please?  I was told you implemented a patch for
xerces so you probably know what the problem can be.
Comment 4 Petr Pisl 2005-08-18 07:54:43 UTC
Why do you thing, that this is xml issue.  I thing, that it can be problem with
classloaders. Maybe the classloader is not able to find out the right xerces.  

When you look through the exception, you can see, that there is running an ant
task, so you can check what is on the classpath during running the task.
Comment 5 Martin Schovanek 2005-08-18 13:25:16 UTC
It is Q-build 200508161800 stopper. Please fix it ASAP.
Comment 6 Sherold Dev 2005-08-18 13:25:34 UTC
This issue is at least one week old, first I will need to find out when it was
dragged in.

TM -> 4.2.
Comment 7 Sherold Dev 2005-08-20 15:26:39 UTC
It seems like this issue is caused by recent changes in XMLUtil class. When
running on jdk 1.4, this class is trying to load some xerces classes, namely
org.apache.xml.serialize.XMLSerializer and org.apache.xml.serialize.OutputFormat
using the context class loader of the current thread. The problem is that in the
above mentioned use case, this context class loader is
org.apache.tools.ant.module.bridge.AntBridge$MaskedClassLoader, which does not
have xerces on its class path.

Reassigning to Jesse.
Comment 8 Sherold Dev 2005-08-20 15:46:42 UTC
here is another usecase for reproducing this issue:

start ide on jdk 1.4, register sun appserver, try to create an ejb project
Comment 9 Sherold Dev 2005-08-20 15:48:30 UTC
Created attachment 24103 [details]
xerces
Comment 10 Jesse Glick 2005-08-22 21:52:57 UTC
You should be able to set the context class loader from e.g. Deploy.execute to
whatever class loader you have that includes Xerces, e.g.
Lookup.default.lookup(ClassLoader).

Don't know anything about the second stack trace; works for other project types OK.
Comment 11 Sherold Dev 2005-08-23 10:53:22 UTC
Fixed in trunk.

Jesse, thank you for your hint. The second stack trace was probably caused by my
ide being in an inconsistent state, I can't reproduce it anymore.

Checking in antsrc/org/netbeans/modules/j2ee/ant/Deploy.java;
/cvs/j2eeserver/ant/antsrc/org/netbeans/modules/j2ee/ant/Deploy.java,v  <-- 
Deploy.java
new revision: 1.19; previous revision: 1.18
done
Comment 12 Sherold Dev 2005-08-23 11:19:45 UTC
Fixed also in the QBE200508161800 branch.
Comment 13 Petr Blaha 2005-08-23 14:29:23 UTC
verified in continual build 20050823-1120. I was able to deploy web module to
Sun App server.
Comment 14 Nitya Doraisamy 2005-08-23 17:14:19 UTC
Verified for enterprise app, ejb and web modules
Comment 15 Petr Blaha 2005-08-24 09:45:00 UTC
*** Issue 62917 has been marked as a duplicate of this issue. ***