java.lang.ClassCastException:com.sun.xml.internal.ws.client.sei.SEIStub不能强制转换为org.apache.cxf.frontend.clientproxy AEM OSGi
我正在尝试在AEM的osgi环境中使用fuelsdk。我得到了这个错误- java.lang.ClassCastException:com.sun.xml.internal.ws.client.sei.SEIStub不能强制转换为org.apache.cxf.frontend.ClientProxy 这是因为OSGi在嵌入fuelsdk依赖项的捆绑包之前加载系统捆绑包。捆绑得到解决;此错误在运行时发生 如何强制OSGi类加载器在运行时选择org.apache.cxf.frontend.ClientProxy而不是com.sun.xml.internal.ws.client.sei.SEIStub 我是否可以使用“uses”指令的组合;和/或进口/出口包装 有人建议我使用-java.lang.ClassCastException:com.sun.xml.internal.ws.client.sei.SEIStub不能强制转换为org.apache.cxf.frontend.clientproxy AEM OSGi,osgi,aem,osgi-fragment,embedded-osgi,Osgi,Aem,Osgi Fragment,Embedded Osgi,我正在尝试在AEM的osgi环境中使用fuelsdk。我得到了这个错误- java.lang.ClassCastException:com.sun.xml.internal.ws.client.sei.SEIStub不能强制转换为org.apache.cxf.frontend.ClientProxy 这是因为OSGi在嵌入fuelsdk依赖项的捆绑包之前加载系统捆绑包。捆绑得到解决;此错误在运行时发生 如何强制OSGi类加载器在运行时选择org.apache.cxf.frontend.Clien
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.setServiceClass(HelloWorld.class);
factory.setAddress("http://localhost:9000/helloWorld");
soapClient = (Client) factory.create();
我想知道我应该在factory.setServiceClass()中使用哪个类
及
我应该在factory.setAddress()中使用哪个地址;是端点地址吗?--
非常感谢您的帮助
谢谢您可以尝试更新
/crx quickstart/conf/sling.properties
中的org.osgi.framework.bootdegration
属性
org.osgi.framework.bootdegration=org.apache.cxf.*,${org.apache.sling.launcher.bootdegration}
您可以阅读更多关于sling.properties
更新-
您可以强制您的包使用自定义包而不是Java包,为此,您必须将org.apache.cxf.*包包装在具有其他属性的自定义包中-
org.apache.cxf.*
包;myidentifier=“true”;必填项:=“myidentifier”
,在此处提供正确的标识符名称,如果*不起作用,您可能还必须在包级别执行此操作)
org.apache.felix
不幸的是;它没有效果。错误在这一行--soapClient=ClientProxy.getClient(soap);错误发生在运行时;该束正确解析。java.lang.ClassCastException:com.sun.xml.internal.ws.client.sei.SEIStub不能强制转换为org.apache.cxf.frontend.ClientProxy我可以强制bundle类加载器选择org.apache.cxf.frontend.ClientProxy而不是com.sun.xml.internal.ws.client.sei.SEIStub吗?谢谢您的建议;虽然我们现在遇到了一个新的错误,但这有助于前进。还学习了一个与OSGi.Hi@cqsapientuser相关的新东西,您是如何解决java.lang.ClassCastException:com.sun.xml.internal.ws.client.sei.SEIStub无法转换为org.apache.cxf.frontend.ClientProxy
的问题的。任何反馈都会非常有用。
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>
org.apache.cxf.*;myidentifier="true";mandatory:="myidentifier"
</Export-Package>
<Private-Package>
</Private-Package>
<Import-Package>
*
</Import-Package>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Activator>${project.artifactId}.Activator</Bundle-Activator>
<Include-Resource>
{maven-resources}
</Include-Resource>
<Embed-Dependency>
<!-- list of jar's to embed, exposing the Exporting packages. Comma separated-->
</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>