White spaces are required between publicId and systemId

前端 未结 5 1948
心在旅途
心在旅途 2020-12-01 10:12

I am trying to make a ajax call to other domain locally from my computer by writing some proxy code in jsp. And this is my jQuery AJAX code that is calling proxy.jsp page. <

相关标签:
5条回答
  • 2020-12-01 10:49

    I just found my self with this Exception, I was trying to consume a JAX-WS, with a custom URL like this:

    String WSDL_URL= <get value from properties file>;
    Customer service = new Customer(new URL(WSDL_URL));
    ExecutePtt port = service.getExecutePt();
    return port.createMantainCustomers(part);
    

    and Java threw:

    XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,63]
    Message: White spaces are required between publicId and systemId.
    

    Turns out that the URL string used to construct the service was missing the "?wsdl" at the end. For instance:

    Bad:

    http://www.host.org/service/Customer
    

    Good:

    http://www.host.org/service/Customer?wsdl
    
    0 讨论(0)
  • 2020-12-01 10:50

    Change the order of statments. For me, changing the block of code

    xsi:schemaLocation="http://www.springframework.org/schema/beans 
                        http://www.springframework.org/schema/context
                        http://www.springframework.org/schema/beans/spring-beans.xsd" 
    

    with

    xsi:schemaLocation="http://www.springframework.org/schema/beans 
                        http://www.springframework.org/schema/beans/spring-beans.xsd
                        http://www.springframework.org/schema/context"
    

    is valid.

    0 讨论(0)
  • 2020-12-01 10:51

    The error message is actually correct if not obvious. It says that your DOCTYPE must have a SYSTEM identifier. I assume yours only has a public identifier.

    You'll get the error with (for instance):

    <!DOCTYPE persistence PUBLIC
        "http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
    

    You won't with:

    <!DOCTYPE persistence PUBLIC
        "http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" "">
    

    Notice "" at the end in the second one -- that's the system identifier. The error message is confusing: it should say that you need a system identifier, not that you need a space between the publicId and the (non-existent) systemId.

    By the way, an empty system identifier might not be ideal, but it might be enough to get you moving.

    0 讨论(0)
  • 2020-12-01 10:58

    If you're working from some network that requires you to use a proxy in your browser to connect to the internet (likely an office building), that might be it. I had the same issue and adding the proxy configs to the network settings solved it.

    • Go to your preferences (Eclipse -> Preferences on a Mac, or Window -> Preferences on a Windows)
    • Then -> General -> expand to view the list underneath -> Select Network Connections (don't expand)
    • At the top of the page that appears there is a drop down, select "Manual."
    • Then select "HTTP" in the list directly below the drop down (which now should have all it's options checked) and then click the "Edit" button to the right of the list.
    • Enter in the proxy url and port you need to connect to the internet in your web browser normally.
    • Repeat for "HTTPS."

    If you don't know the proxy url and port, talk to your network admin.

    0 讨论(0)
  • 2020-12-01 11:06

    I just found this post: http://forum.springsource.org/showthread.php?68949-White-spaces-are-required-between-publicId-and-systemId./page2&s=c69fe19798f5a071d22eaf681ca84a56

    A couple people here had success by switching the lines around in an XML file.

    0 讨论(0)
提交回复
热议问题