VMware {code} Community
avshein
Contributor
Contributor
Jump to solution

sometimes WstxInputFactory not found on vimPort.retrieveServiceContent

I have some strange behaviour in action extension I've added. Sometimes vimPort.retrieveServiceContent fails on class not found exception and message

'javax.xml.stream.FactoryFinder$ConfigurationError : Provider com.ctc.wstx.stax.WstxInputFactory not found'

What is strange that sometimes the same code is working well. Does someone have any ideas how to get it working always and why it is happens?

thanks

0 Kudos
1 Solution

Accepted Solutions
laurentsd
VMware Employee
VMware Employee
Jump to solution

If you have correctly added  com.ctc.wstx.stax to the Import-Package list of both your UI and Java bundle manifests, I really don't see why it would throw this ClassNotFound exception.

View solution in original post

0 Kudos
10 Replies
laurentsd
VMware Employee
VMware Employee
Jump to solution

Here is our current FAQ entry that answers this question:

How to solve most ClassNotFoundException or similar errors?

In most cases a ClassNotFoundException, or similar "not found" error, is caused by incorrect or missing packages in your bundle manifest's Import-Packages. For instance if your java service uses any API from the SDK packagecom.vmware.vise.data.query, that package must be listed in its manifest (this is how Virgo handles dynamic dependencies between libraries). We recommend to use a tool like bundlor to generate the manifest with your build, this will avoid many errors!

If the "not found" error still happens when calling a remove web service from your java plugin, another thing to try is to add the missing package in the MANIFEST of the UI plugin making the initial call to your java plugin. For instance if you get a popup with the error Provider com.ctc.wstx.stax.WstxInputFactory not found you should add com.ctc.wstx.stax to the Import-Packages of your UI plugin.

avshein
Contributor
Contributor
Jump to solution

Thanks again for the fast reply 🙂

I've run manifest.mf generation again. It indeed changed imported directive. I'll see is the exception back.

0 Kudos
avshein
Contributor
Contributor
Jump to solution

the error has been back. It happens when retrieving service content even after re-generating the manifest, cleaning virgo and STS restart . The import directive is:

Import-Package: com.vmware.vim25,com.vmware.vise.usersession,com.vmwar

e.vise.vim.data,javax.net.ssl,javax.xml.datatype,javax.xml.ws,org.apa

che.commons.logging

[2013-02-26 01:55:32.350] ERROR [ERROR] http-bio-9443-exec-9          c.t.d.vsphere.actions.TdActionServiceImpl$ServiceContentAccessor  getServiceContent error:  javax.xml.stream.FactoryFinder$ConfigurationError: Provider com.ctc.wstx.stax.WstxInputFactory not found
at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:152)
at javax.xml.stream.FactoryFinder.findJarServiceProvider(FactoryFinder.java:328)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:253)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:177)
at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:153)
at com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory.getXMLInputFactory(XMLStreamReaderFactory.java:98)
at com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory.access$000(XMLStreamReaderFactory.java:57)
at com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory$Default$1.initialValue(XMLStreamReaderFactory.java:351)
at com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory$Default$1.initialValue(XMLStreamReaderFactory.java:348)
at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:160)
at java.lang.ThreadLocal.get(ThreadLocal.java:150)
at com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory$Default.doCreate(XMLStreamReaderFactory.java:365)
at com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory.doCreate(XMLStreamReaderFactory.java:193)
at com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory.create(XMLStreamReaderFactory.java:143)
at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:290)
at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:118)
at com.sun.xml.internal.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:343)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.createResponsePacket(HttpTransportPipe.java:254)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:203)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:122)
at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:123)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:626)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:585)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:570)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:467)
at com.sun.xml.internal.ws.client.Stub.process(Stub.java:308)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:146)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:98)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:129)
at $Proxy456.retrieveServiceContent(Unknown Source)
at com....vsphere.actions.TdActionServiceImpl$ServiceContentAccessor.getServiceContent(TdActionServiceImpl.java:144)
at com....vsphere.actions.TdActionServiceImpl$ServiceContentAccessor.access$0(TdActionServiceImpl.java:121)
at com....vsphere.actions.TdActionServiceImpl.provisionVfs(TdActionServiceImpl.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy466.provisionVfs(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:418)
at com.vmware.vise.messaging.remoting.JavaAdapterEx.invoke(JavaAdapterEx.java:38)
at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1400)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1011)
at flex.messaging.endpoints.AbstractEndpoint$FastClassByCGLIB$1a3ef066.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.flex.core.MessageInterceptionAdvice.invoke(MessageInterceptionAdvice.java:66)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:124)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(Cglib2AopProxy.java:572)
at flex.messaging.endpoints.SecureAMFEndpoint$EnhancerByCGLIB$558995d8.serviceMessage(<generated>)
at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166)
at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
at flex.messaging.endpoints.SecureAMFEndpoint$EnhancerByCGLIB$558995d8.service(<generated>)
at org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(MessageBrokerHandlerAdapter.java:101)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.eclipse.virgo.web.tomcat.support.ApplicationNameTrackingValve.invoke(ApplicationNameTrackingValve.java:33)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassNotFoundException: com.ctc.wstx.stax.WstxInputFactory
at org.eclipse.gemini.web.tomcat.internal.loading.BundleWebappClassLoader.loadClass(BundleWebappClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at javax.xml.stream.FactoryFinder.getProviderClass(FactoryFinder.java:112)
at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:143)
... 101 common frames omitted
0 Kudos
laurentsd
VMware Employee
VMware Employee
Jump to solution

Did you add com.ctc.wstx.stax to the Import-Packages of your UI plugin as I explained?

I don't think the manifest generation does it for you.

avshein
Contributor
Contributor
Jump to solution

yes. it doesn't solve the problem 😞

1 of 5 calls failed with the same exception.

Can it be related to actions? I have the same worked properly in PropertyProvider.

0 Kudos
laurentsd
VMware Employee
VMware Employee
Jump to solution

If you have correctly added  com.ctc.wstx.stax to the Import-Package list of both your UI and Java bundle manifests, I really don't see why it would throw this ClassNotFound exception.

0 Kudos
avshein
Contributor
Contributor
Jump to solution

I've added the package to both, java and UI Import=Package, as you suggested. It looks working now. Thanks!

0 Kudos
laurentsd
VMware Employee
VMware Employee
Jump to solution

Great, I knew you were close 🙂

0 Kudos
ryantodd
Contributor
Contributor
Jump to solution

Adding com.ctc.wstx.stax to the Import-Package fixed this issue for me. I believe this issue arose for me when I had to add a Trust Manager to my property provider as a work-around for some certificate errors I was having in my dev environment.

0 Kudos
royling
Contributor
Contributor
Jump to solution

don't understand why this exception was thrown occasionally?

can someone explain it? thanks!

0 Kudos