Skip to main content


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 12:17 Go to next message
MJ is currently offline MJFriend
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 14:40 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
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:stack overflow with subquery
Goto Forum:
  


Current Time: Fri Apr 19 21:12:50 GMT 2024

Powered by FUDForum. Page generated in 0.03387 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top