Note that there are some explanatory texts on larger screens.

plurals
  1. POWebSphere ClassNotFoundException when invoking WebService after startup (but not later)
    text
    copied!<p><strong>Update</strong>: The <code>ClassNotFoundException</code> only occurs if I try to use the web service immediately after starting the application. If I wait (for some unknown event/duration) the application will work. I would like to know what it is that I need to wait for.</p> <hr> <p><strong>Problem</strong>: My application fails because a class that does exist is not found by a classloader.</p> <p><strong>More info</strong>:</p> <p>The class that cannot be found is <code>com.sun.xml.stream.ZephyrParserFactory</code>.</p> <p>In my EAR I have the <code>sjsxr.jar</code>. This jar contains the class <code>com.sun.xml.stream.ZephyrParserFactory</code></p> <p>The EAR also contains <code>MyApp.jar</code>, which contains the EJB entry points for the application. The <code>MyApp.jar</code> manifest references all the needed jars, including <code>sjsxr.jar</code></p> <pre><code>Manifest-Version: 1.0 Ant-Version: Apache Ant 1.8.1 Created-By: 1.5.0_18 (Sun Microsystems Inc.) Built-By: GMM Development Team Class-Path: aopalliance-1.0.jar commons-codec-1.4.jar commons-collecti ons-3.1.jar commons-lang-2.1.jar commons-logging-1.1.1.jar ehcache-co re-2.1.0.jar ehcache-spring-annotations-1.1.2.jar joda-time-1.6.1.jar log4j-1.2.16.jar org.springframework.context.support-3.0.4.RELEASE.j ar sjsxr.jar slf4j-api-1.6.1.jar slf4j-log4j12-1.6.1.jar spring-aop -3.0.4.RELEASE.jar spring-asm-3.0.4.RELEASE.jar spring-beans-3.0.4.RE LEASE.jar spring-context-3.0.4.RELEASE.jar spring-core-3.0.4.RELEASE. jar spring-expression-3.0.4.RELEASE.jar spring-jdbc-3.0.4.RELEASE.jar spring-tx-3.0.4.RELEASE.jar swiftVal.jar velocity-1.5.jar vm-startup .jar xbean.jar </code></pre> <p>The application contains web services client code generated by WebSphere's <code>wsimport</code> tool. When the application attempts to invoke this code, the following exception is thrown:</p> <pre><code>EJB threw an unexpected (non-declared) exception during invocation of method "messageIn" on bean "BeanId(MyApp#ejb.jar#NodeEJB, null)". Exception data: javax.xml.stream.FactoryConfigurationError: Provider com.sun.xml.stream.ZephyrParserFactory not found at javax.xml.stream.XMLInputFactory.newInstance(Unknown Source) at org.apache.axiom.om.util.StAXUtils$7.run(StAXUtils.java:327) at java.security.AccessController.doPrivileged(AccessController.java:202) at org.apache.axiom.om.util.StAXUtils.getXMLInputFactory_perClassLoader(StAXUtils.java:323) at org.apache.axiom.om.util.StAXUtils.getXMLInputFactory(StAXUtils.java:78) at org.apache.axiom.om.util.StAXUtils.createXMLStreamReader(StAXUtils.java:133) at org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:596) at org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:581) at org.apache.axis2.deployment.DescriptionBuilder.buildOM(DescriptionBuilder.java:97) at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:90) at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:641) at com.ibm.ws.websvcs.deployment.WASAxis2ConfigurationBuilder.loadAxisCfg(WASAxis2ConfigurationBuilder.java:492) at com.ibm.ws.websvcs.deployment.WASAxis2ConfigurationBuilder.loadAxisClientConfiguration(WASAxis2ConfigurationBuilder.java:191) at com.ibm.ws.websvcs.client.WSClientConfigurationFactory.getConfigContext(WSClientConfigurationFactory.java:271) at com.ibm.ws.websvcs.client.WSClientConfigurationFactory.getClientConfigurationContext(WSClientConfigurationFactory.java:236) at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:92) at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:79) at org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDescription(DescriptionFactory.java:76) at org.apache.axis2.jaxws.spi.ServiceDelegate.&lt;init&gt;(ServiceDelegate.java:212) at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:59) at javax.xml.ws.Service.&lt;init&gt;(Service.java:67) at my.generated.Web_Service.&lt;init&gt;(Web_Service.java:44) ... Caused by: java.lang.ClassNotFoundException: com.sun.xml.stream.ZephyrParserFactory at java.lang.Class.forNameImpl(Native Method) at java.lang.Class.forName(Class.java:136) at javax.xml.stream.FactoryFinder.newInstance(Unknown Source) at javax.xml.stream.FactoryFinder.find(Unknown Source) at javax.xml.stream.FactoryFinder.find(Unknown Source) ... 101 more </code></pre> <p>I have confirmed half a dozen times that the class, jar and manifest are correct before and after deployment.</p> <p>I have also tried renaming the <code>sjsxr.jar</code> to avoid any potential eclipses but the problem does not go away.</p> <p>I am using WebSphere 7.0.0.11 ND</p> <p>Can anyone help?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload