[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [eclipselink-users] Eclipselink persistence.xml on Tomcat 6.0 error

Jan,
	Hi, I verified that the following ways to run EclipseLink JPA on Tomcat 6 are OK.  
	There don't seem to be any issues using a Tomcat 6 JNDI datasource either in or out of the web container.

	- Tomcat WAR servlet running application managed EclipseLink JPA against a Tomcat JTA/non-JTA JNDI datasource
	- J2SE stand alone out-of-container class running application managed EclipseLink JPA against a Tomcat JTA/non-JTA JNDI datasource

	For your specific javax.naming error below - verify that your JNDI datasource is set as detailed by the following tutorial (the Resource and Context elements are set in conf/server.xml) on top of using a SessionCustomizer.
	I get the following error if I either 
		1) use the wrong datasource name in persistence.xml or 
		2) <Host><Context...> does not reference <GlobalNamingResources><Resource...> properly

>> <non-jta-data-source>java:comp/env/jdbc/appDS</non-jta-data-source> I
>> get an "javax.naming.NamingException: This context must be accessed
>> throught a java: URL"

	EclipseLInk JPA on Tomcat 6 Web application tutorial.
	http://wiki.eclipse.org/EclipseLink/Examples/JPA/Tomcat_Web_Tutorial#JNDI_Datasource_Setup

	thank you
	/michael

-----Original Message-----
From: MICHAEL.OBRIEN@xxxxxxxxxx 
Sent: Thursday, April 24, 2008 10:46
To: Jan.Vissers@xxxxxxxxxx; EclipseLink User Discussions
Subject: RE: [eclipselink-users] Eclipselink persistence.xml on Tomcat
6.0 error


Jan,
	Hi, I saw the messages for the (non-J5EE) servlet/jsp container setup using tomcat/catalina.  If JBoss 4 is not using Tomcat version 6 like WebSphere CE(Geronimo) is - then I would like to see if version 6 changes behavior from 5.  

10:23:41,661 INFO  [Http11Protocol] Initializing Coyote HTTP/1.1 on http-127.0.0.1-8080
10:23:41,664 INFO  [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009
10:23:41,664 INFO  [Catalina] Initialization processed in 228 ms
10:23:46,593 INFO  [TomcatDeployer] deploy, ctxPath=/unified, warUrl=.../tmp/deploy/tmp65265unifiedEAR.ear-contents/unifiedWeb-exp.war/

	I have not worked with Glassfish yet but will also setup that server and get back to you with any differences.

	/michael

-----Original Message-----
From: Jan Vissers [mailto:Jan.Vissers@xxxxxxxxxx]
Sent: Thursday, April 24, 2008 8:31 AM
To: EclipseLink User Discussions
Subject: RE: [eclipselink-users] Eclipselink persistence.xml on Tomcat
6.0 error


Hi michael,

Doesn't JBoss use Tomcat by default as web container? Do you know of any
issues of using JNDI in, say a Sun Glassfish setup?

-J.


> Leon,
> 	Hi, the eclipselink property is
>
> 		eclipselink.session.customizer
> 		http://wiki.eclipse.org/Customizing_the_EclipseLink_Application_(ELUG)
>
> persistence.xml:
>             <property name="eclipselink.session.customizer"
> value="org.eclipse.persistence.example.unified.integration.JPAEclipseLinkSessionCustomizer"/>
>
> JPAEclipseLinkSessionCustomizer.java:
> 		// Change from Composite to String_Lookup
> 		connector.setLookupType(JNDIConnector.STRING_LOOKUP);
>
> 	I ran into the same Composite/String JNDI issue when deploying to JBoss
> 4.2.2 and required the use of a similar SessionCustomizer like the
> java.net post, however deploying to OC4J 11 did not require one.  It
> looks like these issues may be due to the Tomcat and JBoss
> implementations as OC4J works fine without it.  I am going to checkout
> Tomcat 6 and reproduce this issue.
>
> 	/michael
>
>
> -----Original Message-----
> From: Leon Derks [mailto:leon.derks@xxxxxxxxxx]
> Sent: Thursday, April 24, 2008 2:25 AM
> To: EclipseLink User Discussions
> Subject: Re: [eclipselink-users] Eclipselink persistence.xml on Tomcat
> 6.0 error
>
>
> Hello
>
> What is the eclipselink property for the old property
> name="toplink.session.customizer"?
> And is this an eclipselink or tomcat bug?
>
> Leon
>
>
> Leon Derks wrote:
>> Hello
>>
>> Today I tried to run my application on Tomcat 6.0
>>
>> I replaced the connection properties in persistence.xml into
>> <non-jta-data-source>java:comp/env/jdbc/appDS</non-jta-data-source>
>>
>> When I use <non-jta-data-source>jdbc/appDS</non-jta-data-source> I get
>> an "javax.naming.NameNotFoundException: Name jdbc is not bound in this
>> Context"
>>
>> When I use
>> <non-jta-data-source>java:comp/env/jdbc/appDS</non-jta-data-source> I
>> get an "javax.naming.NamingException: This context must be accessed
>> throught a java: URL"
>>
>> This is the same problem as described in:
>> http://forums.java.net/jive/message.jspa?messageID=158622
>>
>> There was also found a solution by adding <property
>> name="toplink.session.customizer"
>> value="com.company.application.JPAToplinkSessionCustomizationUtil"/>
>> to the persistence.xml
>>
>> But is this with eclipselink still necessary?
>>
>> Leon
>>
>>
>>
>>
>> _______________________________________________
>> eclipselink-users mailing list
>> eclipselink-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>
>>
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users