struts2 error - sun.misc.Unsafe

121 views
Skip to first unread message

Mike Douglass

unread,
Apr 21, 2022, 12:31:41 AM4/21/22
to WildFly
I'm trying to upgrade to struts2. I have all jars loaded into wildfly modules so that might be relevant.

On trying to access the app I get a long stacktrace which terminates with 

Caused by: Cannot load excluded class: sun.misc.Unsafe - Class: org.jboss.modules.ModuleClassLoader
File: ModuleClassLoader.java
Method: findClass
Line: 200 - org/jboss/modules/ModuleClassLoader.java:200:-1
    at org.bedework.org.apache.struts2.core//com.opensymphony.xwork2.ognl.OgnlUtil.parseExcludedClasses(OgnlUtil.java:122)
    at org.bedework.org.apache.struts2.core//com.opensymphony.xwork2.ognl.OgnlUtil.setExcludedClasses(OgnlUtil.java:110)
    ... 134 more
Caused by: java.lang.ClassNotFoundException: sun.misc.Unsafe from [Module "org.bedework.org.apache.struts2.core" from local module loader @68ad99fe (finder: local module finder @485e36bc (roots: /Users/mike/bedework/quickstart-dev/wildfly/modules,/Users/mike/bedework/quickstart-dev/wildfly/modules/system/layers/base))]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:200)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)

The first message appears to come from an opensymphony class.

Anybody seen anything of this kind and can offer a clue?

Richard Opalka

unread,
Apr 21, 2022, 2:09:25 AM4/21/22
to Mike Douglass, WildFly
What WildFly and JDK version are you using?


--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/c88c847d-6fa0-45d5-8cb2-4a29d402f038n%40googlegroups.com.

Mike Douglass

unread,
Apr 21, 2022, 2:29:51 AM4/21/22
to Richard Opalka, WildFly
Sorry- would be useful info

Wildfly 26 and Java 11

Sent from my iPhone

On Apr 21, 2022, at 02:09, Richard Opalka <rop...@redhat.com> wrote:



Richard Opalka

unread,
Apr 21, 2022, 8:41:47 AM4/21/22
to Mike Douglass, WildFly
That is weird. It should work because the jdk.unsupported module
is available to all modules by default in WildFly 26.
Could you provide a simple reproducer?

Mike Douglass

unread,
Apr 21, 2022, 1:30:09 PM4/21/22
to WildFly
I can try - it's deep in the opensymphony code - early in the initialization. It calls Class.forName on each member of a list of "excluded" classes - whatever that means. Manages a bunch then fails on this one.

Mike Douglass

unread,
Apr 21, 2022, 3:13:38 PM4/21/22
to WildFly
I discovered that the list of excluded classes is built in to the struts-default.xml file in the jar. I was able to override the list and delete that member. It's now loading and now I have the kind of problems I expected.
Reply all
Reply to author
Forward
0 new messages