4 Replies Latest reply on Sep 8, 2008 4:52 AM by Alexandros Karypidis

    com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog

    Alexandros Karypidis Novice

      Hello,

      In my personal ESB 101 course, I have created a service with two JMS listeners (one gateway, one esb-aware) and a trivial SystemPrintln action. Here's the simple jboss-esb.xml:

      <?xml version = "1.0" encoding = "UTF-8"?>
      <jbossesb
       xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
       parameterReloadSecs="5">
      
       <providers>
       <jms-provider name="esbTest_providerJMS"
       connection-factory="ConnectionFactory">
       <jms-bus busid="inputGW_jmsBus">
       <jms-message-filter dest-type="QUEUE"
       dest-name="queue/esbTest_inputGWBus" />
       </jms-bus>
       <jms-bus busid="inputNative_jmsBus">
       <jms-message-filter dest-type="QUEUE"
       dest-name="queue/esbTest_inputNativeBus" />
       </jms-bus>
       </jms-provider>
       </providers>
      
       <services>
       <service category="Core" name="Exchange"
       description="Message Exchange Service">
       <listeners>
       <jms-listener busidref="inputGW_jmsBus"
       is-gateway="true" name="inputLSNR_inputGW_jmsBus" />
       <jms-listener busidref="inputNative_jmsBus"
       name="inputLSNR_inputNative_jmsBus" />
       </listeners>
       <actions mep="OneWay">
       <action class="org.jboss.soa.esb.actions.SystemPrintln"
       name="println" />
       </actions>
       </service>
       </services>
      </jbossesb>


      When I try to deploy the esb archive, JBossESB hits me with the following deployment error:

      11:27:28,392 INFO [JBoss4ESBDeployer] create esb service, esbTest.esb
      11:27:28,455 INFO [esbTest_inputNativeBus] Bound to JNDI name: queue/esbTest_inputNativeBus
      11:27:28,455 INFO [esbTest_inputGWBus] Bound to JNDI name: queue/esbTest_inputGWBus
      11:27:28,548 INFO [JDBCDataStore] Generated token 'authToken:4F7F2C50-7A5B-11DD-BC99-C24F8D581A13' for user: 'jbossesb/JBoss ESB User'
      11:27:31,220 WARN [ServiceController] Problem starting service jboss.esb:deployment=esbTest.esb
      org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException: Unexpected registry exception
       at org.jboss.soa.esb.listeners.gateway.JmsGatewayListener.doInitialise(JmsGatewayListener.java:98)
       at org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle.initialise(AbstractManagedLifecycle.java:133)
       at org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController.initialiseInstances(ManagedLifecycleController.java:150)
       at org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController.start(ManagedLifecycleController.java:69)
       at org.jboss.soa.esb.listeners.config.JBoss4ESBDeployment.startService(JBoss4ESBDeployment.java:83)
      ___UNBELIEVABLY HUGE STACK TRACE TRUNCATED FOR THIS POST___
      
      Caused by: org.jboss.soa.esb.services.registry.RegistryException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
       at [row,col {unknown-source}]: [1,0]
       at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:303)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.jboss.internal.soa.esb.services.registry.RegistryService$1.invoke(RegistryService.java:61)
       at $Proxy36.findEPRs(Unknown Source)
       at org.jboss.internal.soa.esb.services.registry.CachingRegistryInterceptor.getEPRs(CachingRegistryInterceptor.java:157)
       at org.jboss.internal.soa.esb.services.registry.CachingRegistryInterceptor.findEPRs(CachingRegistryInterceptor.java:94)
       at org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor.findEPRs(InVMRegistryInterceptor.java:133)
       at org.jboss.soa.esb.services.registry.RegistryFactory$HeadRegistryInterceptor.findEPRs(RegistryFactory.java:229)
       at org.jboss.soa.esb.listeners.RegistryUtil.getEprs(RegistryUtil.java:226)
       at org.jboss.soa.esb.listeners.gateway.JmsGatewayListener.doInitialise(JmsGatewayListener.java:88)
       ... 51 more
      
      Caused by: org.jboss.soa.esb.UnmarshalException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
       at [row,col {unknown-source}]: [1,0]
       at org.jboss.internal.soa.esb.addressing.helpers.EPRHelper.fromXMLString(EPRHelper.java:148)
       at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:292)
       ... 63 more
      
      Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
       at [row,col {unknown-source}]: [1,0]
       at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
       at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
       at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
       at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
       at org.jboss.internal.soa.esb.util.stax.StreamHelper.skipToStartElement(StreamHelper.java:317)
       at org.jboss.internal.soa.esb.addressing.helpers.EPRHelper.fromXMLString(EPRHelper.java:138)
       ... 64 more
      11:27:31,235 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
      
      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.esb:deployment=esbTest.esb
       State: FAILED
       Reason: org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException: Unexpected registry exception
       I Depend On:
       esbTest.destination:service=Queue,name=esbTest_inputNativeBus
       jboss.esb:deployment=jbossesb.esb
       esbTest.destination:service=Queue,name=esbTest_inputGWBus
      
      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.esb:deployment=esbTest.esb
       State: FAILED
       Reason: org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException: Unexpected registry exception
       I Depend On:
       esbTest.destination:service=Queue,name=esbTest_inputNativeBus
       jboss.esb:deployment=jbossesb.esb
       esbTest.destination:service=Queue,name=esbTest_inputGWBus


      Can anyone tell me what I've done to deserve this?

      There seems to be some problem with the registry, but the exception simply isn't informative enough for me...

      Thanks!

        • 1. Re: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in pro
          Alexandros Karypidis Novice

          Ok, this experience has been emotional to say the least.

          Turns out, that using "Core" as my service category causes some sort of conflict with the service registry!

          The problem goes away when I changed the service definition to:

          <services>
           <service category="ANYTHING BUT: Core" name="Exchange"
           description="Message Exchange Service">
           <listeners>


          Seriously now, this had devastated my ego... I still can't believe how unlucky I was!

          • 2. Re: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in pro
            Daniel Bevenius Master

            Hi,

            that sound's strange. Can you try updating the helloworld quickstart and modify the service definition to this:

            <service category="Core" name="Exchange" description="Hello World">
            

            And then update build.xml:
            <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.helloworld.test.SendEsbMessage" failonerror="true">
             <arg value="Core"/> <!-- service category -->
             <arg value="Exchange"/> <!-- service name -->
             <arg value="Hello World - Straight to ESB listener - no Gateway"/> <!-- Message text -->
             <classpath refid="exec-classpath"/>
             </java>
            

            Then to test both JMS gateway and the service separately:
            ant runtest
            ant sendesb
            


            Have you previously deployed any service with the same category and servicename?

            Regards,

            /Daniel



            • 3. Re: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in pro
              Alexandros Karypidis Novice

              Hi,

              I changed helloworld and got the same exception (see previous post).

              When I ran the jms test (ant runtest), the message was added to the queue and I could see from the JMX console that it was waiting in quickstart_helloworld_Request_gw (although there was nothing there to pick it up).

              The esb test (ant sendesb) failed with an interesting error:

              sendesb:
               [echo] Runs Test ESB Message Sender
               [java] java.lang.reflect.InvocationTargetException
               [java] at org.apache.ws.scout.transport.RMITransport.send(RMITransport.java:91)
               [java] at org.apache.ws.scout.registry.RegistryImpl.execute(RegistryImpl.java:271)
               [java] at org.apache.ws.scout.registry.RegistryImpl.getBusinessDetail(RegistryImpl.java:885)
               [java] at org.apache.ws.scout.registry.RegistryImpl.getBusinessDetail(RegistryImpl.java:865)
              ....TRUNCATED...
               [java] Caused by: java.lang.reflect.InvocationTargetException
               [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               [java] at java.lang.reflect.Method.invoke(Method.java:585)
               [java] at org.apache.ws.scout.transport.RMITransport.send(RMITransport.java:86)
               [java] ... 17 more
               [java] Caused by: java.lang.OutOfMemoryError: Java heap space
               [java] at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:99)
               [java] at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:518)
               [java] at java.lang.StringBuffer.append(StringBuffer.java:307)
               [java] at java.io.ObjectInputStream$BlockDataInputStream.readUTFSpan(ObjectInputStream.java:3043)
               [java] at java.io.ObjectInputStream$BlockDataInputStream.readUTFBody(ObjectInputStream.java:2951)
               [java] at java.io.ObjectInputStream$BlockDataInputStream.readUTF(ObjectInputStream.java:2764)
               [java] at java.io.ObjectInputStream.readString(ObjectInputStream.java:1567)
               [java] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1296)
               [java] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
               [java] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
               [java] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
               [java] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
               [java] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
               [java] at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:479)
               [java] at org.apache.xerces.dom.ParentNode.readObject(Unknown Source)
              ...TRUNCATED AGAIN...
               [java] Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
               [java] at org.apache.xmlbeans.impl.store.CharUtil.allocate(CharUtil.java:397)
               [java] at org.apache.xmlbeans.impl.store.CharUtil.saveChars(CharUtil.java:506)
               [java] at org.apache.xmlbeans.impl.store.Cur$CurLoadContext.text(Cur.java:2911)
               [java] at org.apache.xmlbeans.impl.store.Cur$CurLoadContext.stripText(Cur.java:3113)
               [java] at org.apache.xmlbeans.impl.store.Cur$CurLoadContext.text(Cur.java:3121)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1447)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNodeChildren(Locale.java:1396)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1438)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNodeChildren(Locale.java:1396)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1438)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNodeChildren(Locale.java:1396)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1438)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNodeChildren(Locale.java:1396)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1438)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNodeChildren(Locale.java:1396)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1438)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNodeChildren(Locale.java:1396)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1438)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNodeChildren(Locale.java:1396)
               [java] at org.apache.xmlbeans.impl.store.Locale.loadNode(Locale.java:1438)
               [java] at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1378)
               [java] at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1363)
               [java] at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:370)
               [java] at org.apache.xmlbeans.XmlObject$Factory.parse(XmlObject.java:745)
               [java] at org.apache.ws.scout.registry.RegistryImpl.execute(RegistryImpl.java:297)
              ...TRUNCATED...
              


              I thought it was normal for it to fail but certainly not due to depleting the heap memory.

              Do you not get an error when using "Core" as the service category? It is very consistent/reproducable on my system. Do you think my registry is in an invalid state? How do I reset it? I uninstalled-reinstalled (ant undeploy / deploy) the JBoss ESB but it didn't change anything...

              I had not encountered any problems until I tried to deploy this simple service and had not used "Core" as the service category prior to this.


              • 4. Re: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in pro
                Alexandros Karypidis Novice

                Ok, there's definitely something stale in my installation that is causing the problem. I performed a clean install of the application server (4.2.3.GA) and then added the ESB (4.4.GA) and there's nothing wrong with using "Core" as the service category name.

                It's interesting though that when I uninstalled JBossESB and re-installed it, something was kept around and the problem persisted. I had to do a clean install to make this go away.

                What I did was:

                rename jboss-4.2.3.GA to jboss-4.2.3.GA.PROBLEMATIC
                unzip jboss-4.2.3.GA.zip to create a new clean app server environment
                run "ant deploy" from my jbossesb-4.4.GA directory to install the ESB

                jboss-4.2.3.GA.PROBLEMATIC still exhibits the problem. I've kept the problematic installation around if you feel like investigating the issue, so if you want me to give you some feedback, I could...