Java: Enum : NoClassDefFoundError

后端 未结 2 1649
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-15 18:00

I am facing issues while using enum in my J2EE application. I am using enum in a switch case inside my stateless service bean.

During runtime I see following exception

2条回答
  •  不知归路
    2021-02-15 18:25

    I have a project configuration quite similar to yours: eclipse, Maven, JDK 1.6, JBoss EAP6.2, and I have the same problem with a java.lang.NoClassDefFoundError when using an enum in a switch case.

    I have found a workaround for it: generate an ear file (it is a war in my case) and install it manually from the JBoss administration console. I noticed the war includes the $1 needed classes and then you won't get the exception.

    This is just a workaround, but it works for me. A good point of this workaround is that subsequent deployments done through eclipse work!

    I will be listening to the answers to your question because I want a real solution.

提交回复
热议问题