Community
Participate
Working Groups
By default we lookup the datasource in JNDI using a composite name, which does not work on several (tomcat, jboss, geronimo, was?, most?) environments. We should instead default to looking up using string (assuming it works in everything, need to test wls, glassfish, oc4j, was). If it does not work in everything, then the serverplatform should auto set the lookup type. We should also make configuring the lookup type easier from jpa.
JBoss 5.0 GA update: As part of the JBoss 5.0 GA verification of EJB 3.0 support in bug# 252965 We need to reverify whether JBoss 5 functions fine using the default COMPOSITE_NAME_LOOKUP of 2 instead of STRING_LOOKUP of 1 - it looks like a SessionCustomizer may not be needed (only in the case of JBoss 5).
Updating priority due to revised bug categorization process. See the following page for details: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines#Priority_and_Target_Milestone If you feel the updated priority is incorrect, please send an email to eclipselink-users@eclipse.org.
>Reverified Tomcat 6.0.18 using a non-JTA external connection pool datasource - the SessionCustomizer is still required. javax.persistence.PersistenceException: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.0.0.qualifier): org.eclipse.persistence.exceptions.ValidationException Exception Description: Cannot acquire data source [java:comp/env/ds/OracleDS]. Internal Exception: javax.naming.NamingException: This context must be accessed throught a java: URL org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:276) The false result in JBoss may be the result of the fact that Direct Connection JDBC properties were present in the persistence.xml for transaction-type="RESOURCE_LOCAL" - so in effect no non-JTA datasource was actually tested.
I successfully deployed our JEE5 application to JBoss 5.1.0GA using EclipseLink as persistence provider without having to provide the SessionCustomizer. So, it looks like COMPOSITE_NAME_LOOKUP works in the latest JBoss version. Here is my persistence.xml as reference: <?xml version="1.0" encoding="windows-1252" ?> <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="ReferenceData" transaction-type="JTA"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <jta-data-source>java:/XARefDataDS</jta-data-source> <properties> <property name="eclipselink.target-server" value="JBoss"/> <property name="eclipselink.target-database" value="Oracle"/> <property name="eclipselink.logging.logger" value="DefaultLogger" /> <property name="eclipselink.logging.level" value="FINEST"/> <property name="eclipselink.weaving" value="false"/> <!-- Fully cache Company/Distributor because it's a vocabulary --> <property name="eclipselink.cache.type.Company" value="Full" /> <property name="eclipselink.cache.type.Distributor" value="Full" /> <!-- Fully cache License for performance --> <property name="eclipselink.cache.type.License" value="Full" /> <property name="eclipselink.cache.type.LicensedSources" value="Full" /> </properties> </persistence-unit> </persistence>
>See possible required catalina on JBoss 5.1.0 non-jta-datasource (jta-datasource is fine) datasource session customizer STRING_LOOKUP required for bug# 303063
>For JBoss 5.0.1 EAP, use of a non-jta-data-source is working without a SessionCustomizer - for reference >However there is at least one user configuration that still hits the "Not a compound name:" exception when doing a context lookup see bug# 317724 see deprecated catalina workaround for lookupType == STRING_LOOKUP http://wiki.eclipse.org/EclipseLink/Examples/JPA/Tomcat_Web_Tutorial#Session_Customizer >See similar "Not a compound name:" exception post in the EclipseLink newsgroup from Feb 2009 http://old.nabble.com/EclipseLink-cannot-acquire-datasource-in-JBoss-5.0-td22163382.html
>upping priority to p3 - as we have 2 customers that optionally can vote on this issue >Summary: The issue is normally all JTA and non-JTA connectors work fine >Some server/configuration environments for non-JTA only - need STRING_LOOKUP set via SessionCustomizer
>change target to "-" from future to get reprioritized. >2 users still have issues with non-JTA COMPOSITE_NAME_LOOKUP >change public class JNDIConnector implements Connector { protected DataSource dataSource; protected Context context; protected String name; public static final int STRING_LOOKUP = 1; public static final int COMPOSITE_NAME_LOOKUP = 2; public static final int COMPOUND_NAME_LOOKUP = 3; //default setting is composite name to be consistent with previous TopLink versions protected int lookupType = COMPOSITE_NAME_LOOKUP; >to protected int lookupType = STRING_LOOKUP;
bug scrubbing to 2.4
Deferring. Please vote for this issue if it is still a problem for you.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink