Bug 383257 - Detect servers supported by integrations and automatically enable the appropriate integration
Summary: Detect servers supported by integrations and automatically enable the appropr...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 383201
  Show dependency tree
 
Reported: 2012-06-21 12:54 EDT by Craig Ringer CLA
Modified: 2022-06-09 10:16 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Ringer CLA 2012-06-21 12:54:12 EDT
Build Identifier: N/A. Affects EclipseLink 2.4.0-RC2 and 2.3.3-M3

EclipseLink doesn't activate the JBossPlatform adapter (org.eclipse.persistence.platform.server.jboss.JBossPlatform) when deployed on JBoss AS 7 unless explicitly told to with:

<property name="eclipselink.target-server" value="jboss"/>

in persistence.xml. Consequently it uses generic assumptions about the server platform and among other things fails to find the JTA TransactionManager (https://bugs.eclipse.org/bugs/show_bug.cgi?id=365704).

When testing, the expected result would be for EclipseLink to recognise a JBoss AS 7 environment and activate the correct adapter automatically.

Reproducible: Always

Steps to Reproduce:
1. Grab the testcase at https://github.com/ringerc/scrapcode/tree/master/testcases/javaee/JBossAS7-EclipseLink-Module/as7.eclipselink by cloning git://github.com/ringerc/scrapcode.git and cd'ing to scrapcode/testcases/javaee/JBossAS7-EclipseLink-Module/as7.eclipselink

2. Read the README (https://github.com/ringerc/scrapcode/blob/master/testcases/javaee/JBossAS7-EclipseLink-Module/as7.eclipselink/README) showing how to add EclipseLink to AS 7, enable detailed logging, and run the test. You're only interested in ExplicitClassesTest, so you can add @Ignore to the class level of NoWorkaroundsTest and ExplicitClassesAndTxWorkaroundTest if desired.

3. mvn test . Note several failures.

4. edit src/main/java/META-INF/explicit-classes-persistence.xml and add                         <property name="eclipselink.target-server" value="jboss"/>

5. mvn clean test . Note that the test now passes.
Comment 1 Craig Ringer CLA 2012-06-21 13:28:21 EDT
It turns out this isn't a bug, it's a wishlist/todo item with a side-serve of usability bug.

Tom Ware notes (https://bugs.eclipse.org/bugs/show_bug.cgi?id=365704#c26) that EclipseLink doesn't do any server detection. Proper support requires setting <property name="eclipselink.target-server" value="jboss"/> (or whatever other server you are using) to get the right integration and platform adapter. Thus this bug isn't really to do with AS7.

Leaving the blocker in place because the current behavior doesn't tell the user anything about why EclipseLink doesn't work properly on AS7 if they haven't set the required property. All they see is that queries fail because EclipseLink can't get a transaction from JTA.

It seems to me that either:

- AS7 should to recognise Eclipse and feed it the target-server property in a way that a persistence unit configuration can still override; or
- Eclipse needs to detect it's running within AS7 and default to the appropriate platform adapter / integration.

The vague and hand-wavy nature of the above show that this needs design discussion before any implementation effort. See https://community.jboss.org/en/jbossas7/dev .

Leaving this issue in place as a feature req.
Comment 2 Tom Ware CLA 2012-06-21 13:34:00 EDT
FYI: Both GlassFish and WebLogic feed EclipseLink the target server property when creating Container managed EntityManagers.  They do not even to detect whether they are feeding the property to EclipseLink because it is an EclipseLink specific property and other app servers will ignore it.
Comment 3 Craig Ringer CLA 2012-06-23 09:49:30 EDT
Tom: It seems sensible for JBoss to do the same, it'd be a trivial change.

In the mean time users can set a system property to make this transparent to their deployments:

$JBOSS_HOME/bin/jboss-cli.sh --connect '/system-property=eclipselink.target-server:add(value=JBoss)'
Comment 4 Craig Ringer CLA 2012-06-23 10:19:49 EDT
Added JIRA issue for JBoss to pass this property; https://issues.jboss.org/browse/AS7-5063 . I'll see if I can come up with something when it's not 11pm...
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:07:13 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:16:50 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink