Yesterday I tried to put the MySQL data source configuration mysql-ds.xml under the JBoss run, succeeded; then I want the Oracle Data source configuration oracle-ds.xml can also run under the JBoss. I tried it, and the following error was reported when I started Eclipse:
11:04:48, 078 info [settingsfactory] JDBC driver: Oracle JDBC driver, version: 9.2.0.1.0
11:04:48, 125 error [abstractkernelcontroller] Error installing to start: Name = persistence. Unit: unitname = # ztf state = create
Javax. Persistence. persistenceexception: [persistenceunit: ztf] unable to build entitymanagerfactory
At org. hibernate. EJB. ejb3configuration. buildentitymanagerfactory (ejb3configuration. Java: 677)
At org. hibernate. EJB. hibernatepersistence. createcontainerentitymanagerfactory (hibernatepersistence. Java: 132)
At org. JBoss. JPA. Deployment. persistenceunitdeployment. Start (persistenceunitdeployment. Java: 311)
Caused by: org. hibernate. hibernateexception: Unknown Oracle major version [0]
At org. hibernate. dialect. dialectfactory $1. getdialectclass (dialectfactory. Java: 173)
At org. hibernate. dialect. dialectfactory. determinedialect (dialectfactory. Java: 88)
At org. hibernate. dialect. dialectfactory. builddialect (dialectfactory. Java: 62)
11:04:48, 265 error [profileservicebootstrap] failed to load profile: Summary of incomplete deployments (see previous errors
For details ):
* ** Contexts missing dependencies: Name-> dependency {required State: Actual State}
JBoss. J2EE: jar = entitybean. jar, name = personservicebean, service = ejb3
-> <Unknown JBoss. J2EE: jar = entitybean. jar, name = personservicebean, service = ejb3> {described: ** unresolved demans
'Persistence. Unit: unitname = # ztf '**}
* ** Contexts in error: Name-> Error
Persistence. Unit: unitname = # ztf-> org. hibernate. hibernateexception: Unknown Oracle major version [0]
<Unknown JBoss. J2EE: jar = entitybean. jar, name = personservicebean, service = ejb3>-> ** unresolved demands
'Persistence. Unit: unitname = # ztf '**
11:04:48, 453 info [http11protocol] Starting coyote HTTP/1.1 on http-127.0.0.1-8090
This problem occurs, then Google a bit on the Internet, in http://forum.hibernate.org/viewtopic.php? The answer is found under P = 2373597.
The problem I encountered has been solved as follows:
1. Configure the data source of <JTA-data-source> in persistence. XML as Java:/ztfds.
2. Add the SQL dialect <property name = "hibernate. dialect" value = "org. hibernate. dialect. oracle9dialect"/> under persistence. xml.
Data source configuration in JBoss is divided into the following situations:
1. the mysql-ds.xml is selected, and the corresponding location of this file is set to <JNDI-Name> ztfds </JNDI-Name>, then in persistence. the corresponding settings in XML are as follows: <JTA-data-source>Java: ztfds</JTA-data-source>.
2. the oracle-ds.xml is selected, and the corresponding location of this file is set to <JNDI-Name> ztfds </JNDI-Name>, then in persistence. the corresponding settings in XML are as follows: <JTA-data-source>Java:/ztfds</JTA-data-source>.