You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Freeman Fang (JIRA)" <ji...@apache.org> on 2013/02/07 03:43:12 UTC
[jira] [Commented] (SMX4-1367) saaj-api couldn't load configured
javax.xml.soap.MetaFactory from saaj-impl for soap v1.2
[ https://issues.apache.org/jira/browse/SMX4-1367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13573117#comment-13573117 ]
Freeman Fang commented on SMX4-1367:
------------------------------------
Hi,
I believe this issue already get resolved by latest specs version.
The
{code}
MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
{code}
will call into
{code}
FactoryFinder.find(
META_FACTORY_CLASS_PROPERTY,
DEFAULT_META_FACTORY_CLASS);
{code}
and the FactoryFinder.find(String, String) will call FactoryFinder(String, Class, String), which code now is like
{code}
try {
// If we are deployed into an OSGi environment, leverage it
if (factoryClass == null) {
String factoryClassName = factoryPropertyName;
if (factoryPropertyName.equals("javax.xml.soap.MetaFactory")) {
//this is an exception that the factoryPropertyName isn't
//the actual factory class name, there is no class
//javax.xml.soap.MetaFactory at all
factoryClassName = "javax.xml.soap.SAAJMetaFactory";
}
ClassLoader cl = FactoryFinder.class.getClassLoader();
if (cl == null) {
cl = Thread.currentThread().getContextClassLoader();
}
factoryClass = cl.loadClass(factoryClassName);
}
Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryPropertyName);
if (spiClass != null) {
return spiClass.newInstance();
}
} catch (Throwable e) {
}
...
{code}
You can see the OSGiLocator is used, as well as javax.xml.soap.MetaFactory ===> javax.xml.soap.SAAJMetaFactory mapping is used
Freeman
> saaj-api couldn't load configured javax.xml.soap.MetaFactory from saaj-impl for soap v1.2
> ------------------------------------------------------------------------------------------
>
> Key: SMX4-1367
> URL: https://issues.apache.org/jira/browse/SMX4-1367
> Project: ServiceMix 4
> Issue Type: Bug
> Reporter: jason
> Assignee: Freeman Fang
>
> https://issues.apache.org/jira/browse/SMX4-1089
> The default MessageFactory uses a FactoryFinder that correctly loads in OSGI and defaults to Soap v1.1
> public static MessageFactory newInstance() throws SOAPException {
> try {
> return (MessageFactory)FactoryFinder.find(
> MESSAGE_FACTORY_PROPERTY,
> DEFAULT_MESSAGE_FACTORY);
> }
> static Object find(String factoryPropertyName,
> String defaultFactoryClassName) throws SOAPException {
> try {
> // If we are deployed into an OSGi environment, leverage it
> Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryPropertyName);
> if (spiClass != null) {
> return spiClass.newInstance();
> }
> } catch (Throwable e) {
> }
> but for a call such as
> MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
> The overloaded newInstance does not use the the same mechanism and fails to load the class in an osgi environment.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira