- This topic has 1 reply, 2 voices, and was last updated 18 years, 8 months ago by Haris Peco.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
andrzejmParticipantHi
When I try to create mapping I am getting exception but when I run application using the same configuration files I do not have any problems. I was able to do the mapping with beta 4.1 but after last update of MyEclipse I cannot do it any more.
Any idea what should be changed? This is MyEclipse 4.1 running on Eclipse 3.1.1. Data source is defined in Tomcat context file.Here is output from log file:
!ENTRY org.eclipse.core.runtime 4 2 2006-02-23 17:25:34.726 !MESSAGE An internal error occurred during: "Generating Artifacts". !STACK 0 org.hibernate.HibernateException: Could not find datasource at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:366) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1855) at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:68) at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$5.execute(GenerateArtifactsJob.java:393) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:68) at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:388) at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:255) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76) Caused by: 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 at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247) at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284) at javax.naming.InitialContext.lookup(InitialContext.java:351) at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52) ... 12 more
Here is hibernate configuration file :
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <!-- Generated by MyEclipse Hibernate Tools. --> <hibernate-configuration> <session-factory> <property name="dialect">org.hibernate.dialect.Oracle9Dialect</property> <property name="connection.datasource">java:comp/env/jdbc/sedata</property> <mapping resource="hibernate/Clients.hbm.xml" /> <mapping resource="hibernate/Oraconfigs.hbm.xml" /> <mapping resource="hibernate/EmployeeTms.hbm.xml"></mapping> <mapping resource="hibernate/ClientMedia.hbm.xml" /> <mapping resource="hibernate/Cpu.hbm.xml" /> <mapping resource="hibernate/CpuIcc.hbm.xml" /> <mapping resource="hibernate/CpuDevice.hbm.xml" /> </session-factory> </hibernate-configuration>
Haris PecoMemberandrzejm,
If ‘ create mapping’ mean ‘reverse engineering’, then you have to use jdbc or some application server – you can’t access tomcat’s jndi out of tomcat’s JVM
Best
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)