Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-6230

Programmatic configuration of hibernate fails

XMLWordPrintable

      I try to programmatically configure hibernate 3.2 in MBean:

      String mappings = " <?xml version=\"1.0\"?><hibernate-mapping></hibernate-mapping>";
      new Configuration()
      .addXML(mappings)
      .setProperty("hibernate.session_factory_name", "hibernate/Test")
      .setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect")
      .setProperty("hibernate.connection.datasource", "java:/database")
      .setProperty("hbm2ddl.auto", "update")
      .setProperty("current_session_context_class", "thread").buildSessionFactory();

      and recieve this exception:

      org.apache.xerces.parsers.ObjectFactory$ConfigurationError: Provider PK not found
      at org.apache.xerces.parsers.ObjectFactory.newInstance(Unknown Source)
      at org.apache.xerces.parsers.ObjectFactory.findJarServiceProvider(Unknown Source)
      at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
      at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
      at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
      at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at java.lang.Class.newInstance0(Class.java:355)
      at java.lang.Class.newInstance(Class.java:308)
      at org.xml.sax.helpers.NewInstance.newInstance(NewInstance.java:51)
      at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:187)
      at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:150)
      at org.dom4j.io.SAXHelper.createXMLReader(SAXHelper.java:83)
      at org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:894)
      at org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:715)
      at org.dom4j.io.SAXReader.read(SAXReader.java:435)
      at org.dom4j.io.SAXReader.read(SAXReader.java:365)
      at org.hibernate.cfg.Configuration.addXML(Configuration.java:435)

      If I place xerces-3.2.6.jar from hibernate distribution, configuration will succeed, but jboss will not deploy any jar because it will be unable to parse descriptor

              sebersole Steve Ebersole (Inactive)
              deady_jira Vladimir Penkov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: