eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
387 stars 145 forks source link

JAXB unmarshaller throws "no implementation of regex was found" #11881

Closed glassfishrobot closed 14 years ago

glassfishrobot commented 14 years ago

JAXB generated schema unmarshalling fails on Glassfish v3 for AnyURIType with the following exception:

java.lang.Error: no implementation of regexp was found. at com.sun.msv.datatype.xsd.regex.RegExpFactory.createFactory(RegExpFactory.java:28) at com.sun.msv.datatype.xsd.AnyURIType.createRegExp(AnyURIType.java:175) at com.sun.msv.datatype.xsd.AnyURIType.(AnyURIType.java:128) at sun.misc.Unsafe.ensureClassInitialized(Native Method) at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25) at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122) at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918) at java.lang.reflect.Field.getFieldAccessor(Field.java:899) at java.lang.reflect.Field.getLong(Field.java:528) at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1614) at java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52) at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:425) at java.security.AccessController.doPrivileged(Native Method) at java.io.ObjectStreamClass.(ObjectStreamClass.java:413) at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:310) at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:547) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at com.sun.xml.bind.unmarshaller.DatatypeDeserializer.deserialize(DatatypeDeserializer.java:56) at com.sun.samples.jaxb.impl.TokenAssertionTypeImpl.(Unknown Source) at com.sun.samples.jaxb.ObjectFactory.createX509TokenElement(Unknown Source) at com.sun.samples.Test.createX509TokenElement(Unknown Source) at org.apache.jsp.jaxb_002dtest_jsp._jspService(jaxb_002dtest_jsp.java from :65)

Same thing works well on Glassfish v2.x and earlier versions.

I am uploading a zip file that has a sample test case.

1. unzip the test.zip

2. ant (from a directory where this is extracted)

3. Deploy the war file from built/dist/test.war

4. Access http://:/test/jaxb-test.jsp

Btw, this is for OpenSSO release.

Environment

Operating System: All Platform: All

Affected Versions

[V3]

glassfishrobot commented 6 years ago
glassfishrobot commented 14 years ago

@glassfishrobot Commented mallas@java.net said: Created an attachment (id=4352) test zip file

glassfishrobot commented 14 years ago

@glassfishrobot Commented bhaktimehta said: Martin pls can you look in this. Most likely I suspect the packages may not be getting exported.

glassfishrobot commented 14 years ago

@glassfishrobot Commented snajper said: Yes, I've been looking at it and it seems the msv/xsdlib packages are not correctly imported/exported. Btw, my nick is 'snajper' ;O)

glassfishrobot commented 14 years ago

@glassfishrobot Commented snajper said: First part of the issue is that jdk regexp loader in xsdlib/msv source is defined to load class from apache.xerces.impl.xpath.regex.RegularExpression, whereas that should definitely be com.sun.org.apache.xerces.internal.impl.xpath.regex.RegularExpression. That fixes standalone run of your test (other way/workaround to fix standalone run is to add xercesImpl to classpath). This does not help in the GF run, because the app does not seem to be able to import the package. I'll ask Sahoo/Bhakti what are the osgi possibilities there.

glassfishrobot commented 14 years ago

@glassfishrobot Commented snajper said: Created an attachment (id=4355) Patched files for fix verification

glassfishrobot commented 14 years ago

@glassfishrobot Commented snajper said: Please find the attached zip file with patched jaxb bundles and felix config.properties which exports the com.sun.org.apache.xerces.internal.impl.xpath.regex package from JDK. I didn't get hold of Sahoo yet so this might not be final solution, but please verify if this fixes your issue.

glassfishrobot commented 14 years ago

@glassfishrobot Commented snajper said: Hi, please see fix2.zip which contains a more robust solution and does not necessarily require the felix config.properties change: in case the internal regex package is not exported by osgi container, the code defers to jdk regex api. Please verify - I'm not able to proceed without verification.

glassfishrobot commented 14 years ago

@glassfishrobot Commented snajper said: Created an attachment (id=4356) Fix which does not require felix config.properties changes

glassfishrobot commented 14 years ago

@glassfishrobot Commented mallas@java.net said: Thanks Martin. Verified that the fix is working with my test program and as well as with OpenSSO binaries. Please let us know which build of GF we should be using for official testing.

glassfishrobot commented 14 years ago

@glassfishrobot Commented snajper said: Fixed in Metro 2.0.1.

glassfishrobot commented 14 years ago

@glassfishrobot Commented File: fix2.zip Attached By: snajper

glassfishrobot commented 14 years ago

@glassfishrobot Commented File: fixver.zip Attached By: snajper

glassfishrobot commented 14 years ago

@glassfishrobot Commented File: test.zip Attached By: mallas@java.net

glassfishrobot commented 14 years ago

@glassfishrobot Commented Was assigned to snajper

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA GLASSFISH-11881

glassfishrobot commented 14 years ago

@glassfishrobot Commented Reported by mallas@java.net

glassfishrobot commented 14 years ago

@glassfishrobot Commented Marked as fixed on Tuesday, May 18th 2010, 6:55:27 pm