4 Replies Latest reply on Feb 4, 2013 11:27 AM by marcgagnonpincourt

    Encountered invalid class name "org.xmlpull.mxp1.MXParser,org.xmlpul l.mxp1_serializer.MXSerializer" for service type "org.xmlpull.v1.XmlPullParserFa ctory"

    chinu33

      Hello,

       

      I tried to deploy a war file and I got following error:

       

      Encountered invalid class name "org.xmlpull.mxp1.MXParser,org.xmlpul

      l.mxp1_serializer.MXSerializer" for service type "org.xmlpull.v1.XmlPullParserFa

      ctory"

       

      Can someone tell me what's the workaround?

       

      Chinmoy

        • 1. Re: Encountered invalid class name "org.xmlpull.mxp1.MXParser,org.xmlpul l.mxp1_serializer.MXSerializer" for service type "org.xmlpull.v1.XmlPullParserFa ctory"
          jaikiran

          Which version of JBoss AS? What does the entire exception stacktrace look like?

          • 2. Re: Encountered invalid class name "org.xmlpull.mxp1.MXParser,org.xmlpul l.mxp1_serializer.MXSerializer" for service type "org.xmlpull.v1.XmlPullParserFa ctory"
            chinu33

            I am using JBoss 7.0.2 and I have jsf 1.2 enabled application. I also have axis2 jars in the war. I am having folowwing error:

             

            17:16:59,468 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/weblims3.5].[Faces Servlet]] (http--127.0.0.1-8080-1) Servlet.service() for servlet Faces Servlet threw exception: java.lang.NullPointerException

                      at labware.web.control.LoginBean.<init>(LoginBean.java:131) [classes:]

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_11]

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_11]

                      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_11]

                      at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_11]

                      at java.lang.Class.newInstance0(Class.java:355) [:1.6.0_11]

                      at java.lang.Class.newInstance(Class.java:308) [:1.6.0_11]

                      at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:188) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:102) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at ecruiser.util.FacesUtils.resolveVariable(FacesUtils.java:133) [classes:]

                      at ecruiser.tag.ECTag.hasClientMethodBinding(ECTag.java:202) [classes:]

                      at ecruiser.view.jsp.DocHandlerHelper.setBindingAttribute(DocHandlerHelper.java:146) [classes:]

                      at ecruiser.view.jsp.DocHandlerHelper.setAttributes(DocHandlerHelper.java:56) [classes:]

                      at ecruiser.view.jsp.JSPDocHandler.startElement(JSPDocHandler.java:244) [classes:]

                      at ecruiser.view.jsp.JSPParser.parse(JSPParser.java:412) [classes:]

                      at ecruiser.view.jsp.MasterUIFile.<init>(MasterUIFile.java:55) [classes:]

                      at ecruiser.view.jsp.UIFileManager.initializeMaster(UIFileManager.java:65) [classes:]

                      at ecruiser.view.jsp.UIFileManager.getUIMaster(UIFileManager.java:51) [classes:]

                      at ecruiser.view.jsp.JSPViewHandler.createViewInfo(JSPViewHandler.java:121) [classes:]

                      at ecruiser.view.jsp.JSPViewHandler.getViewInfo(JSPViewHandler.java:68) [classes:]

                      at ecruiser.view.ECViewHandler.createView(ECViewHandler.java:186) [classes:]

                      at ecruiser.view.jsp.JSPViewHandler.createView(JSPViewHandler.java:360) [classes:]

                      at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:247) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at ecruiser.util.LogFilter.doFilter(LogFilter.java:29) [classes:]

                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at labware.web.control.CustomCharacterEncodingFilter.doFilter(CustomCharacterEncodingFilter.java:31) [classes:]

                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]

                      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:388) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]

                      at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49) [jboss-as-jpa-7.0.2.Final.jar:7.0.2.Final]

                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at java.lang.Thread.run(Thread.java:619) [:1.6.0_11]

             

            I guess this could be jar conflict issue. I removed my own jsf jars from lib dir.

             

            Chinmoy

            • 3. Re: Encountered invalid class name "org.xmlpull.mxp1.MXParser,org.xmlpul l.mxp1_serializer.MXSerializer" for service type "org.xmlpull.v1.XmlPullParserFa ctory"
              bcantrick

              I encountered this issue today. In my case, the problem turned out to be a service provider config file in smack.jar's META-INF/services/ directory.

               

              The file smack.jar:META-INF/services/org.xmlpull.v1.XmlPullParserFactory (which is a service provider config file) contained one line:

               

              org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer

               

              Note that this is two class names, separated by a comma.

               

              The Java SE 6 .JAR spec says this about the JAR service provider config file: "The file should contain a newline-separated list of unique concrete provider-class names." (See http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#Service%20Provider )

               

              So I extracted META-INF/services/org.xmlpull.v1.XmlPullParserFactory file from smack.jar, and deleted everything after the comma:

               

              org.xmlpull.mxp1.MXParser

               

              Then I put the newly updated file back into smack.jar and restarted JBoss. The warning went away.

               

              NOTE: I AM NOT CERTAIN THIS IS THE RIGHT THING TO DO.

               

              Yes, it makes the JBoss warning go away, but there may be code inside smack.jar that depends on the line being the way it was before. I haven't yet been able to test the functionality that uses smack.jar, so there could be a runtime error waiting to happen. I will attempt to test this tomorrow. If I can do so, I will be back with an update.

               

              In the mean time, I hope this diagnosis of the problem will help someone else in the future.

              • 4. Re: Encountered invalid class name "org.xmlpull.mxp1.MXParser,org.xmlpul l.mxp1_serializer.MXSerializer" for service type "org.xmlpull.v1.XmlPullParserFa ctory"
                marcgagnonpincourt

                I got the same problem so I tried your suggestion and it works fine (up to now).

                The following POM will install an updated version of the original jar so that it can be used in application poms (with artefact name xpp3_min_service).

                You may have to adjust the version.

                 

                <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

                          <modelVersion>4.0.0</modelVersion>

                 

                          <groupId>xpp3</groupId>

                          <artifactId>xpp3_min_service</artifactId>

                          <version>1.1.4c</version>

                          <packaging>jar</packaging>

                 

                          <name>xpp3_min</name>

                          <description>Original xpp3_min jar with the service file fixed.</description>

                 

                          <properties>

                                    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

                                    <xpp3_min.version>1.1.4c</xpp3_min.version>

                          </properties>

                 

                          <dependencies>

                                    <dependency>

                                              <groupId>xpp3</groupId>

                                              <artifactId>xpp3_min</artifactId>

                                              <version>${xpp3_min.version}</version>

                                    </dependency>

                          </dependencies>

                 

                          <build>

                                    <plugins>

                                              <plugin>

                                                        <artifactId>maven-dependency-plugin</artifactId>

                                                        <executions>

                                                                  <execution>

                                                                            <phase>generate-resources</phase>

                                                                            <goals>

                                                                                      <goal>copy-dependencies</goal>

                                                                            </goals>

                                                                            <configuration>

                                                                                      <outputDirectory>${project.build.directory}/lib</outputDirectory>

                                                                            </configuration>

                                                                  </execution>

                                                        </executions>

                                              </plugin>

                                              <plugin>

                                                        <groupId>org.codehaus.mojo</groupId>

                                                        <artifactId>truezip-maven-plugin</artifactId>

                                                        <version>1.1</version>

                                                        <executions>

                                                                  <execution>

                                                                            <id>Copy the updated service definition in the original jar.</id>

                                                                            <goals>

                                                                                      <goal>copy</goal>

                                                                            </goals>

                                                                            <phase>process-resources</phase>

                                                                            <configuration>

                                                                                      <fileset>

                                                                                                <directory>${basedir}/src/main/service</directory>

                                                                                                <outputDirectory>${project.build.directory}/lib/xpp3_min-${xpp3_min.version}.jar/META-INF/services</outputDirectory>

                                                                                      </fileset>

                                                                            </configuration>

                                                                  </execution>

                                                        </executions>

                                              </plugin>

                                              <plugin>

                                                        <artifactId>maven-antrun-plugin</artifactId>

                                                        <executions>

                                                                  <execution>

                                                                            <id>Copy the updated jar to its tmp name - the target jar it empty at this point.</id>

                                                                            <phase>package</phase>

                                                                            <configuration>

                                                                                      <tasks>

                                                                                                <copy

                                                                                                          file="${project.build.directory}/lib/xpp3_min-${xpp3_min.version}.jar"

                                                                                                          tofile="${project.build.directory}/xpp3_min_service-${project.version}_tmp.jar" />

                                                                                      </tasks>

                                                                            </configuration>

                                                                            <goals>

                                                                                      <goal>run</goal>

                                                                            </goals>

                                                                  </execution>

                                                                  <execution>

                                                                            <id>Copy the tmp jar name to its final name just right before it installed.</id>

                                                                            <phase>verify</phase>

                                                                            <configuration>

                                                                                      <tasks>

                                                                                                <copy

                                                                                                          file="${project.build.directory}/xpp3_min_service-${project.version}_tmp.jar"

                                                                                                          tofile="${project.build.directory}/xpp3_min_service-${project.version}.jar" />

                                                                                      </tasks>

                                                                            </configuration>

                                                                            <goals>

                                                                                      <goal>run</goal>

                                                                            </goals>

                                                                  </execution>

                                                        </executions>

                                              </plugin>

                                    </plugins>

                          </build>

                 

                 

                </project>