解决hibernate3的“System property org.xml.sax.driver not specified”异常错误。
I got a SAXException("System property org.xml.sax.driver not specified") when I tried to run the SchemaExportTask.
I solved the problem by installing jaxp. I then had to make sure that all the jars (dom.jar sax.jar xalan.jar xercesImpl.jar xsltc.jar) were in lib/endorsed under both my jdk installation root and my jre installation root.
Hope that helps someone, Bobby
so,in conclusion,in order to make it works as fine as you expected,you can do as the following ways to get an XMLReader: (1) XMLReader parser=XMLReaderFactory.createXMLReader(String className); (2) System.setProperty("org.xml.sax.driver","org.apache.xerces.parsers.SAXParser"); XMLReader parser=XMLReaderFactory.createXMLReader(); (3) System.setProperty("org.xml.sax.parser","org.apache.xerces.parsers.SAXParser"); XMLReader parser=XMLReaderFactory.createXMLReader(); (4) more directly XMLReader parser=new org.apache.xerces.parsers.SAXParser();
note that: 1) in case (3),the parser is an instance of ParserAdaptor,it doesn't support the feture "http://xml.org/sax/features/validation",differented from the other cases. 2) in case (2),the class you specified should implement the interface XMLReader, in case (3),the class you specified should implement the interface SAXParser.org.apache.xerces.parsers.SAXParser is applicable in both case.
我是采用第二种办法解决的。
WARN [(ehcache.config.Configurator)] No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/D:/tools/eclipse3.1/workspace/osworkflowfromcvs/lib/optional/ehcache.jar!/ehcache-failsafe.xml
ERROR [(spi.hibernate.SpringHibernateFunctionalWorkflowTestCase)] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'osworkflowConfiguration' defined in class path resource [osworkflow-spring.xml]: Can't resolve reference to bean 'workflowStore' while setting property 'store'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'workflowStore' defined in class path resource [osworkflow-spring.xml]: Can't resolve reference to bean 'sessionFactory' while setting property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [osworkflow-spring.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: antlr/ANTLRException
解决办法将antlr的jar包加上就好了。
解决hibernate2转移到hibernate3的
ERROR [(org.hibernate.LazyInitializationException)] could not initialize proxy - the owning Session was closed