[
https://issues.apache.org/jira/browse/XMLBEANS-613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17562916#comment-17562916
]
Huynh Long Thang commented on XMLBEANS-613:
-------------------------------------------
Hi,
I have cleaned all and regenerated them but it didn't work until I try
modifying a little bit in SchemaTypeLoaderImpl.java as the below and it worked
for me. It seem when running in my application, metadataPath is not null and it
isn't correct path.
From:
{code:java}
private SchemaTypeLoaderImpl(SchemaTypeLoader[] searchPath, ResourceLoader
resourceLoader, ClassLoader classLoader, String metadataPath) {
_searchPath = (searchPath == null) ? EMPTY_SCHEMATYPELOADER_ARRAY :
searchPath;
_resourceLoader = resourceLoader;
_classLoader = classLoader;
if (metadataPath != null) {
this._metadataPath = metadataPath;
} else {
final String path26 = "schema" + METADATA_PACKAGE_LOAD.replace("/",
"_");
this._metadataPath = (isPath30(_classLoader)) ?
METADATA_PACKAGE_LOAD : path26;
} initCaches();
} {code}
To:
{code:java}
private SchemaTypeLoaderImpl(SchemaTypeLoader[] searchPath, ResourceLoader
resourceLoader, ClassLoader classLoader, String metadataPath) {
this._searchPath = (searchPath == null) ? EMPTY_SCHEMATYPELOADER_ARRAY :
searchPath;
this._resourceLoader = resourceLoader;
this._classLoader = classLoader;
this._metadataPath = METADATA_PACKAGE_LOAD;
initCaches();
} {code}
Please help to review/advise if the above modification is well for another
logic in XMLBeans?
Thank you very much.
> XmlObject.Factory.parse() don't return the type of XML Document
> ---------------------------------------------------------------
>
> Key: XMLBEANS-613
> URL: https://issues.apache.org/jira/browse/XMLBEANS-613
> Project: XMLBeans
> Issue Type: Bug
> Components: XmlObject
> Affects Versions: Version 5.0.3, Version 5.1.0
> Reporter: Huynh Long Thang
> Priority: Critical
> Attachments: image-2022-06-28-16-33-48-716.png,
> image-2022-06-30-17-12-47-080.png, image-2022-07-01-13-51-41-913.png,
> image-2022-07-05-16-19-38-097.png, image-2022-07-06-08-50-17-630.png
>
>
> I am trying to upgrade XMLBeans version 5.1.0 from version 3.1.0. The XML
> Document when running on our application (using IBM Websphere as a server)
> can not parse with *XmlObject.Factory.parse:*
> h6. {{Code:}}
> {code:java}
> XmlObject xmlObj = XmlObject.Factory.parse(content, opts);{code}
> {*}It worked well with version 3.1.0 before{*}. But after upgrading to 5.1.0
> (similar to 5.0.3) , it always returns XmlAnyTypeImpl type.
> Even, it can parse when calling the Inner Factory class directly:
> Example:
> {code:java}
> RequestSecurityTokenResponseCollectionDocument xmlObj =
> RequestSecurityTokenResponseCollectionDocument
> .Factory.parse(content,opts);{code}
>
> Beside, I found the class which is built from the schema with xmlbeans in my
> source code like the image:
> !image-2022-06-28-16-33-48-716.png!
> I think that there is a issue with class loading. Has anyone meet this issue
> and how to resolve it? Thank you for your support.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]