Announcement Announcement Module
Collapse
No announcement yet.
White spaces are required between publicId and systemId. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • White spaces are required between publicId and systemId.

    Hello,

    I'm developing a Spring (2.5.6) application. When deploying my WAR file to JBoss (5.0.1.GA) I get the error message below. Not sure what I'm doing wrong. The JPetStore sample application deploys fine. My applicationContext.xml is similar to the sample's xml. Am I missing libraries?

    Any help very much appreciated as stuck now!
    Regards,
    Nes

    Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to parse schema for nsURI=http://www.springframework.org/schema/tx, baseURI=null, schemaLocation=null
    ...
    Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to parse schema for nsURI=http://www.springframework.org/schema/tx, baseURI=null, schemaLocation=null
    ...
    Caused by: org.jboss.xb.binding.JBossXBRuntimeException: -1:-1 1:55 White spaces are required between publicId and systemId.
    ...
    Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to parse schema for nsURI=http://www.springframework.org/schema/tx, baseURI=null, schemaLocation=null
    ...
    Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to parse schema for nsURI=http://www.springframework.org/schema/tx, baseURI=null, schemaLocation=null

  • #2
    Generally, the "White spaces are required between publicId and systemId" is gotten when the xml file in not well formed. You might want to double check the validity of applicationContext.xml, if you are missing some dtds or you might have an invalid element out there in your xml.

    It would helpful if you could post applicationContext.xml and the full stack trace of the exception.

    Comment


    • #3
      There are 2 XML configuration files that use that schema, applicationContext.xml and applicationContext-hibernate.xml. I've attached them both here. Both files validate though (using the Validate function in Eclipse). I've also attached the relevant section from the server.log file.

      Many thanks!
      Nes

      Comment


      • #4
        I've had some tricky issues deploying my Hibernate applications in JBoss 5. In my case, the problems trace back to the Hibernate .jars included as part of the JBoss distribution.

        In most cases, removing all of JBoss's Hibernate .jars and replacing them with my more recent versions fixes the issues.

        I'm not sure if this is causing your apparent XML parsing problems, but it may be worth looking at. Be sure to back up any files you replace in your JBoss distribution.

        Comment


        • #5
          Originally posted by jamestastic View Post
          I've had some tricky issues deploying my Hibernate applications in JBoss 5. In my case, the problems trace back to the Hibernate .jars included as part of the JBoss distribution.

          In most cases, removing all of JBoss's Hibernate .jars and replacing them with my more recent versions fixes the issues.

          I'm not sure if this is causing your apparent XML parsing problems, but it may be worth looking at. Be sure to back up any files you replace in your JBoss distribution.
          Tried your suggestion, but same error

          Comment


          • #6
            You're right, it definitely looks like an XML parsing problem, which is strange because the XML looks just fine to me.

            According to this this forum, it could be the fault of the Spring dtd, which is odd because it doesn't look like you're referencing it. It seems to spring up with JBoss 5.0.1. Have you tried a different app server, like JBoss 4 or Tomcat?

            Comment


            • #7
              The problem is that JBoss deployer sometimes tries to parse xml files even if it makes no sense at all (why should JBoss ever try to parse Spring contexts?). For example - I noticed that he tries to parse _all_ xml files he finds in ejb modules.

              I guess that your xml files are in some "special" place like WEB-INF and that if you move them somewhere else it should be ok.

              Comment


              • #8
                Jboss blames Spring and Spring blames JBOSS

                Jboss blames Spring and Spring blames JBOSS

                see link below.

                http://www.jboss.org/index.html?modu...opic&p=4214388

                Comment


                • #9
                  My XML files are in WEB-INF, but isn't this where Spring looks for them? Happy to relocate them, but where to?

                  ps: Does seem it is JBoss 5 specific as I have deployed similar webapps to earlier versions of JBoss fine before. Just wanted to bring everything up to latest versions with this new webapp.
                  Last edited by nesyarug; Mar 28th, 2009, 02:43 PM.

                  Comment


                  • #10
                    I thought I'd give it another try on JBoss 5.1.0.GA, but running into the exact same problem. I since moved all my Spring configurations to XML Schema-based configuration. Funny thing is the app runs without any problems on JBoss 4.2.3.GA.

                    Same error:

                    Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to parse schema for nsURI=http://www.springframework.org/schema/context, baseURI=null, schemaLocation=null

                    Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to parse schema for nsURI=http://www.springframework.org/schema/context, baseURI=null, schemaLocation=null

                    Caused by: org.jboss.xb.binding.JBossXBRuntimeException: -1:-1 1:55 White spaces are required between publicId and systemId.

                    Anyone ran into same and was able to resolve?
                    Last edited by nesyarug; Oct 25th, 2009, 07:53 PM.

                    Comment


                    • #11
                      By the process of elimination I've now narrowed it down to a specific file, but can't for the life of me figure out what could be wrong.

                      The problematic file is my Hibernate/DAO configuration applicationContext-hibernate.xml. Strange however that it seems to fail with the "White spaces" error on the XSD for the first non-default namespace in the XML file.

                      Here is my "beans" tag:

                      Code:
                      <?xml version="1.0" encoding="UTF-8"?>
                      <beans xmlns="http://www.springframework.org/schema/beans"
                      	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
                      	   xmlns:tx="http://www.springframework.org/schema/tx"
                      	   xsi:schemaLocation="http://www.springframework.org/schema/beans
                      	   					   http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                      	   					   http://www.springframework.org/schema/context
                      	   					   http://www.springframework.org/schema/context/spring-context-2.5.xsd
                      	   					   http://www.springframework.org/schema/tx
                      	   					   http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
                      When the first non-default namespace tag starts with "<context:", in my case:

                      Code:
                      <context:annotation-config />
                      the error is:

                      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to parse schema for nsURI=http://www.springframework.org/schema/context, baseURI=null, schemaLocation=null

                      When I remove that line so that the first non-default namespace tag starts with "<tx:", in my case:

                      Code:
                      <tx:annotation-driven transaction-manager="transactionManager" />
                      the error is:

                      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to parse schema for nsURI=http://www.springframework.org/schema/tx, baseURI=null, schemaLocation=null

                      Does that make sense to anyone?

                      Comment


                      • #12
                        Any resolution on this one? I too am stuck at this point.

                        Comment


                        • #13
                          I have no idea why JBoss complains about these files in 5.x but moving them into a folder under WEB-INF/ seems to do the trick. For some reason, the JBoss deployer scans all xml files under WEB-INF/ and chokes on declarations such as <tx:annotation-driven/> or <context:annotation-config/>

                          Comment


                          • #14
                            I wanted to mention that also after updating my application to Spring 3.0.2.RELEASE this problem still exists.

                            Nes

                            Comment


                            • #15
                              Finally success! When posted my last message I re-read the last post before that (from Costin Leau) aand realized that it was actually quite simple to test. Somehow I didn't understand it before as I had in my mind that Spring was hardwired to read these files from WEB-INF and I misread "a directory under WEB-INF" for "in WEB-INF".

                              Anyhow, I moved the problematic files into a new directory WEB-INF/appctx, updated my web.xml:

                              <context-param>
                              <param-name>contextConfigLocation</param-name>
                              <param-value>/WEB-INF/appctx/applicationContext-hibernate.xml /WEB-INF/appctx/applicationContext-security.xml...

                              and the "White spaces are required between publicId and systemId" disappeared

                              I then had to go through a whole bunch of other issues, but I'm running on JBoss 5.1.0 now.

                              Many thanks for all your support.
                              Nes

                              Comment

                              Working...
                              X