https://bugzilla.novell.com/show_bug.cgi?id=221420
Summary: org.xml.sax.driver property not carrying to thread when using Sun's JVM Invoke Interface Product: openSUSE 10.2 Version: Beta 1 Platform: i386 OS/Version: Other Status: NEW Severity: Critical Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jluciani@novell.com QAContact: qa@suse.de
My program executes a java class from a native thread after attaching the thread to the Sun 1.5 JVM, this results in the following exception:
Exception in thread "Thread-0" javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:104) at org.apache.axis.utils.XMLUtils.getDOMFactory(XMLUtils.java:221) at org.apache.axis.utils.XMLUtils.access$000(XMLUtils.java:75) at org.apache.axis.utils.XMLUtils$ThreadLocalDocumentBuilder.initialValue(XMLUtils.java:98) at java.lang.ThreadLocal$ThreadLocalMap.getAfterMiss(ThreadLocal.java:374) at java.lang.ThreadLocal$ThreadLocalMap.get(ThreadLocal.java:347) at java.lang.ThreadLocal$ThreadLocalMap.access$000(ThreadLocal.java:225) at java.lang.ThreadLocal.get(ThreadLocal.java:127) at org.apache.axis.utils.XMLUtils.getDocumentBuilder(XMLUtils.java:237) at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:337) at org.apache.axis.message.SOAPDocumentImpl.<init>(SOAPDocumentImpl.java:70) at org.apache.axis.SOAPPart.<init>(SOAPPart.java:1020) at org.apache.axis.Message.setup(Message.java:377) at org.apache.axis.Message.<init>(Message.java:246) at com.novell.casa.authtoksvc.AuthToken.<init>(AuthToken.java:158) at com.novell.casa.authtoksvc.AuthToken.validate(AuthToken.java:318)
This exception does not occur if I execute the java class from the main thread.
This exception normally occurs if the org.xml.sax.driver property is not set correctly. This leads me to believe that the issue is related to it.
Please note that the same code works without any issue when executed using IBM's JVM.
I hava attached a tar file with a sample test program and supporting files which demonstrate the problem. The source code is in the file: server-sun.cpp. To run the program execute ./run_test.sh.
https://bugzilla.novell.com/show_bug.cgi?id=221420
------- Comment #1 from jluciani@novell.com 2006-11-15 11:14 MST ------- Created an attachment (id=105487) --> (https://bugzilla.novell.com/attachment.cgi?id=105487&action=view) Test application and supporting files that shows the problem.
https://bugzilla.novell.com/show_bug.cgi?id=221420
aj@novell.com changed:
What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |dbornkessel@novell.com |screening@forge.provo.novell| |.com | Severity|Critical |Major
https://bugzilla.novell.com/show_bug.cgi?id=221420
dbornkessel@novell.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED
------- Comment #2 from dbornkessel@novell.com 2006-11-16 01:29 MST ------- Hi. I am not sure, but is this the same problem described in: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4489399 ? Can you confirm that? Not sure whether this is a real bug. Regards, Daniel
https://bugzilla.novell.com/show_bug.cgi?id=221420
dbornkessel@novell.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |jluciani@novell.com
https://bugzilla.novell.com/show_bug.cgi?id=221420
------- Comment #3 from jluciani@novell.com 2006-11-16 09:16 MST ------- Hi Daniel,
I looked at the bug referenced above and I do not believe is related. There are a couple of things with regards to that bug that do not seem right.
First issue with referenced bug: The submitted code has an issue that could be the source of the problem (the code uses the jclass and jmethodID objects obtained using the JNIEnv object created from the main thread when calling into the JNIEnv object created in the worker thread, my understanding is that the code should call into a JNIEnv object using objects that it obtained from it).
Second issue with referenced bug: The response from the Sun support engineer "that since thread in question was created by c++ and not java, the thread does not have any information about java context which a java create thread might have" does not agree with the Sun's documentation (http://java.sun.com/j2se/1.4.2/docs/guide/jni/spec/invocation.html) which states that "The JNI interface pointer (JNIEnv) is valid only in the current thread. Should another thread need to access the Java VM, it must first call AttachCurrentThread() to attach itself to the VM and obtain a JNI interface pointer. Once attached to the VM, a native thread works just like an ordinary Java thread running inside a native method. The native thread remains attached to the VM until it calls DetachCurrentThread() to detach itself."
Thanks for your help, Juan Carlos
https://bugzilla.novell.com/show_bug.cgi?id=221420
jluciani@novell.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|jluciani@novell.com |
https://bugzilla.novell.com/show_bug.cgi?id=221420#c4
daniel bornkessel dbornkessel@novell.com changed:
What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|dbornkessel@novell.com |bnc-team-java@forge.provo.novell.com Status|ASSIGNED |NEW
--- Comment #4 from daniel bornkessel dbornkessel@novell.com 2007-07-03 08:48:03 MST --- assigning to java team ...
https://bugzilla.novell.com/show_bug.cgi?id=221420
User anosek@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=221420#c5
Ales Nosek anosek@novell.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |anosek@novell.com Status|NEW |RESOLVED Resolution| |UPSTREAM
--- Comment #5 from Ales Nosek anosek@novell.com 2008-09-24 08:09:06 MDT --- Juan, I'm very sorry but we are not able to help you with this. We have no java expert knowledge. We release updates of Java packages coming from Sun. Maybe this was/will be fixed sometimes.