[weld-issues] [JBoss JIRA] (WELD-2613) ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError

2020-03-28 Thread Jira
Title: Message Title


 
 
 
 

 
 
 

 
   
 Matěj Novotný updated  WELD-2613  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Weld /  WELD-2613  
 
 
  ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError   
 

  
 
 
 
 

 
Change By: 
 Matěj Novotný  
 
 
Status: 
 Pull Request Sent Resolved  
 
 
Resolution: 
 Done  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c)  
 
 

 
   
 

  
 

  
 

   

___
weld-issues mailing list
weld-issues@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-issues

[weld-issues] [JBoss JIRA] (WELD-2613) ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError

2020-03-28 Thread Jira
Title: Message Title


 
 
 
 

 
 
 

 
   
 Issue was automatically transitioned when Matěj Novotný created pull request #1978 in GitHub  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Weld /  WELD-2613  
 
 
  ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError   
 

  
 
 
 
 

 
Change By: 
 Matěj Novotný  
 
 
Status: 
 Open Pull Request Sent  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c)  
 
 

 
   
 

  
 

  
 

   

___
weld-issues mailing list
weld-issues@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-issues

[weld-issues] [JBoss JIRA] (WELD-2613) ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError

2020-03-28 Thread Jira
Title: Message Title


 
 
 
 

 
 
 

 
   
 Matěj Novotný commented on  WELD-2613  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError   
 

  
 
 
 
 

 
 I've sent the PR removing Unsafe usage for this release. For the next one, we should look into how to properly solve this. But I guess we cannot avoid multi release jar anymore. And even with that, there might be some limitations with the JDK 11 approach.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c)  
 
 

 
   
 

  
 

  
 

   

___
weld-issues mailing list
weld-issues@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-issues

[weld-issues] [JBoss JIRA] (WELD-2613) ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError

2020-03-28 Thread Jira
Title: Message Title


 
 
 
 

 
 
 

 
   
 Matěj Novotný assigned an issue to Matěj Novotný  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Weld /  WELD-2613  
 
 
  ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError   
 

  
 
 
 
 

 
Change By: 
 Matěj Novotný  
 
 
Git Pull Request: 
 https://github.com/weld/core/pull/1978  
 
 
Assignee: 
 Matěj Novotný  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c)  
 
 

 
   
 

  
 

  
 

   

___
weld-issues mailing list
weld-issues@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-issues

[weld-issues] [JBoss JIRA] (WELD-2613) ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError

2020-03-02 Thread Jira
Title: Message Title


 
 
 
 

 
 
 

 
   
 Matěj Novotný commented on  WELD-2613  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError   
 

  
 
 
 
 

 
 Well, we could just back out of it and stick with only setAccessible(). IIRC this Unsafe trick was only meant as a bypass for those warnings anyway (and it didn't really work in JDK 12+).  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c)  
 
 

 
   
 

  
 

  
 

   

___
weld-issues mailing list
weld-issues@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-issues

[weld-issues] [JBoss JIRA] (WELD-2613) ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError

2020-03-02 Thread Jira
Title: Message Title


 
 
 
 

 
 
 

 
   
 Matěj Novotný updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Weld /  WELD-2613  
 
 
  ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError   
 

  
 
 
 
 

 
Change By: 
 Matěj Novotný  
 
 
Fix Version/s: 
 3.1.4.Final  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c)  
 
 

 
   
 

  
 

  
 

   

___
weld-issues mailing list
weld-issues@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-issues

[weld-issues] [JBoss JIRA] (WELD-2613) ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError

2020-02-28 Thread Laird Nelson (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Laird Nelson commented on  WELD-2613  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError   
 

  
 
 
 
 

 
 The user reports JDK 11. I think the issue is almost certainly going to have to do with the module path. With the module path in play, Unsafe is now located in two modules. It's in the jdk.unsupported module, which clearly the user must not be reading in this case, and in the jdk.base module but with a new package name (jdk.internal.misc.Unsafe). My guess is that the user is running (perhaps unknowingly) with the module path in play but without explicitly doing anything to read the jdk.unsupported module. Boom: NoClassDefFoundError. In any event, Unsafe is now officially 100% a Mess™ so if there's some way to avoid using it that may be best for the long term.   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c)  
 
 

 
   
 

  
 

  
 

   

___
weld-issues mailing list
weld-issues@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-issues

[weld-issues] [JBoss JIRA] (WELD-2613) ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError

2020-02-28 Thread Jira
Title: Message Title


 
 
 
 

 
 
 

 
   
 Matěj Novotný commented on  WELD-2613  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError   
 

  
 
 
 
 

 
 Hi Laird Nelson are you sure this was JDK 11? Because I remember adding this for JDK 11 and even in JDK 12 (as this line suggests) there was Unsafe, just not accessible this way (maybe not at all, not sure now). Either way, all of these hacks are there just to bypass problems with class defining in JDK 9+ and in SE. EE integrations typically have control over class loading and their implementations of ProxyServices allow them to define new classes without these hacks. We should really have a different solution, but I am not sure what that would be. The problem is that we need to add proxies to:  
 
The package where the original bean class was, this is a requirement so that package private access on beans won't break 
Custom package for any proxy that is built for any class from Java core as you were never allowed to add classes there 
 In newer JDKs you cannot crack open a CL without a warning (ATM Weld should work with these warning on newer ones) and the modular approach to class defining didn't allow you to register classes into other people's packages or to add it to a not-yet-existing package (the custom one). I am open to suggestions regarding how to do this properly, but back when I tried, I simply didn't figure it out.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c)  
 
 

 
   
 

  
 

  
 

[weld-issues] [JBoss JIRA] (WELD-2613) ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError

2020-02-27 Thread Laird Nelson (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Laird Nelson created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Weld /  WELD-2613  
 
 
  ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Affects Versions: 
 3.1.3.Final  
 
 
Assignee: 
 Unassigned  
 
 
Components: 
 Reflection layer  
 
 
Created: 
 28/Feb/20 12:11 AM  
 
 
Priority: 
  Major  
 
 
Reporter: 
 Laird Nelson  
 

  
 
 
 
 

 
 I tried to do my homework but didn't see any other issue in the issue tracker with Weld as the project and "sun misc Unsafe" as search keywords. Feel free to close if this is a duplicate. ClassUtils.java line 75 features a blind invocation of sun.misc.Unsafe that throws a NoClassDefFoundError under JDK 11. Here's the source link: https://github.com/weld/core/blob/8d4fb65fcba96a41abbf8c019f8162a786cc1435/impl/src/main/java/org/jboss/weld/util/bytecode/ClassFileUtils.java#L75 It's my understanding that Unsafe is no longer present in JDK 11. We stumbled across this when a user mistakenly used the module path in case it matters.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment