6 Replies Latest reply on Mar 7, 2017 4:43 PM by Steve Warsa

    org.apache.axiom.om.OMException: No meta factory found for feature 'default'; this usually means that axiom-impl.jar is not in the classpath

    Steve Warsa Newbie

      This jar is definitely in the classpath. I'm using 1.2.16 and have both axiom-api-1.2.16.jar and axiom-impl-1.2.16.jar both in the classpath. This is my attempt to convert a working enterprise app (EAR) from WebSphere 7 to JBoss EAP 7. This app uses spring 4.3.4 with Spring WS Core and XML 2.4.0. Here is the message factory I'm using in spring (which works on WebSphere 7):

       

      <bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
        
      <property name="payloadCaching" value="false" />
      </bean>

       

      If I take that out and use Saaj instead, it works:

       

      <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
        
      <property name="payloadCaching" value="false" />
      </bean>

       

      But as I understand, Saaj is DOM style and consumes more memory, where as Axiom is SAX style and streams therefore using less memory. So, I would prefer to use Axiom, but unfortunately, I get the message:

      org.apache.axiom.om.OMException: No meta factory found for feature 'default'; this usually means that axiom-impl.jar is not in the classpath

      Any clues?

      Thanks,

      Steve

        • 1. Re: org.apache.axiom.om.OMException: No meta factory found for feature 'default'; this usually means that axiom-impl.jar is not in the classpath
          ehugonnet Apprentice

          It looks like the axiom.xml file in the META-INF dir is not found.

          Could you provide the full stack trace, and the jboss-deployment-structure.xml if you use one ?

          • 2. Re: org.apache.axiom.om.OMException: No meta factory found for feature 'default'; this usually means that axiom-impl.jar is not in the classpath
            Steve Warsa Newbie

            Here is the full stack trace:

             

            08:05:22,225 INFO  [stdout] (ServerService Thread Pool -- 61) FrameworkServlet - Context initialization failed

             

             

            08:05:22,225 INFO  [stdout] (ServerService Thread Pool -- 61) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageFactory' defined in class path resource [springfiles/commonContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.ws.soap.axiom.AxiomSoapMessageFactory]: Constructor threw exception; nested exception is org.apache.axiom.om.OMException: No meta factory found for feature 'default'; this usually means that axiom-impl.jar is not in the classpath

             

             

            08:05:22,225 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1110)

             

             

            08:05:22,225 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1054)

             

             

            08:05:22,225 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)

             

             

            08:05:22,225 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:754)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at javax.servlet.GenericServlet.init(GenericServlet.java:244)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:239)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:133)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:527)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at java.util.concurrent.FutureTask.run(FutureTask.java:266)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at java.lang.Thread.run(Thread.java:745)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.jboss.threads.JBossThread.run(JBossThread.java:320)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.ws.soap.axiom.AxiomSoapMessageFactory]: Constructor threw exception; nested exception is org.apache.axiom.om.OMException: No meta factory found for feature 'default'; this usually means that axiom-impl.jar is not in the classpath

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1102)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) ... 31 more

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) Caused by: org.apache.axiom.om.OMException: No meta factory found for feature 'default'; this usually means that axiom-impl.jar is not in the classpath

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.apache.axiom.om.OMAbstractFactory.getMetaFactory(OMAbstractFactory.java:179)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.apache.axiom.om.OMAbstractFactory.getMetaFactory(OMAbstractFactory.java:144)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.apache.axiom.om.OMAbstractFactory.getSOAP11Factory(OMAbstractFactory.java:209)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.ws.soap.axiom.AxiomSoapMessageFactory.<init>(AxiomSoapMessageFactory.java:103)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)

             

             

            08:05:22,226 INFO  [stdout] (ServerService Thread Pool -- 61) ... 33 more

             

            Here is the jboss-deployment-structure.xml:

             

            <jboss-deployment-structure>

              <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

              <sub-deployment name="xxxTdWeb.war">

              <!-- This was to override JBoss implementation of the logger (found answer here: https://access.redhat.com/solutions/105653) -->

              <exclusions>

                   <module name="org.apache.log4j" />

                 </exclusions>

                 <!--

                  These jars are needed here because during the server startup spring is parsing the xml configuration files and

                  it needs these jars in order to process the xsd schema definitions at the top of those files.

                 -->

              <dependencies>

              <module name="deployment.xxxTD.ear.thirdPartyJars/spring-aop-4.3.4.RELEASE.jar" meta-inf="import" />

              <module name="deployment.xxxTD.ear.thirdPartyJars/spring-beans-4.3.4.RELEASE.jar" meta-inf="import" />

              <module name="deployment.xxxTD.ear.thirdPartyJars/spring-context-4.3.4.RELEASE.jar" meta-inf="import" />

              <module name="deployment.xxxTD.ear.thirdPartyJars/spring-tx-4.3.4.RELEASE.jar" meta-inf="import" />

              <module name="deployment.xxxTD.ear.thirdPartyJars/spring-webmvc-4.3.4.RELEASE.jar" meta-inf="import" />

              </dependencies>

              </sub-deployment>

            </jboss-deployment-structure>

             

            The structure of this EAR is that it has one java project and one WAR (there will be a second WAR coming too).  All of the common jars are stored in the EAR and referenced via the manifest.mf in the java project.  Then the WAR project references the java project in it's manifest.  The java project is where the spring file is....

             

            By the way, I did check and the jar and the axiom.xml is in the META-INF folder and here are the contents of it:

             

            <?xml version="1.0" encoding="UTF-8"?>

            <!--

              ~ Licensed to the Apache Software Foundation (ASF) under one

              ~ or more contributor license agreements. See the NOTICE file

              ~ distributed with this work for additional information

              ~ regarding copyright ownership. The ASF licenses this file

              ~ to you under the Apache License, Version 2.0 (the

              ~ "License"); you may not use this file except in compliance

              ~ with the License. You may obtain a copy of the License at

              ~

              ~ http://www.apache.org/licenses/LICENSE-2.0

              ~

              ~ Unless required by applicable law or agreed to in writing,

              ~ software distributed under the License is distributed on an

              ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

              ~ KIND, either express or implied. See the License for the

              ~ specific language governing permissions and limitations

              ~ under the License.

              -->

            <implementations xmlns="http://ws.apache.org/axiom/">

                <implementation name="llom" loader="org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactoryLoader">

                    <feature name="default" priority="100"/>

                </implementation>

            </implementations>

             

            Thanks,

            Steve

            • 3. Re: org.apache.axiom.om.OMException: No meta factory found for feature 'default'; this usually means that axiom-impl.jar is not in the classpath
              ehugonnet Apprentice

              Axiom current error message is : "is not in the classpath or that the META-INF/axiom.xml resource can't be read" so .

              By default items in META-INF of a dependency are not accessible Class Loading in AS7 - JBoss AS 7.1 - Project Documentation Editor so you don't see the axiom.xml.

              Either put it in your lib dir or maybe the services in the manifest will help.

              Last trick could be using the jboss-deployment-structure to add a dependency to axiom with meta-inf="import"

              • 4. Re: org.apache.axiom.om.OMException: No meta factory found for feature 'default'; this usually means that axiom-impl.jar is not in the classpath
                Steve Warsa Newbie

                Thanks for the suggestions and the link.  I've tried putting the axiom.xml file in the jar at META-INF/services, no luck.  I have tried adding a dependency in the jboss-deployment-structure.xml:

                 

                <module name="deployment.xxxxx.ear.thirdPartyJars/axiom-impl.jar" meta-inf="import" />

                 

                (This was prior to me moving the axiom.xml to META-INF/services)

                 

                In the past I'd tried to extract the axiom.xml and put it at various places in the classpath, but hasn't worked.

                 

                It must be something obvious...  Hopefully I will soon find the answer.

                • 5. Re: org.apache.axiom.om.OMException: No meta factory found for feature 'default'; this usually means that axiom-impl.jar is not in the classpath
                  Steve Warsa Newbie

                  In playing around with this a little bit today, I was able to get axiom to work (to avoid the error), but in doing that, all of a sudden, Spring AOP stopped working.

                   

                  The way I got axiom to work was by creating a module with the 2 axiom jars (axiom-impl.jar, axiom-api.jar).  Then I added a dependency in the jboss-deployment-structure.xml:

                   

                  <module name="org.apache.axiom" meta-inf="import"/>

                   

                  And in order to get rid of the error, I had to add an entry in the global-modules area:

                   

                          <subsystem xmlns="urn:jboss:domain:ee:4.0">

                              <global-modules>

                                  <module name="javax.jms.api"/>

                                  <module name="com.softwareag.webMethods.broker"/>

                                  <module name="org.apache.axiom"/>

                              </global-modules>

                              ...

                  The app had been failing on startup during a few web service calls.  By doing the above, the app started up successfully, making all the web service calls (via axiom) successfully, but when I first tried to hit the app, it failed with a nullpointer.  The nullpointer was caused by something our Aspect was not doing.  I put a breakpoint in the method in the Aspect that is decorated with the @Around advice.  The code never stopped there.  So, I had to revert the references to the axiom module I had created and switch my spring configuration back to using the org.springframework.ws.soap.saaj.SaajSoapMessageFactory (instead of the org.springframework.ws.soap.axiom.AxiomSoapMessageFactory).

                   

                  So, at the end of the day, I'm still where I was at the start of this thread...

                   

                  FYI

                  • 6. Re: org.apache.axiom.om.OMException: No meta factory found for feature 'default'; this usually means that axiom-impl.jar is not in the classpath
                    Steve Warsa Newbie

                    Well, I've now solved the problem. All I did was both remove the dependency and add the exclusion of axiom in my jboss-deployment-structure.xml:

                     

                    <sub-deployment name="xxxYYY.war">

                         <exclusions>

                              <module name="org.apache.axiom" />

                         </exclusions>

                    ...

                     

                    The startup still indicates it is using AXIOM, because I see this:

                     

                    14:35:25,849 INFO  [stdout] (ServerService Thread Pool -- 63) AxiomSoapMessageFactory - Disabled payload caching