This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 86097 - Set toplink weaving to false for J2EE version < 5
Summary: Set toplink weaving to false for J2EE version < 5
Status: RESOLVED INVALID
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-28 22:52 UTC by Rochelle Raccah
Modified: 2008-01-23 13:50 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rochelle Raccah 2006-09-28 22:52:30 UTC
This came from a discussion about issue 83475.

It can be helpful if NB detects using JPA in a J2EE 1.4 or earlier 
container and sets weaving to false.

The way to do it is to add the following line into persistence.xml:

<property name="toplink.weaving" value="false"/>
Comment 1 Erno Mononen 2007-02-16 10:41:52 UTC
Can be implemented for example by changing the 
o.n.m.j2ee.persistence.provider.Provider#getDefaultVendorSpecificProperties() 
so that it takes the Java EE version as an argument. Should be doable for 6.0, 
setting the TM accordingly. 
Comment 2 Andrei Badea 2008-01-15 14:42:28 UTC
Issue 83475 desc20 says that setting toplink.weaving to false "did not help
and I got the same exception:".

Who does this issue help?
Comment 3 mvatkina 2008-01-15 21:33:08 UTC
This is independent of the original issue - dynamic weaving is not possible if the container can't provide the
appropriate setup. But it can very well be that TopLink now doesn't even try to weave if it's not possible.
Comment 4 Andrei Badea 2008-01-21 13:24:50 UTC
I was reading the TopLink sources recently and I think I saw that it silently doesn't do any weaving if the agent is not
on the classpath. But perhaps that was only for the Java SE environment -- I'm not sure.

Anyway, I don't understand much what this issue is about, whom it helps and what problem it avoids. I plan to close it
as INVALID soon unless more information is provided. Thanks.
Comment 5 mvatkina 2008-01-22 21:26:36 UTC
The issue is about containers that do not provide tight JPA integration (i.e. whose version is prior to JEE 5). In such
containers users can only rely on Java SE style to get a hold of EMF, but can't use dynamic weaving because they do not
start the VM themselves. Originally TopLink tried to perform the weaving anyway and threw an exception. It might be very
well the case that since then they've fixed the problem and skip the weaving if they can't do it. No agent in classpath
won't help as it's packaged into the main jar.
Comment 6 Andrei Badea 2008-01-23 13:50:34 UTC
OK, thanks for explaining. I checked with Tomcat and it seems that TopLink sets weaving to false by default, so I'm
closing this issue.