0

I am trying to upgrade my application server from Tomcat 6 to Tomcat 8, which is using cutom realm. After changing the server.xml file to point to our custom realm started getting exception :-

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

Caused by: java.lang.NoClassDefFoundError: org.apache.catalina.deploy.SecurityConstraint at java.lang.Class.getMethods(Class.java:1357) at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsIntrospectionSource.createManagedBean(MbeansDescriptorsIntrospectionSource.java:297) at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsIntrospectionSource.execute(MbeansDescriptorsIntrospectionSource.java:77) at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsIntrospectionSource.loadDescriptors(MbeansDescriptorsIntrospectionSource.java:70) at org.apache.tomcat.util.modeler.Registry.load(Registry.java:582) at org.apache.tomcat.util.modeler.Registry.findManagedBean(Registry.java:485) at org.apache.tomcat.util.modeler.Registry.registerComponent(Registry.java:614) at org.apache.catalina.util.LifecycleMBeanBase.register(LifecycleMBeanBase.java:161) at org.apache.catalina.util.LifecycleMBeanBase.initInternal(LifecycleMBeanBase.java:61) at org.apache.catalina.realm.RealmBase.initInternal(RealmBase.java:1214) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) ... 18 more Caused by: java.lang.ClassNotFoundException: org.apache.catalina.deploy.SecurityConstraint at java.net.URLClassLoader.findClass(URLClassLoader.java:607) at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:844) at java.lang.ClassLoader.loadClass(ClassLoader.java:823) at java.lang.ClassLoader.loadClass(ClassLoader.java:803) at java.lang.Class.getVirtualMethodsImpl(Native Method)

Tried checking the catalian.jar in TOMCAT/lib, when extracted I could not find the SecurityConstraint.class.

Any idea 1)why is it not there 2) how to fix this issue . so that we can deploy the application.

Michal
  • 15,429
  • 10
  • 73
  • 104
Kiran
  • 183
  • 5
  • 19

2 Answers2

1

SecurityConstraint class has moved to org.apache.tomcat.embed:tomcat-embed-core

Ahmed Ebaid
  • 417
  • 6
  • 21
  • Please don't add _Me too!_ as an answer. It doesn't actually provide an answer to the question and can be perceived as noise by its future visitors. If you have a different but related question, then [ask](http://stackoverflow.com/questions/ask) it (reference this one if it will help provide context). If you're interested in this specific question, you can show your interest by [upvoting](http://stackoverflow.com/help/privileges/vote-up) it or leaving a [comment](http://stackoverflow.com/help/privileges/comment) once you have enough [reputation](http://stackoverflow.com/help/whats-reputation). – Xavi López Jun 28 '16 at 16:07
  • Thank you, As of now I am trying to move to Tomcat 7 & then to 8. Am trying step by step. Still the question come's if the java file is present in other jar file, still why I am getting error at deployment ? – Kiran Jun 30 '16 at 05:05
  • Yes, as mentioned above it has been moved to another jar. – Ahmed Ebaid Jun 30 '16 at 14:55
  • thanks Xavi Lopez for your comment. Will def. do that next time. – Ahmed Ebaid Jul 01 '16 at 16:13
0

The other answer mentions that SecurityConstraint was moved, but it mentions that it was moved to a location thats only relevant to the embedded version of Tomcat. For the regular version of tomcat 8, the class was moved to

org.apache.tomcat.util.descriptor.web.SecurityConstraint

inside tomcat-util-scan.jar

Bob
  • 1,219
  • 1
  • 14
  • 28