• Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Critical Critical
    • 11.2.1
    • 11.2
    • Import/Export
    • None

      When I try to import from odata I get this error: Unexpected EOF in prolog (See odata.png)

            [TEIIDDES-3214] odata EOF in prolog

            • Typically there should not be any difference between URL ending with "/" or not, but in this case, the service you used seems to matter if the "/" is used at the end. From Teiid side there is nothing we can predict and fix on our side. I will consider this as user error.
            • I also do see they do not support "http" only "https". The service is simply redirecting to "http" to "https". Also user error, the user should know where the endpoint is. In the case supporting redirects from Designer, there is no good way to configure redirects. In the Server side, one needs to manually configure CXF to suppot redirects.
            • The reason it may have worked in the past is, service may have accepted without https and redirects before, now it does not. That would explain why this worked.

            If above are only reasons they I suggest closing this issue with no resolution.

            Ramesh Reddy added a comment - Typically there should not be any difference between URL ending with "/" or not, but in this case, the service you used seems to matter if the "/" is used at the end. From Teiid side there is nothing we can predict and fix on our side. I will consider this as user error. I also do see they do not support "http" only "https". The service is simply redirecting to "http" to "https". Also user error, the user should know where the endpoint is. In the case supporting redirects from Designer, there is no good way to configure redirects. In the Server side, one needs to manually configure CXF to suppot redirects. The reason it may have worked in the past is, service may have accepted without https and redirects before, now it does not. That would explain why this worked. If above are only reasons they I suggest closing this issue with no resolution.

            There is also change between http and https. If I enter it to browser without 's' I can see 301 redirect in network console.

            Matus Makovy added a comment - There is also change between http and https. If I enter it to browser without 's' I can see 301 redirect in network console.

            Missing a slash at end is a not same as redirect

            Ramesh Reddy added a comment - Missing a slash at end is a not same as redirect

            Mario Majernik added a comment - - edited

            So I tried to change url from :

            http://services.odata.org/Northwind/Northwind.svc
            

            to:

            https://services.odata.org/Northwind/Northwind.svc/
            

            and it works now.
            So workaround exists, I am changing priority to Critical.

            But there is still a question. The first option without redirects worked before. Why? And why is not working now? Should be working now? If not could be a mention about this in documentation or TD should show some warning window that user put there address with redirects.

            Mario Majernik added a comment - - edited So I tried to change url from : http: //services.odata.org/Northwind/Northwind.svc to: https: //services.odata.org/Northwind/Northwind.svc/ and it works now. So workaround exists, I am changing priority to Critical. But there is still a question. The first option without redirects worked before. Why? And why is not working now? Should be working now? If not could be a mention about this in documentation or TD should show some warning window that user put there address with redirects.

            > Teiid does not support redirects if there any

            You have to explicitly configure CXF to follow redirects.

            Steven Hawkins added a comment - > Teiid does not support redirects if there any You have to explicitly configure CXF to follow redirects.

            Do a curl on Metadata call and see what it is sending. Teiid does not support redirects if there any

            Ramesh Reddy added a comment - Do a curl on Metadata call and see what it is sending. Teiid does not support redirects if there any

            But, I think the correct one should be "odata". It worked before, I cannot find right now what has changed.

            Matus Makovy added a comment - But, I think the correct one should be "odata". It worked before, I cannot find right now what has changed.

            @matus yes, it is successful with ws translator and fails with odata translator

            Barry LaFond added a comment - @matus yes, it is successful with ws translator and fails with odata translator

            For the same resource adapter, can you use the ws translator to just execute an invokeHttp for $metadata - perhaps you are not getting the response needed for odata. If you get a json response, the odata translator also includes the headers Accept=application/xml,application/atom+xml to indicate that it needs xml.

            Steven Hawkins added a comment - For the same resource adapter, can you use the ws translator to just execute an invokeHttp for $metadata - perhaps you are not getting the response needed for odata. If you get a json response, the odata translator also includes the headers Accept=application/xml,application/atom+xml to indicate that it needs xml.

            Just a note: From what I know from Mario Majernik, the test was passing up to this point. And it is setting the "odata" translator in the process, it's not leaving the default one "ws" in there.

            Matus Makovy added a comment - Just a note: From what I know from Mario Majernik, the test was passing up to this point. And it is setting the "odata" translator in the process, it's not leaving the default one "ws" in there.

            Added screenshots with my configuration

            Matus Makovy added a comment - Added screenshots with my configuration

            blafond What translator are you using during the import? I noticed that when I use 'odata' translator I get the error, but it works with 'ws' translator. I think the correct way should be odata translator.
            rhn-engineering-shawkins WDYT?

            Matus Makovy added a comment - blafond What translator are you using during the import? I noticed that when I use 'odata' translator I get the error, but it works with 'ws' translator. I think the correct way should be odata translator. rhn-engineering-shawkins WDYT?

            blafond I tried to copy vdb from Advanced tab. There it is:

            <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            <vdb name="importVDB" version="1">
            	<description>Importer VDB</description>
            	<property name="UseConnectorMetadata" value="true" />
            	<property name="deployment-name" value="importVDB-vdb.xml" />
            	<model name="importVDBSrcModel" type="PHYSICAL" visible="true">
            		<source name="importVDBSrcModel" translator-name="odata" connection-jndi-name="java:/odata" />
            	</model>
            </vdb>
            

            and I pasted it to dynamic VDB. Then I tried to deploy it but I got the same error.

            Mario Majernik added a comment - blafond I tried to copy vdb from Advanced tab. There it is: <?xml version= "1.0" encoding= "UTF-8" standalone= "yes" ?> <vdb name= "importVDB" version= "1" > <description>Importer VDB</description> <property name= "UseConnectorMetadata" value= " true " /> <property name= "deployment-name" value= "importVDB-vdb.xml" /> <model name= "importVDBSrcModel" type= "PHYSICAL" visible= " true " > <source name= "importVDBSrcModel" translator-name= "odata" connection-jndi-name= "java:/odata" /> </model> </vdb> and I pasted it to dynamic VDB. Then I tried to deploy it but I got the same error.

            mmajerni@redhat.com The error looks like it's on temp vdb deployment in the OData processor which is in the Runtime. Could you try copy/pasting the VDB.xml from the "Advanced" tab in the importer and deploying it as a dynamic VDB (renamed) and see if it loads or has the same error?

            Barry LaFond added a comment - mmajerni@redhat.com The error looks like it's on temp vdb deployment in the OData processor which is in the Runtime. Could you try copy/pasting the VDB.xml from the "Advanced" tab in the importer and deploying it as a dynamic VDB (renamed) and see if it loads or has the same error?

            Mario Majernik added a comment - - edited

            blafond We tried with Matej newest TD (11.2.0.v20180723) with JDV 6.4.0 , 6.4.2 and 6.4.3.CR3 on three different machines (2x Fedora, 1x MacOS).

            I am adding Stacktrace :

            17:12:28,104 WARN  [org.teiid.RUNTIME] (teiid-async-threads - 4) TEIID50036 VDB importVDB.1 model "importVDBSrcModel" metadata failed to load. Reason:com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
             at [row,col {unknown-source}]: [1,0]: org.teiid.translator.TranslatorException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
             at [row,col {unknown-source}]: [1,0]
            	at org.teiid.translator.odata.ODataMetadataProcessor.getEds(ODataMetadataProcessor.java:113)
            	at org.teiid.translator.odata.ODataMetadataProcessor.process(ODataMetadataProcessor.java:118)
            	at org.teiid.translator.odata.ODataExecutionFactory.getMetadata(ODataExecutionFactory.java:123)
            	at org.teiid.translator.odata.ODataExecutionFactory.getMetadata(ODataExecutionFactory.java:64)
            	at org.teiid.query.metadata.NativeMetadataRepository.getMetadata(NativeMetadataRepository.java:96) [teiid-engine-8.12.14.6_4-redhat-64-3.jar:8.12.14.6_4-redhat-64-3]
            	at org.teiid.query.metadata.NativeMetadataRepository.loadMetadata(NativeMetadataRepository.java:62) [teiid-engine-8.12.14.6_4-redhat-64-3.jar:8.12.14.6_4-redhat-64-3]
            	at org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(ChainingMetadataRepository.java:55) [teiid-engine-8.12.14.6_4-redhat-64-3.jar:8.12.14.6_4-redhat-64-3]
            	at org.teiid.jboss.VDBService$6.run(VDBService.java:395) [teiid-jboss-integration-8.12.14.6_4-redhat-64-3.jar:8.12.14.6_4-redhat-64-3]
            	at org.teiid.jboss.VDBService$7.run(VDBService.java:446) [teiid-jboss-integration-8.12.14.6_4-redhat-64-3.jar:8.12.14.6_4-redhat-64-3]
            	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_172]
            	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_172]
            	at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_172]
            	at org.jboss.threads.JBossThread.run(JBossThread.java:122)
            Caused by: org.teiid.translator.TranslatorException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
             at [row,col {unknown-source}]: [1,0]
            	at org.teiid.translator.odata.BaseQueryExecution.buildError(BaseQueryExecution.java:199)
            	at org.teiid.translator.odata.ODataMetadataProcessor.getEds(ODataMetadataProcessor.java:103)
            	... 12 more
            Caused by: java.lang.RuntimeException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
             at [row,col {unknown-source}]: [1,0]
            	at org.odata4j.core.Throwables.propagate(Throwables.java:11)
            	at org.odata4j.stax2.staximpl.StaxXMLFactoryProvider2$StaxXMLEventReader2.nextEvent(StaxXMLFactoryProvider2.java:123)
            	at org.teiid.translator.odata.AtomErrorFormatParser.parse(AtomErrorFormatParser.java:53)
            	at org.teiid.translator.odata.AtomErrorFormatParser.parse(AtomErrorFormatParser.java:36)
            	at org.teiid.translator.odata.BaseQueryExecution.buildError(BaseQueryExecution.java:195)
            	... 13 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:677)
            	at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2139)
            	at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2045)
            	at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1134)
            	at org.codehaus.stax2.ri.Stax2EventReaderImpl.nextEvent(Stax2EventReaderImpl.java:255)
            	at org.odata4j.stax2.staximpl.StaxXMLFactoryProvider2$StaxXMLEventReader2.nextEvent(StaxXMLFactoryProvider2.java:121)
            	... 16 more
            

            Mario Majernik added a comment - - edited blafond We tried with Matej newest TD (11.2.0.v20180723) with JDV 6.4.0 , 6.4.2 and 6.4.3.CR3 on three different machines (2x Fedora, 1x MacOS). I am adding Stacktrace : 17:12:28,104 WARN [org.teiid.RUNTIME] (teiid-async-threads - 4) TEIID50036 VDB importVDB.1 model "importVDBSrcModel" metadata failed to load. Reason:com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog at [row,col {unknown-source}]: [1,0]: org.teiid.translator.TranslatorException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog at [row,col {unknown-source}]: [1,0] at org.teiid.translator.odata.ODataMetadataProcessor.getEds(ODataMetadataProcessor.java:113) at org.teiid.translator.odata.ODataMetadataProcessor.process(ODataMetadataProcessor.java:118) at org.teiid.translator.odata.ODataExecutionFactory.getMetadata(ODataExecutionFactory.java:123) at org.teiid.translator.odata.ODataExecutionFactory.getMetadata(ODataExecutionFactory.java:64) at org.teiid.query.metadata.NativeMetadataRepository.getMetadata(NativeMetadataRepository.java:96) [teiid-engine-8.12.14.6_4-redhat-64-3.jar:8.12.14.6_4-redhat-64-3] at org.teiid.query.metadata.NativeMetadataRepository.loadMetadata(NativeMetadataRepository.java:62) [teiid-engine-8.12.14.6_4-redhat-64-3.jar:8.12.14.6_4-redhat-64-3] at org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(ChainingMetadataRepository.java:55) [teiid-engine-8.12.14.6_4-redhat-64-3.jar:8.12.14.6_4-redhat-64-3] at org.teiid.jboss.VDBService$6.run(VDBService.java:395) [teiid-jboss-integration-8.12.14.6_4-redhat-64-3.jar:8.12.14.6_4-redhat-64-3] at org.teiid.jboss.VDBService$7.run(VDBService.java:446) [teiid-jboss-integration-8.12.14.6_4-redhat-64-3.jar:8.12.14.6_4-redhat-64-3] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_172] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_172] at java.lang. Thread .run( Thread .java:748) [rt.jar:1.8.0_172] at org.jboss.threads.JBossThread.run(JBossThread.java:122) Caused by: org.teiid.translator.TranslatorException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog at [row,col {unknown-source}]: [1,0] at org.teiid.translator.odata.BaseQueryExecution.buildError(BaseQueryExecution.java:199) at org.teiid.translator.odata.ODataMetadataProcessor.getEds(ODataMetadataProcessor.java:103) ... 12 more Caused by: java.lang.RuntimeException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog at [row,col {unknown-source}]: [1,0] at org.odata4j.core.Throwables.propagate(Throwables.java:11) at org.odata4j.stax2.staximpl.StaxXMLFactoryProvider2$StaxXMLEventReader2.nextEvent(StaxXMLFactoryProvider2.java:123) at org.teiid.translator.odata.AtomErrorFormatParser.parse(AtomErrorFormatParser.java:53) at org.teiid.translator.odata.AtomErrorFormatParser.parse(AtomErrorFormatParser.java:36) at org.teiid.translator.odata.BaseQueryExecution.buildError(BaseQueryExecution.java:195) ... 13 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:677) at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2139) at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2045) at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1134) at org.codehaus.stax2.ri.Stax2EventReaderImpl.nextEvent(Stax2EventReaderImpl.java:255) at org.odata4j.stax2.staximpl.StaxXMLFactoryProvider2$StaxXMLEventReader2.nextEvent(StaxXMLFactoryProvider2.java:121) ... 16 more

            mmajerni@redhat.com I tested my installed TD 11.2 in Dev Studio, started a JDV 6.4.0 instance (Teiid 8.12.x) and was able to import from that endpoint and import invokeHttp() and invoke() procedures. no errors.

            What server/runtime version are you testing against?

            Barry LaFond added a comment - mmajerni@redhat.com I tested my installed TD 11.2 in Dev Studio, started a JDV 6.4.0 instance (Teiid 8.12.x) and was able to import from that endpoint and import invokeHttp() and invoke() procedures. no errors. What server/runtime version are you testing against?

              Unassigned Unassigned
              mmajerni@redhat.com Mario Majernik
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: