Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [LIKELY JUNK]RE: [eclipselink-dev] Running EclipseLink server tests without weaving?

Hi Sabine,

In the absence of dynamic weaving, I believe the most-likely case for users of production-level applications will be to run with static weaving (rather than now weaving). I suggest the tests in that configuration. There are some already some targets in our ant build that do the static weaving, so it should be possible to leverage them.

The above could be combined with the suggestion you have made about making the weaving flag explicit.

-Tom

Heider, Sabine wrote:
Hi James,

thanks for your reply, that explains my observation.

Unfortunately, the NetWeaver server doesn’t support dynamic weaving using class transformers either. We have already addressed this issue some time ago without success. I will file yet another bug for NetWeaver explaining that EclipseLink’s weaving relies on that but honestly I don’t expect any positive response unless we have a “real” business case... So let’s work with the assumption that NetWeaver doesn’t support dynamic weaving at all in the near future.

I don’t think that there is a need to disable weaving automatically inside the NetWeaver server. There is already a mechanism to disable weaving explicitly in the persistence.xml file, so we can document that the property “eclipselink.weaving” has to be set to “false” or “static” for the NetWeaver platform. (It would be cool if the server platform got a chance to check this actively and issue a warning if not set, but that would be only a nice-to-have feature.) I personally prefer explicit declaration to any kind of magic here.

That would mean, however, that the server tests need explicit declaration of the weaving behavior as well. I would propose the following approach (please let me know if you think it is feasible):

- All persistence.xml files that are used for the server tests get a property <property name="eclipselink.weaving" value="%%server-weaving%%"/>

- build.properties gets a property server.weaving=true; netweaver.properties (or any other server not supporting dynamic weaving) overwrites this with server.weaving=false

- build.xml replaces the token %%server-weaving%% with the value of the property server.weaving

What do you think?

If no one objects, I would try it out and provide a patch in case it works.

Best regards,

Sabine

*From:* eclipselink-dev-bounces@xxxxxxxxxxx [mailto:eclipselink-dev-bounces@xxxxxxxxxxx] *On Behalf Of *James Sutherland
*Sent:* Montag, 16. November 2009 16:29
*To:* Dev mailing list for Eclipse Persistence Services
*Subject:* [LIKELY JUNK]RE: [eclipselink-dev] Running EclipseLink server tests without weaving?

EclipseLink no longer has a dependency on a temp classloader being provided. But as it seems weaving is still not working, it seems Netweaver is not allowing for weaving in some other way?

My guess is NetWeaver is either,

- loading the entity classes before letting EclipseLink provide a class transformer,

- or, ignore the transformer that EclipseLink returns.

Could you determine which is the case?

It looks like we need to continue to disable weaving if there is no temp class loader, as it seems to be an indication of general lack of server support for performing any transformation of the entity classes.

Could you also ensure a bug is logged on NetWeaver that it is not compliant with the EJB 3 container requirements.

-----Original Message-----
*From:* Heider, Sabine [mailto:sabine.heider@xxxxxxx]
*Sent:* Monday, November 16, 2009 10:17 AM
*To:* eclipselink-dev@xxxxxxxxxxx
*Subject:* [eclipselink-dev] Running EclipseLink server tests without weaving?

Hi,

I’m trying to run the EclipseLink server tests inside a NetWeaver engine using the NetWeaver platform from the incubator. As a result, I get lots of errors that seem to be related with weaving, e.g.:

javax.persistence.PersistenceException: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.0.0.qualifier): org.eclipse.persistence.exceptions.IntegrityException
Descriptor Exceptions:
---------------------------------------------------------

Exception [EclipseLink-60] (Eclipse Persistence Services - 2.0.0.qualifier): org.eclipse.persistence.exceptions.DescriptorException Exception Description: The method [_persistence_setconcurrencyC_vh] or [_persistence_getconcurrencyC_vh] is not defined in the object [org.eclipse.persistence.testing.models.jpa.advanced.ConcurrencyA]. Internal Exception: java.lang.NoSuchMethodException: org.eclipse.persistence.testing.models.jpa.advanced.ConcurrencyA._persistence_getconcurrencyC_vh()
Mapping: org.eclipse.persistence.mappings.OneToOneMapping[concurrencyC]
Descriptor: RelationalDescriptor(org.eclipse.persistence.testing.models.jpa.advanced.ConcurrencyA --> [DatabaseTable(CONCURRENCYA)])

The NetWeaver server is not able to provide a temporary classloader, so dynamic weaving doesn’t work. The NetWeaver platform contains the following method (AFAIK taken from the JBoss platform), which should indicate to EL that there is no temp classloader, but apparently that mechanism doesn’t work:

public JPAClassLoaderHolder getNewTempClassLoader(PersistenceUnitInfo puInfo) {

        ClassLoader realClassLoader = puInfo.getClassLoader();

AbstractSessionLog.getLog().log(AbstractSessionLog.WARNING, "persistence_unit_processor_sap_temp_classloader_bypassed",//

                puInfo.getPersistenceUnitName(), realClassLoader);

return new JPAClassLoaderHolder(realClassLoader, NO_TEMP_CLASS_LOADER);

} So what is the correct mechanism to run the server tests with weaving being disabled?

I experimented with the settings in test.properties (test.agent=-Dignore and test.weaving=-DTEST_NO_WEAVING=true), which had some effect on the number of failing tests, but the NoSuchMethodExceptions remained. For testing purposes, I edited the persistence.xml file of one of the test applications to disable weaving, but that can’t be the proper way to do it...

What would you suggest?

Thanks and best regards,

Sabine

*Sabine Heider
**SAP AG*

Pflichtangaben/Mandatory Disclosure Statements:
http://www.sap.com/company/legal/impressum.epx


------------------------------------------------------------------------

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


Back to the top