Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » javax.naming.NoInitialContextException using "generate tables from entities"
javax.naming.NoInitialContextException using "generate tables from entities" [message #511652] Tue, 02 February 2010 07:17 Go to next message
MJ is currently offline MJ
Messages: 8
Registered: December 2009
Junior Member
Hello,
Presently I have a working persistence.xml file - I can deploy my project and it runs correctly, storing entities in the database using container managed transactions. Unfortunately when I run "generate tables from entities" using Dali I get the exception listed below. Changing transaction-type to resource_local to bypass the app server works fine, but container managed doesn't seem to work. From what the guys in the Dali forum tell me, the table create is delegated to eclipselink. Any ideas what's going wrong?


<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
	<persistence-unit name="SCBCDEntities" transaction-type="JTA">
		<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
		<jta-data-source>DBConn1</jta-data-source>
		<class>examples.persistence.User</class>
		<class>examples.persistence.Item</class>
		<class>examples.persistence.Bid</class>
		<properties>
			<property name="eclipselink.target-server" value="WebLogic_10"/>
			<property name="eclipselink.logging.level" value="FINEST"/>
			<property name="eclipselink.ddl-generation" value="create-tables"/>
			<property name="eclipselink.ddl-generation.output-mode" value="database"/>
		</properties>
	</persistence-unit>
</persistence>



Exception [EclipseLink-23004] (Eclipse Persistence Services - 1.1.2.v20090612-r4475): org.eclipse.persistence.exceptions.TransactionException
Exception Description: Error obtaining the Transaction Manager
Internal Exception: Exception [EclipseLink-23001] (Eclipse Persistence Services - 1.1.2.v20090612-r4475): org.eclipse.persistence.exceptions.TransactionException
Exception Description: Error looking up external Transaction resource under JNDI name [weblogic.transaction.TransactionManager]
Internal Exception: 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 org.eclipse.persistence.exceptions.TransactionException.errorObtainingTransactionManager(TransactionException.java:125)
	at org.eclipse.persistence.transaction.JTATransactionController.<init>(JTATransactionController.java:64)
	at org.eclipse.persistence.transaction.wls.WebLogicTransactionController.<init>(WebLogicTransactionController.java:27)





Thanks,
MJ
Re: javax.naming.NoInitialContextException using "generate tables from entities" [message #511690 is a reply to message #511652] Tue, 02 February 2010 09:40 Go to previous message
Chris Delahunt is currently offline Chris Delahunt
Messages: 1017
Registered: July 2009
Senior Member
Hello MJ,

From the bit thats there, the exception is coming from trying to look up weblogic.transaction.TransactionManager from within a new InitialContext, which throws the NoInitialContextException, which is odd if it is occuring within the server. Can you provide the full exception stack trace?

Best Regards,
Chris
Previous Topic:XML Representation of SDO Change Summary
Next Topic:ConcurrentModificationException prior to updating entity.
Goto Forum:
  


Current Time: Wed Aug 20 02:54:11 EDT 2014

Powered by FUDForum. Page generated in 0.01438 seconds