Hi,
I'm using schemaexport with MySQL on WLS8.1SP3
I've used the mapping document below to run the application and it works. I managed to deploy the connection pool and test it on WLconsole. On MySQL log, I can get the test string I specified on the console. It seems the WL side is working ok.
However, when I started to write some POJOs and tried to run schemaexport, I got the stack trace below.
I've tried some properties on hibernate_reference manual,
using < property name="jndi.url">t3://localhost:7001/jdbc/semJDBCDataSource</property>
Modified connection.datasource to java:/comp/env/jdbc/semJDBCDataSource
but none of these works.
Is there some property that I'm missing here? Is it possible to pass the JNDI url to the JNDI initialContext explicitly ( hibernate API says that connection.datasource should suffice )?
Thanks for the reply.
Hibernate version: 3.0
Mapping documents:
Code:
<hibernate-configuration>
<session-factory name="hibernate_SessionFactory">
<property name="connection.datasource">jdbc/semJDBCDataSource</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<mapping resource="Person.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Full stack trace of any exception that occurs:Code:
schemaexport:
[schemaexport] 16:42:59,115 FATAL DatasourceConnectionProvider: - Could not find datasource: jdbc/semJDBCDataSource
[schemaexport] javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
[schemaexport] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
[schemaexport] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
[schemaexport] at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
[schemaexport] at javax.naming.InitialContext.lookup(InitialContext.java:351)
[schemaexport] at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:44)
[schemaexport] at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:80)
[schemaexport] at org.hibernate.tool.hbm2ddl.SchemaExport$ProviderConnectionHelper.getConnection(SchemaExport.java:431)
[schemaexport] at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:130)
[schemaexport] at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:99)
[schemaexport] at org.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:142)
[schemaexport] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[schemaexport] at org.apache.tools.ant.Task.perform(Task.java:364)
[schemaexport] at org.apache.tools.ant.Target.execute(Target.java:341)
[schemaexport] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[schemaexport] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[schemaexport] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[schemaexport] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[schemaexport] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[schemaexport] at org.apache.tools.ant.Main.runBuild(Main.java:668)
[schemaexport] at org.apache.tools.ant.Main.startAnt(Main.java:187)
[schemaexport] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
[schemaexport] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Name and version of the database you are using:
MySQL-standar-4.1.11
mysql-connector-java-3.1.10-bin.jar