Forum Discussion

hbjastad's avatar
hbjastad
Contributor
9 years ago

ClassNotFoundException: com.jp.protection.pub.License when running generated war file

See the stacktrace below, which I now get when trying to access the virt from a generated war file.

 

A few interesting observations:

1. This was working all of last week, so I'm not sure what has changed now.

2. I can see that the lib file Protection-4.6.jar, which contains the class com.jp.protection.pub.License is not included in the war file. Unfortunately, I don't have a copy of the war files from last week (they're overwritten by the new one), so I can't check if it was present last week.

3. The problem is there whether I generate the war file from the UI or from the command line

4. The problem is there whether I run version 1.7.0 or the latest nightly snapshot.

5. This started happening after I installed the nightly snapshot, but I don't know if it's just a coincidence.

 

Maybe this is related to https://community.smartbear.com/t5/Service-Virtualization-Virtual/NullPointerException-from-logger-when-generating-mock-war-file/m-p/123207 - which I also did not notice all of last week?

 

 

HTTP ERROR 500

Problem accessing /. Reason:

    Server Error

Caused by:

java.lang.NoClassDefFoundError: Lcom/jp/protection/pub/License;

        at java.lang.Class.getDeclaredFields0(Native Method)

        at java.lang.Class.privateGetDeclaredFields(Class.java:2583)

        at java.lang.Class.getDeclaredFields(Class.java:1916)

        at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:649)

        at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:356)

        at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:375)

        at com.google.inject.internal.BindingBuilder.toInstance(BindingBuilder.java:82)

        at com.smartbear.ready.license.LicenseModule.configure(LicenseModule.java:26)

        at com.google.inject.PrivateModule.configure(PrivateModule.java:97)

        at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)

        at com.smartbear.ready.license.headless.HeadlessLicenseInitializerModule.configureModule(HeadlessLicenseInitializerModule.java:47)

        at com.smartbear.ready.license.LicenseInitializerModule.configureModule(LicenseInitializerModule.java:30)

        at com.smartbear.ready.license.headless.HeadlessLicenseInitializerModule.configure(HeadlessLicenseInitializerModule.java:39)

        at com.google.inject.AbstractModule.configure(AbstractModule.java:59)

        at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)

        at com.google.inject.spi.Elements.getElements(Elements.java:101)

        at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133)

        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)

        at com.google.inject.Guice.createInjector(Guice.java:95)

        at com.google.inject.Guice.createInjector(Guice.java:72)

        at com.google.inject.Guice.createInjector(Guice.java:62)

        at com.eviware.soapui.mockaswar.MockAsWarProServlet$MockServletSoapUIProCore.<init>(MockAsWarProServlet.java:69)

        at com.eviware.soapui.mockaswar.MockAsWarProServlet.initMockServiceParameters(MockAsWarProServlet.java:33)

        at com.eviware.soapui.mockaswar.MockAsWarServlet.init(MockAsWarServlet.java:75)

        at javax.servlet.GenericServlet.init(GenericServlet.java:244)

        at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:640)

        at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:496)

        at org.eclipse.jetty.servlet.ServletHolder.ensureInstance(ServletHolder.java:788)

        at org.eclipse.jetty.servlet.ServletHolder.prepare(ServletHolder.java:773)

        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:578)

        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)

        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)

        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)

        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1174)

        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)

        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)

        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1106)

        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)

        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)

        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)

        at org.eclipse.jetty.server.Server.handle(Server.java:524)

        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)

        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)

        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)

        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)

        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)

        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)

        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)

        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)

        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)

        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)

        at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.ClassNotFoundException: com.jp.protection.pub.License

        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)

        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)

        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)

        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)

        at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:487)

  • Ok, I added the libs Protection-4.6.jar and ProtectionPriv-4.6.jar to the war file manually - and then it worked. So at least I have a workaround...but it would be good to know what causes Ready!API to suddenly not include those libs.

    • AV's avatar
      AV
      SmartBear Alumni (Retired)

      Hello, hbjastad!

      Thanks for pointing out the problem, could you describe your environment (R!A version and OS)? What have you been doing last week what could cause this issue (updating the project version, adding extra test steps into you project, et)?

      • hbjastad's avatar
        hbjastad
        Contributor

        Hi Ilya, as mentioned above, I installed the latest nightly snapshot yesterday (as per Tanya's request in another thread). Other than that, I don't think I made any relevant changes.

        I have tried with ReadyAPI-1.7.0 (which I used all of last week) and ReadyAPI-1.7.0-m-SNAPSHOT, both giving the same result. And I have tried both command line and UI. OS is Windows, unfortunately.