我在某些Apache CXF
中使用bundle A
来调用http://www.movingimage24.com/
中Portal A
的视频。这很好用,可以从movingimage24调用视频并在我的Portal A
中显示没有问题。
现在当我在某些Apache CXF
中使用Bundle B
的方式与Bundle A
中的方式相同,并尝试在我的portal B
中调用视频时,会抛出以下异常:
ERROR [0:0:0:0:0:0:0:1 [1416678184971] GET /content/portal/de/home/company/test_videomanager.html HTTP / 1.1] com .day.cq.wcm.core.impl.WCMDebugFilter异常:加载器约束 接口itable初始化中的违规:解析方法" javax.xml.bind.helpers.AbstractMarshallerImpl.setAttachmentMarshaller(Ljavax / xml / bind / attachment / AttachmentMarshaller;)V" 当前类的类加载器(org / apache / felix / framework / ModuleImpl $ ModuleClassLoaderJava5的实例),javax / xml / bind / helpers / AbstractMarshallerImpl,以及类加载器(实例) org / apache / felix / framework / ModuleImpl $ ModuleClassLoaderJava5)用于接口javax / xml / bind / Marshaller具有类型为javax / xml / bind / attachment / AttachmentMarshaller的不同Class对象 用于签名java.lang.LinkageError:接口itable初始化中的加载器约束违规:解析方法" javax.xml.bind.helpers.AbstractMarshallerImpl.setAttachmentMarshaller (Ljavax / XML /结合/附着/ AttachmentMarshaller;)V"当前类的类加载器(org / apache / felix / framework / ModuleImpl $ ModuleClassLoaderJava5的实例),javax / xml / bind / helpers / AbstractMarshallerImpl, 接口javax / xml / bind / Marshaller的类加载器(org / apache / felix / framework / ModuleImpl $ ModuleClassLoaderJava5的实例)具有javax / xml / bind / attachment / AttachmentMarshaller类型的不同Class对象 用于签名
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.createMarshaller(JAXBContextImpl.java:776)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.createMarshaller(JAXBContextImpl.java:142)
at org.apache.cxf.jaxb.io.DataWriterImpl.createMarshaller(DataWriterImpl.java:120)
at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:212)
at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:114)
at org.apache.cxf.binding.soap.interceptor.RPCOutInterceptor.handleMessage(RPCOutInterceptor.java:94)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:565)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:474)
at de.company.acd.company.cq.webservice.OsgiAwareClientImpl.invoke(OsgiAwareClientImpl.java:62)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:377)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
at $Proxy139.getHttpsPlayerCodeForLockedVideo(Unknown Source)
...
...........
at org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:96)
at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)
at org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42)
at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:49)
at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:249)
at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
at org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:48)
at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39)
at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.felix.http.proxy.ProxyServlet.service(ProxyServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.sling.launchpad.base.webapp.SlingServletDelegate.service(SlingServletDelegate.java:277)
at org.apache.sling.launchpad.webapp.SlingServlet.service(SlingServlet.java:150)
at com.day.j2ee.servletengine.ServletRuntimeEnvironment.service(ServletRuntimeEnvironment.java:228)
at com.day.j2ee.servletengine.RequestDispatcherImpl.doFilter(RequestDispatcherImpl.java:315)
at com.day.j2ee.servletengine.FilterChainImpl.doFilter(FilterChainImpl.java:74)
at com.day.crx.launchpad.filters.CRXLaunchpadLicenseFilter.doFilter(CRXLaunchpadLicenseFilter.java:96)
at com.day.j2ee.servletengine.FilterChainImpl.doFilter(FilterChainImpl.java:72)
at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:334)
at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:378)
at com.day.j2ee.servletengine.ServletHandlerImpl.execute(ServletHandlerImpl.java:315)
at com.day.j2ee.servletengine.DefaultThreadPool$DequeueThread.run(DefaultThreadPool.java:134)
at java.lang.Thread.run(Thread.java:662)
我的pom.xml
bundle B
看起来像这样:
> > <plugins>
> <plugin>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-codegen-plugin</artifactId>
> <version>${apache.cxf.version}</version>
> <executions>
> <execution>
> <id>generate-sources</id>
> <phase>generate-sources</phase>
> <configuration>
> <defaultOptions>
> <autoNameResolution>true</autoNameResolution>
> </defaultOptions>
> <sourceRoot>${project.build.directory}/cxf-generated</sourceRoot>
> <extension>true</extension>
> <wsdlOptions>
> <wsdlOption>
> <wsdl>${basedir}/src/main/resources/wsdl/VideoManager/VideoManager.wsdl</wsdl>
> </wsdlOption>
> </wsdlOptions>
> <sources>
> <source>${project.build.directory}/cxf-generated</source>
> </sources>
> </configuration>
> <goals>
> <goal>wsdl2java</goal>
> </goals>
> </execution>
> </executions>
> </plugin> <plugin>
> <groupId>org.apache.felix</groupId>
> <artifactId>maven-bundle-plugin</artifactId>
> <extensions>true</extensions>
> <version>2.3.7</version>
> <configuration>
> <instructions>
> <Import-Package>
> javax.activation;version=1.1.0,
> javax.xml.bind.*;
> com.adobe.xmp,
> org.apache.cxf.jaxb.*;
> com.day.commons.datasource.poolservice,
> com.day.cq.commons.jcr,
> com.day.cq.dam.api,
> com.day.cq.dam.commons.metadata,
> com.day.cq.dam.commons.process,
> com.day.cq.dam.core,
> com.day.cq.jcrclustersupport,
> com.day.cq.replication,
> com.day.cq.search,
> com.day.cq.search.result,
> com.day.cq.security,
> com.day.cq.wcm.api,
> com.day.cq.wcm.api.components,
> com.day.cq.wcm.api.designer,
> com.day.cq.wcm.foundation,
> com.day.cq.workflow,
> com.day.cq.workflow.exec,
> com.day.cq.workflow.model,
> com.day.cq.workflow.metadata,
> com.day.text,
> javax.crypto,
> javax.crypto.spec,
> javax.imageio,
> javax.imageio.metadata,
> javax.imageio.stream,
> javax.jcr,
> javax.jcr.nodetype,
> javax.jcr.query,
> javax.jcr.lock,
> javax.jcr.version,
> javax.jws,
> javax.jws.soap,
> javax.servlet,
> javax.servlet.http,
> javax.sql,
> javax.xml.bind,
> javax.xml.bind.annotation,
> javax.xml.bind.annotation.adapters,
> javax.xml.datatype,
> javax.xml.namespace,
> javax.xml.parsers,
> javax.xml.transform,
> javax.xml.transform.stream,
> javax.xml.ws,
> com.day.cq.commons,
> org.apache.commons.codec,
> org.apache.commons.codec.binary,
> org.apache.commons.codec.net,
> org.apache.commons.collections,
> org.apache.commons.dbutils,
> org.apache.commons.dbutils.handlers,
> org.apache.commons.httpclient,
> org.apache.commons.httpclient.auth,
> org.apache.commons.httpclient.methods,
> org.apache.commons.httpclient.params,
> org.apache.commons.lang,
> org.apache.commons.lang.builder,
> org.apache.commons.lang.time,
> org.apache.commons.logging,
> org.apache.sling.api,
> org.apache.sling.api.request,
> org.apache.sling.api.resource,
> org.apache.sling.api.scripting,
> org.apache.sling.api.servlets,
> org.apache.sling.commons.json,
> org.apache.sling.commons.json.io,
> org.apache.sling.event.*,
> org.apache.sling.jcr.api,
> org.apache.sling.jcr.resource,
> org.apache.sling.settings,
> org.jdom,
> org.jdom.output,
> org.jdom.input,
> org.osgi.framework,
> org.osgi.service.component,
> org.osgi.service.cm,
> org.slf4j,
> org.w3c.dom,
> org.xml.sax,
> org.xml.sax.helpers,
> *;resolution:=optional
> </Import-Package>
> <Embed-Dependency>
> cxf-bundle;inline=true,
> jaxb-api,
> jaxb-xjc,
> jaxb-impl,
> jaxb-core,
> velocity;groupId=org.apache.velocity;artifactId=velocity;scope=compile,
> activation;version=1.1,
> xmlschema-core,
> spring-beans,
> spring-core,
> neethi,
> wsdl4j,
> </Embed-Dependency>
>
> <!-- CXF Dependencies -->
> <dependencies> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-frontend-jaxws</artifactId>
> <version>${apache.cxf.version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-transports-http</artifactId>
> <version>${apache.cxf.version}</version>
> <scope>compile</scope>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-frontend-simple</artifactId>
> <version>${apache.cxf.version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-core</artifactId>
> <version>${apache.cxf.version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-api</artifactId>
> <version>${apache.cxf.version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-bindings-soap</artifactId>
> <version>${apache.cxf.version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.ws.xmlschema</groupId>
> <artifactId>xmlschema-core</artifactId>
> <version>2.0.3</version>
> </dependency>
> <dependency>
> <groupId>org.springframework</groupId>
> <artifactId>spring-beans</artifactId>
> <version>3.0.6.RELEASE</version>
> </dependency>
> <dependency>
> <groupId>org.springframework</groupId>
> <artifactId>spring-core</artifactId>
> <version>3.0.6.RELEASE</version>
> </dependency>
> <dependency>
> <groupId>org.apache.neethi</groupId>
> <artifactId>neethi</artifactId>
> <version>3.0.1</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-databinding-jaxb</artifactId>
> <version>${apache.cxf.version}</version>
> </dependency>
> <dependency>
> <groupId>wsdl4j</groupId>
> <artifactId>wsdl4j</artifactId>
> <version>1.6.2</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-tools-common</artifactId>
> <version>${apache.cxf.version}</version>
> <exclusions>
> <exclusion>
> <groupId>commons-lang</groupId>
> <artifactId>commons-lang</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-ws-addr</artifactId>
> <version>${apache.cxf.version}</version>
> </dependency> </dependencies>
我是Apache CXF的新手,希望有人能帮助我。